So, the signals address, cs, and q should be declared as in the following?
ENTITY homework7 IS
PORT (clk, resetn : IN std_logic;
pixelout : OUT std_logic_vector(2 DOWNTO 0));
END homework7;
ARCHITECTURE behavior OF homework7 IS
BEGIN
PROCESS
VARIABLE prow : INTEGER RANGE 0 TO 479 := 0;
VARIABLE pcol : INTEGER RANGE 0 TO 639 := 0;
VARIABLE count : INTEGER RANGE 0 TO 2 := 0;
VARIABLE address :IN std_logic_vector(9 DOWNTO 0);
VARIABLE cs :IN std_logic;
VARIABLE q :OUT std_logic_vector(2 DOWNTO 0);
VARIABLE paddress :std_logic_vector(9 DOWNTO 0):= "0000000000";
BEGIN
rom1: lpm_rom --megafunction to input data from picture
GENERIC MAP (lpm_width => 3, lpm_widthad => 10,
--3-bits per pixel
LPM_FILE => "picture.mif", --and 10-bit address
LPM_ADDRESS_CONTROL => "UNREGISTERED",
--for 1024 locations
LPM_OUTDATA => "UNREGISTERED")
PORT MAP(paddress => address, memenab => cs, q => q);
I do not know the correct way to use lpm_rom and read a particular address location. Currently I'm using 'paddress' and advancing that as in: paddress := paddress + 1;.
Thank you,
Mike