Forum Discussion
Altera_Forum
Honored Contributor
12 years agoThank you tricky, finally I ended up with this:
function slv_to_altera_2d_type(dataa : std_logic_vector; datab : std_logic_vector) return altera_mf_logic_2d is
variable ret : altera_mf_logic_2D(1 downto 0,(dataa'high - dataa'low) downto 0);
variable temp_dataa,temp_datab : std_logic_vector((dataa'high - dataa'low) downto 0);
begin
temp_dataa:=dataa;
temp_datab:=datab;
for i in temp_dataa'range loop
ret(0,i) :=temp_dataa(i);
ret(1,i) :=temp_datab(i);
end loop;
return ret;
end function; It seems to work smoothly. One last question.. The lpm_mux uses a STD_LOGIC_2D input type. Can I assign it directly like input(0,16 downto 0)<=signal1(16 downto 0);
input(1,16 downto 0)<=signal2(16 downto 0); Thank you all guys. have a nice day !