在C中,你可以这样做:
int a[5] = {1, 2, 3, 4, 5};
在 VHDL 上,我需要在函数中做同样的事情。现在看起来像这样:
type rom_type is array (0 to 1) of std_logic_vector(1 downto 0);
function get_rom return rom_type is
variable rom: rom_type;
begin
rom(0) := "10";
rom(1) := "01";
return rom;
end;
有没有办法让数组填充和c中一样?像这样的东西:
rom := {"10", "01"};
是的
rom := ("10", "01");