Altera_Forum
Honored Contributor
17 years agoRPA FLEX 10K problem with data bus
Hi All
This may well be the wrong place to ask this question. If so, I apologize in advance... just ignore my ignorance. On the off chance I am in the right place... The project I am currently working on requires an on-device RAM block that can be written to and read from over the onboard data bus. The simulations all run OK, but when I install the solution onto the real hardware the RAM block does not function at all as expecting. Here is my VHDL code (and I believe all the ports are pinned correctly). I have reduced it down to the bear essentials... the full version routes many of the memory registers to various other blocks around the circuit.... but I can't even get the noddy version to function correctly. LIBRARY ieee; USE ieee.std_logic_1164.all; USE ieee.std_logic_arith.all; --------------------------------------------------------- ENTITY basic_ram IS PORT ( clock : IN STD_LOGIC; addr : IN INTEGER RANGE 0 TO 30; -- Data port address data : INOUT STD_LOGIC_VECTOR(7 DOWNTO 0); -- Data port awr_n : IN STD_LOGIC; -- Date port write ard_n : IN STD_LOGIC); -- Data port read END basic_ram; --------------------------------------------------------- ARCHITECTURE behavior OF basic_ram IS TYPE vector_array IS ARRAY (0 TO 30) OF STD_LOGIC_VECTOR(7 DOWNTO 0); SIGNAL memory : vector_array; BEGIN PROCESS(clock) BEGIN IF RISING_EDGE(clock) THEN IF (awr_n='1') THEN memory(addr) <= data; ELSIF (ard_n='1') THEN data <= memory(addr); ELSE data <= "ZZZZZZZZ"; END IF; END IF; END PROCESS; END behavior; I have also written a simple application that uses the altera_write and altera_read commands to poke and peek the various addresses. At present what I can do is write to memory address 0x0000 and the content will be stored correctly. However, when I read back 0x0004, 0x0008 (all addresses divisible by 4 - maybe the first two bits of the address bus are not useable) that all contain the value I poked into 0x0000. All other addresses return 0xFF. I used the following fiocon command to get the ttf on to the device: fiocon -ttf simple_ram.ttf -ca 20.0 -cb 10.0 -pca 1 -pcf 0 The card is from the RPA Flex 10K series and the device is the EPK10K100ARC240-1. This is really bugging me as I would think that this would be a very trivial implementation but I'm utterly stuck, and yet again feeling like a fool for not being able to figure it out. Many thanks in advance for any guidance you might be able to offer. Kurt