G
gabor
Guest
I write almost exclusively Verilog code, but I inherited a
VHDL project and I need to make some changes to it.
I'm trying to make this human-readable, but I'm not
versed with VHDL, so I have no clue even what to look this up
under:
This code works, but it is not very readable:
signal flash_addr_i : std_logic_vector (18 downto 0) ;
.. . .
elsif ((flash_addr_i < 128) and write_flag = '1') then
-- How can a human being make sense of of this?
-- and why is 128 OK for the comparison above and not
-- for the assignment below?
flash_addr_i <= "0000000000010000000";
end if;
.. . .
I want to say:
flash_addr_i <= 128;
But then I get messages about flash_addr_i is not compatible with
with type of 128.
and if I try a hex constant like:
flash_addr_i <= x"00080";
I get bit width mis-match problems.
How can I write the equivalent of the Verilog:
flash_addr_i <= 19'd128;
or
flash_addr_i <= 19'h80;
I can't believe there's no way to do this in VHDL?
Stumped,
Gabor
VHDL project and I need to make some changes to it.
I'm trying to make this human-readable, but I'm not
versed with VHDL, so I have no clue even what to look this up
under:
This code works, but it is not very readable:
signal flash_addr_i : std_logic_vector (18 downto 0) ;
.. . .
elsif ((flash_addr_i < 128) and write_flag = '1') then
-- How can a human being make sense of of this?
-- and why is 128 OK for the comparison above and not
-- for the assignment below?
flash_addr_i <= "0000000000010000000";
end if;
.. . .
I want to say:
flash_addr_i <= 128;
But then I get messages about flash_addr_i is not compatible with
with type of 128.
and if I try a hex constant like:
flash_addr_i <= x"00080";
I get bit width mis-match problems.
How can I write the equivalent of the Verilog:
flash_addr_i <= 19'd128;
or
flash_addr_i <= 19'h80;
I can't believe there's no way to do this in VHDL?
Stumped,
Gabor