Altera_Forum
Honored Contributor
14 years agoSynchronous Design Timing (VHDL)
Hi All,
I am very new to VHDL and working with hardware so I'm hoping this forum can fill in some of the giant holes in my knowledge. My current question relates to timing in synchronous designs: Let's say I'm working with a component (e.g. a FIFO) that uses the same clock as mine. If that component does everything on the rising edge of the clock, then when should I make changes to its inputs and read its output to ensure that I get the expected result. Specific Example: I want to use one of the FIFOs (SCFIFO/DCFIFO) provided by the MegaWizard. In order to perform a read operation, I need to assert the 'rdreq' line and then the next data in the queue will be made available on the FIFO's output lines. Those FIFOs work on the positive clock edge, so what is the proper timing for this? (i.e. when should I assert 'rdreq' and when do I read from the output lines) Should I: a). Assert 'rdreq' on the rising edge and read on the next rising edge? If we're both working on the rising edge, am I guaranteed that my signal changes will be in effect when the FIFO processes its input? I'm worried about timing/delays. b). Assert 'rdreq' on the falling edge and read the output lines on the next falling edge? c). ??? Sorry if this is a basic (or stupid) question. I'm hoping to find out what the 'best practice' in this scenario to ensure that I always get the proper result. Thanks!