Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

DCFIFO - incorrect functionality of a ModelSim timing simulation

Hey guys,

A brief background:My VHDL design (for Stratix III) has input data arriving at 20MHz. The data is read at a rate of 100Mhz. The reading and writing operations aren't necessarily simultaneous. I have prepared a dedicated FIFO block, based on the DCFIFO megafunction, to handle this input interface.

The relevant DCFIFO settings I have chosen:

overflow_checking => "ON" underflow_checking => "ON"

rdsync_delaypipe => 3 wrsync_delaypipe => 3

use_eab => "ON" write_aclr_synch => "ON"

The problem:The block works smoothly in logic simulation (ModelSim 6.5B) and timing (post-synthesis) simulation (Quartus II - 9.1). But, when I run the timing simulation in ModelSim (based on the vho+sdo files generated in Quartus) the functionality is incorrect: The first data sample which is written to the FIFO never appears on the FIFO's output lines. All the following data samples appear correctly.

Each time I raise the write enable, only the second data sample can be read.

Attached:
  • A logic simulation in ModelSim (perfect functionality) screen shot.

  • A timing simulation in ModelSim (incorrect functionality) screen shot.
purple - writing clock domain. orange - reading clock domain.

fifo_full <-> wrfull fifo_empty <-> rdempty

write_en <-> wrreq read_en = not(fifo_empty) <-> rdreq

I tried (and failed) to solve the problem in the following methods:
  • Assigning register on for the input and output ports of the DCFIFO to make sure no setup\hold time violations occur.

  • Reading from the FIFO a single clock cycle after fifo_empty goes low.
I am an undergraduate student and a newbie in digital design. This is my final project and it is crucial for me to perform a successful ModelSim timing simulation for the whole design.

I will appreciate any consultation.

Thanks ahead.

13 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hey Daixiwen,

    Thanks again for your help and advice. I will examine the document more thoroughly as soon as I'll need to perform full design synthesis.

    Yoni.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Can you tell me what script needs to be written for a correct gate-level simulation?

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hey ramanadn,

    Please follow these steps:

    1. Define the relevant simulation settings (note the bottom ones in case you have a test bench) in: assignments -> settings -> eda -> simulation.

    In the "More NativeLink Settings" definge the way you want the scripts to be generated.

    2. Compile the design.

    3. In the output directory you've defined in the simulation settings (stage 1) you'll find the scripts you are looking for (with a .do suffix).

    4. You can run these scripts in the third party tool directly from Quartus by choosing Tools -> Run EDA simulation tool -> EDA gate level simulation.

    Hope this helps. Ask further if not.

    Yoni.