Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21345 Discussions

Byte Enabled RAM Issue

Altera_Forum
Honored Contributor II
1,470 Views

Hi,  

 

I am facing an issue while using byte enable memory. My memory is  

  • 128-bit wide 

  • dual clocked 

  • read clock runs at 400MHz while write clock runs at 200MHz 

  • Its depth is only 2 i.e. read and write addresses are 1-bit wide only 

  • Forced to map on M9Ks 

  • Read port is connected to 200MHz clock (instead of making a toggling signal using 400MHz clock) 

 

 

This RAM is written only once, 2 bytes at a time, during run time and then I read it for a long period. So I used total 16 clock cycles to fill complete. I have verified my logic in simulation but after synthesis and debugging using SignalTap I found that the RAM outputs are always zero. Input behavior is somewhat similar to the scenario i tested in simulation. Hope u may got what i am trying to do. I have checked the synthesis warning and I didn't found anything related to this RAM. 

 

Please try to correct me where did I make the violation of rule(s) related to memory usage. 

Thanks In Advance
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
718 Views

I want to add that this behavior varies with build to build i.e. some time RAM works correct. Some time I get a corrupted data at the output and some times no output. Different synthesis results in different outcomes

0 Kudos
Altera_Forum
Honored Contributor II
718 Views

What FPGA target are you using? Did you get any critical warning from TimeQuest? I don't really understand what you did on the read port. Are you using a 400MHz clock or 200MHz?

0 Kudos
Altera_Forum
Honored Contributor II
718 Views

Thanks for the reply Daixiwen, I am using EP4SGX230KF40C2 FPGA and the read clock running at 400MHz. Instead of using an alternating signal made using 400MHz, I used 200MHz clock and connected it with the read port. There is no related warning in the TimeQuest report

0 Kudos
Altera_Forum
Honored Contributor II
718 Views

I'm still not sure I'm getting it. Do you want to read only every other cycle? In that case why don't you use a 200MHz clock and keep the read signal always at 1? 

Are the other signals connected to the read port in the 400MHz clock domain?
0 Kudos
Altera_Forum
Honored Contributor II
718 Views

No, I want to read at every cycle of 400Mhz but since the depth of RAM is 2 so the possible values of addresses are 0 and 1 thats why i simply connected the 200MHz clock with read port of the RAM. In other words I read address 0 of RAM at a clock cycle of 400MHz and address 1 at the following clock cycle of 400MHz clock.  

 

Just to remove your curiousity, there is a lot of RAMs (total 138), each RAM occupies 4M9ks. This setup was made to save a big lot of registers (total 52,992 Registers). So Its hard to avoid this setup and I need to make these RAMs work. As I mentioned earlier there is an uncertainty about the working condition of these RAMs. We have 4 similar boards and we are getting different behaviors of RAMs at different boards with same bit file. We are not able to identify any fault in hardware setup because if board0 works with bit file0 the same board fails to work with a different bit file. 

 

Thanks for showing your interest....
0 Kudos
Altera_Forum
Honored Contributor II
718 Views

Oh I see.. by read port you meant the address port. Now I get it. 

I'd suggest to use a real signal that you toggle at each clock cycle instead of the 200MHz clock though, I don't know if Timequest would pick up the setup and hold requirements correctly when using a clock as an input signal. It's better to have all the signals (inputs and outputs) on the read port synchronized with the read clock. 

What options did you select for the memory blocks? According to the datasheet if the read-during-write behaviour is set to "old value" then the memory block is limited to 375MHz. It should be fine with the other settings though. 

Are your clock constraints set correctly? Does Timequest see all your internal clocks, with the correct frequencies?
0 Kudos
Altera_Forum
Honored Contributor II
718 Views

Ok it my trying synch read address instead of clock. I checked mega-wizard but i didn't find 'read during write operation limitation'. I am using a dual clock byte enable based memory and in this case this option didn't appear. Also I am doing read operation during write because read address is connected to the clock. I thought this should not effect the write section I mean i wont mind if the output of the memory is unstable for a few cycles (while writing). 

 

Clocks are correctly constrained and Timequest is indicating proper clocks' frequencies
0 Kudos
Altera_Forum
Honored Contributor II
718 Views

IIRC the memory block latches the read address on every clock [1], so the output bits change some time before the following clock. 

So you need to generate a 'read address' signal that changes every time the 400MHz clock changes - eg from a simple divide by 2 block. 

Make sure all the logic uses the same odd/even signal! 

A 200Mhz clock signal (generated by a PLL) probably won't have the guaranteed relationship to the 400Mhz clock. 

 

[1] assuming the clock-enable / address-hold (why are these named with opposite polarity?) doesn't affect things.
0 Kudos
Reply