C
Chad
Guest
Hey all. What's the best way to perform, if possible, a generic
concatenation?
This is my original code:
PARAMS <= param(0) & param(1) & param(2) & param(3) & param(4);
But I'd like to make it generic to a given number of "param"s. I've
tried something like this:
generic(pnum : integer := 5);
.
.
.
process(param)
variable param_var : std_logic_vector(pnum-1 downto 0);
begin
for i in 0 to pnum-1 loop
param_var := param_var & param(i);
end loop;
PARAMS <= param_var;
end process;
Ideally, if I do it properly, it should synthesize to nothing but
wires since it is just a reordering of wires. Any ideas?
Thanks.
concatenation?
This is my original code:
PARAMS <= param(0) & param(1) & param(2) & param(3) & param(4);
But I'd like to make it generic to a given number of "param"s. I've
tried something like this:
generic(pnum : integer := 5);
.
.
.
process(param)
variable param_var : std_logic_vector(pnum-1 downto 0);
begin
for i in 0 to pnum-1 loop
param_var := param_var & param(i);
end loop;
PARAMS <= param_var;
end process;
Ideally, if I do it properly, it should synthesize to nothing but
wires since it is just a reordering of wires. Any ideas?
Thanks.