I am using RAM in a processor design and I am having trouble understanding exactly how best to use these functions for my design. I will be using them to implement stacks, program memory and data memory. Ideally the write function will look like an addressable register where the address, data and enables are setup prior to the clock and the write happens on the clock edge. The read should be async so that I can provide an address and get data after a delay.
The Altera part is an EP1K50 where the EAB read can be async. The write however is only shown as either fully async or fully registered. I recall that I was warned when reading and writing the same address the data out has a longer delay. But I can't seem to find a reference to that. I am also unclear if I can use the write the way I want or if it requires input registers.
The Xilinx part is an XC3S400 with dual port block rams. It seems like the read path must be registered as well as the write path. I think I could live with that if I could read the data that is being written (top of stack) in the same clock cycle. But I belive the docs say that the other port can either read the old data or is invalid. But then I may be able to use a single port ram for a stack. The address would always be pointing to the current TOS and as soon as a new value were pushed, the next clock edge would read the new data as it is written to the new address.
I don't want to pipeline anything in this design to keep it very simple. Right now the design is pretty clean and the delay paths are pretty short.
Can anyone clarify how these rams work without pipelining?