Re: Block RAM strange behavior, address off by one
- From: Newman <newman5382@xxxxxxxxx>
- Date: 17 Apr 2007 22:21:50 -0700
On Apr 17, 11:02 pm, Peter Alfke <a...@xxxxxxxxxxxxx> wrote:
A few ideas:
Are you sure about the content of the various locations?
Could the error have happened when you wrote data into the BRAM?
When reading, read twicein sequence from the same address. Then you
will see whether this is a read pipelining problem, or whether you
really are always reading the wrong information.
The error has to somewhere in your timing.
Be a sleuth!
Peter Alfke
On Apr 17, 7:12 pm, Gabor <g...@xxxxxxxxxxx> wrote:
On Apr 17, 8:13 pm, "M. Hamed" <mhs...@xxxxxxxxx> wrote:
I am getting a strange error with Block RAM on a Spartan 3 FPGA. Every
time I issue a read, the word at the location previous to the given
address is read. For example if I'm reading from address 5, the word
at address 4 is output instead. The data written to the block seems
correct when I view it in ModelSim so I assume it's something with the
read.
This does seem strange. Are your writes and reads always made to
sequential memory locations (i.e. 1, 2, 3, ... in order)? Perhaps the
error is in cycle timing and not address?
Viewing signals at the BRAM input in ModelSim shows the correct
address at the input of port A and the read clock signal goes high but
the wrong word appear at the output. ENA is always 1 and WEA is always
0. The very most recent Write to this same address (from a different
port) also shows the correct value being written.
The design works correctly in RTL but this problem only occurs with
the post-route netlist.
Did anyone encounter a similar problem like this before and can give
me a hint on what's going on.
The only time I've seen something similar was with an old version of
the
BRAM simulation models that needed a slight positive hold time in the
address. In effect it was the behavioral simulation that incorrectly
gave
the read data on the same clock that the address was presented. In
fact
BRAM's are registered in the Spartan 3 (and Virtex 2) series, so the
output data should have changed on the following clock cycle. In the
post-PAR timing simulation, the output changed on the following clock
cycle as expected.
Thank you.- Hide quoted text -
- Show quoted text -
If you generated the block RAM with coregen, there is an option to
preload the RAM with a coe file. You can then simulate the block RAM
both at the RTL and post P&R level, disable the writes in the code
and
see if you read the expected data designated by the coe file at the
desired addresses.
There are some instances when the RTL does not match the post P&R
simulation. i.e. (sensitivity list is incomplete in a combinatorial
process,
improper use of blocking assignments and variables) I don't use the
later two items
in synthesizable code, so I don't have much experience with them, but
then
again, I never get an RTL vs post P&R simulation mismatch because of
them.
Hope this helps,
Newman
.
- Follow-Ups:
- Re: Block RAM strange behavior, address off by one
- From: M. Hamed
- Re: Block RAM strange behavior, address off by one
- References:
- Block RAM strange behavior, address off by one
- From: M. Hamed
- Re: Block RAM strange behavior, address off by one
- From: Gabor
- Re: Block RAM strange behavior, address off by one
- From: Peter Alfke
- Block RAM strange behavior, address off by one
- Prev by Date: ModelSim Waveform naming question
- Next by Date: Analog FPGAs: how fast?
- Previous by thread: Re: Block RAM strange behavior, address off by one
- Next by thread: Re: Block RAM strange behavior, address off by one
- Index(es):
Relevant Pages
|