A
aleksazr
(using ieee.numeric_std.all)
A BRAM has two input signals (that I'm interested in)
WEA and ADDRA, both are slv.
I'm connecting std_logic to WEA, and integer to ADDRA.
Of course, tools complain, so I use the following function
(for WEA) to convert std_logic to std_logic_vector(0 downto 0):
function vectorize(s: std_logic) return std_logic_vector is
variable v: std_logic_vector(0 downto 0);
begin
v(0) := s;
return v;
end;
so I can type
wea => vectorize(sl)
directly into the port map.
ADDRA requires two steps:
convert integer to unsigned, then unsigned to slv:
ADDRA => slv(to_unsigned(int, width))
but ISE doesn't accept that directly in the port map,
and I have to create another signal just for that.
Is it possible to write a function similar to vectorize
that will accept an integer and convert it into slv,
so I can write something like
ADDRA => to_slv(to_unsigned(int, width))
or am I stuck at creating another signal?
A BRAM has two input signals (that I'm interested in)
WEA and ADDRA, both are slv.
I'm connecting std_logic to WEA, and integer to ADDRA.
Of course, tools complain, so I use the following function
(for WEA) to convert std_logic to std_logic_vector(0 downto 0):
function vectorize(s: std_logic) return std_logic_vector is
variable v: std_logic_vector(0 downto 0);
begin
v(0) := s;
return v;
end;
so I can type
wea => vectorize(sl)
directly into the port map.
ADDRA requires two steps:
convert integer to unsigned, then unsigned to slv:
ADDRA => slv(to_unsigned(int, width))
but ISE doesn't accept that directly in the port map,
and I have to create another signal just for that.
Is it possible to write a function similar to vectorize
that will accept an integer and convert it into slv,
so I can write something like
ADDRA => to_slv(to_unsigned(int, width))
or am I stuck at creating another signal?