Altera_Forum
Honored Contributor
14 years agoInstanciating dual port memory with different r/w widths
Im trying to get Quartus to infer a vhdl array of record as dual port memory with write side being a 32bit, and read side a N*32bit datawidth. To make it even more difficult, I need it to be inferred as two separate memory banks with two different address pointers on the read side.
Is this possible to do the simple way? Im trying something like this, but it doesnt find the memory, even if I try to add the ramstyle attribute.
--pseudocode (not verified)
type TableEntry is record
x : std_logic_vector(15 downto 0);
y : std_logic_vector(15 downto 0);
size_x : std_logic_vector(15 downto 0);
size_y : std_logic_vector(15 downto 0);
end record;
type TableArray is array (integer range 127 downto 0) of TableEntry;
signal Table : TableArray;
alias write_wordadr : std_logic_vector(2 downto 0) is addr(2 downto 0);
alias wrire_index : std_logic_vector(addr'high-3 downto 0) is addr(addr'high downto 3);
--writing from cpu
case conv_integer(write_wordadr) is
when 0=>
Table(write_index).x <=data(31 downto 16);
Table(write_index).y <=data(15 downto 0);
when 1=>
Table(write_index).size_x <=data(31 downto 16);
Table(write_index).size_y <=data(15 downto 0);
when others=>
end case;
--reading x,y
testx<=Table(posindex).x;
testy<=Table(posindex).y;
--reading size_x,size_y with different index
testsizex<=Table(sizeindex).size_x;
testsizey<=Table(sizeindex).size_y;