I looked at the function and I found this:
TYPE ROM IS ARRAY(0 TO 511) OF UNSIGNED(8 DOWNTO 0);
FUNCTION INIT_ROM RETURN ROM IS
VARIABLE romvar: ROM;
VARIABLE x: REAL;
begin
for I in 0 TO 511 loop
x:= SIN(real(i)*MATH_PI/real(511));
romvar(i):=CONV_UNSIGNED(INTEGER(x*real(511)),9);
end loop;
return romvar;
end;
I think I understand how the function works but I don't understand how to interface the ROM.
The ROM I want have the cos/sin value for 0-90 degrees with a resolution of 4096 samples.
So do i set the array size to 0 to 4096 and the function will create a ROM of that size.
But how do I do when I want to read a certain address?