Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

clock domain crossing through dual-port RAM

And my logic can assure that the read and write do not occur  at the same time.

 

If you guarantee that read and write do not collide, then you have no problems.  If you are able to avoid such collisions, then you can probably do without the dual port ram (and just use a register).  It's not the dual-port ram which provides safe clock domain crossings.  In a proper FIFO, it's the asynchronous FIFO logic (and not the dual-port ram) which provides this capability.

 

In any case, you should add comments to your code that avoiding read/write collisions is critical to the design, and thoroughly test the logic which implements this protection.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Expert Contributor
rcingham
Posts: 2,010
Registered: ‎09-09-2010
0

Re: On what planet is this OK?

"You are comparing a 34-bit register to 33-bit signal and register? Yes!"

An advantage of VHDL over Verilog in this sort of situation is that VHDL will always give a clear and unambiguous answer: a 34-bit signal NEVER equals a 33-bit signal. This forces the designer to be clear in their intentions.

------------------------------------------
"If it don't work in simulation, it won't work on the board."
Expert Contributor
gszakacs
Posts: 5,253
Registered: ‎08-14-2007
0

Re: On what planet is this OK?


rcingham wrote:
"You are comparing a 34-bit register to 33-bit signal and register? Yes!"

An advantage of VHDL over Verilog in this sort of situation is that VHDL will always give a clear and unambiguous answer: a 34-bit signal NEVER equals a 33-bit signal. This forces the designer to be clear in their intentions.

The Verilog LRM makes it quite clear what happens when dealing with arguments of different

sizes.  The smaller argument is extended with zeros unless all arguments are signed, and then

the smaller argument gets sign-extended.  While this behavior doesn't always make sense

(especially when comparing a smaller signed argument with a larger unsigned one), it is

not up to the synthesizer to decide how to do the comparison.  There is a right way to do it

by the LRM.  So in that regards, Verilog is no less clear than VHDL.

 

On the subject of dual port memory and clock crossings, the statement that when there is

a collision, the read data will be the older one because the RAM is read first only works

if the read and write clocks are the same.  If the collision occurs at some random

timing offset between write and read, there will be cases where the read data will

not be stable at the read clock edge.  This is no different than using a simple register

for CDC.  You need to make sure that read and write pointers into the RAM don't

collide in order to have a clean clock crossing.  If you don't understand how to do this,

then the best way is to use a FIFO from CoreGen.

 

-- Gabor

-- Gabor
Regular Contributor
jlqsczw_2007
Posts: 97
Registered: ‎06-28-2008
0

Re: On what planet is this OK?

[ Edited ]

simple dual-port RAM IP core----

 

 

 

 

 

 

 

I only wrrte six data in RAM ,wait for a while and read them every 1ms.

 

port A , a local DCM output whose input is a external EMIF_CLK,   100M

 

write enable and write addr are from DSP, asynchronous to FPGA

 

port B , an internal clock from another DCM, also 100M,

read enable is always valid,

read addr is generated using this clock

 

 

 

I  used chipscope to find the bug.

 

In most cases,all things are right.

 

The "write" should be right without considering the timing , at least the write enable and write data are there all the time.

 

Sometimes five data read from RAM are right ,but one is zero.

(The read logic is the same)

Sometimes all six data read from RAM are zero.

 

Now there are no error in the timing report.

 

I guess it's the setup or hold time of write or read that  does not meet the requirement.

 

But I do NOT know how to determine which one contribute to the bug ,write timing error, read timing error or CDC error ??? setup or hold timing ?

 

What I can do is only slow down the read or write speed.

Or add OFFSET constraints,  write enable , write addr, write data regarding write clock,   read addr regarding read clock ???

 

Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Debugging EMIF interface?

Have we moved from DONE pin not going HIGH to coding style to clock domain crossing to debugging a DSP EMIF interface?

 

If so, then you should post links to the DSP datasheet (showing the EMIF interface signals and waveforms), and your FPGA code for the DSP interface.

 

You should also post the board-level schematic showing DSP <==> FPGA connections.

 

If the problem is consistent, the problem is likely a logic problem.

If the problem is inconsistent, the problem is likely due to a timing or signal integrity issue -- which may involve board design, DSP coding and configuration, and FPGA logic design.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Regular Contributor
jlqsczw_2007
Posts: 97
Registered: ‎06-28-2008
0

Re: Debugging EMIF interface?

[ Edited ]

Have we moved from DONE pin not going HIGH to coding style to clock domain crossing to debugging a DSP EMIF interface?

---Yes. Now the resistor thing seems not to be the issue.

 

If so, then you should post links to the DSP datasheet (showing the EMIF interface signals and waveforms), and your FPGA code for the DSP interface.

 

You should also post the board-level schematic showing DSP <==> FPGA connections.

 

---- I have no shematic in my hand ,but the signals between DSP and FPGA are all connected directly,no other chips.

 

If the problem is consistent, the problem is likely a logic problem.

If the problem is inconsistent, the problem is likely due to a timing or signal integrity issue -- which may involve board design, DSP coding and configuration, and FPGA logic design.

 

-----Obviously the problem is inconsistent.

If it's timng ,now no timing errors are reported , so I can only decrease the speed of writing.

If it' signal integrity , now I have no ideas.

 

 

 

-- Bob Elkind

write0.jpg
Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Re: Debugging EMIF interface?

[ Edited ]

j,

 

Please try to simplify and clarify and separate the various questions you have.  It does not help to have a single thread wandering between a variety of discussion topics.

 

You have already started a thread for debugging your EMIF interface, which is yet unresolved.  Suggest you clarify the EMIF interface questions and problems in that thread, and post both your board-level schematics and your latest version of EMIF interface source code.

 

For the remaining questions or topics, please list and describe them separately in this thread.

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Regular Contributor
jlqsczw_2007
Posts: 97
Registered: ‎06-28-2008
0

Re: Debugging EMIF interface?

Well ,  I will post a new thread later.