1

I'm trying to simulate a MOUSETRAP asynchronous pipeline for FPGA. For the control stage, I need to implement the following circuit:

Control stage

DELAY is a delay element which I have correctly implemented using inverters.

For this I have written the following VHDL code:

entity control is
    port(Ri, Ao: in bit;
         L, Ro, Ro_nd: out bit); -- Ro_nd: no delay
end entity control;

architecture behavior of control is
    signal Ro_ndx, Lx: bit := '0'; -- intermediate signals
begin
    Lx <= (Ri and (not Ao) and (not Ro_ndx)) or ((not Ri) and Ao and Ro_ndx);
    Ro_ndx <= (Lx and Ri) or ((not Lx) and Ro_ndx) or (Ri and Ro_ndx);

    L <= Lx;
    Ro_nd <= Ro_ndx;

    delay: work.delayelem port map(Ro_ndx, Ro);
end architecture behavior;

According to what I can see in the RTL Viewer, it appears to have been synthetized correctly. However, when I run the timing simulation in Quartus II (using ModelSim), Ro_nd is XXXXX until Ri is activated, but it is meant to be zero.

Simulation

As a consequence, L doesn't work as intended. I suspect it has to do with the fact that Ro_ndx is a feedback signal/wire so its initial value is being treated as XXXXX despite my attempt to initialize it (with := '0'). How can I fix this?

Extra info: Using Quartus II 13.0.1 Build 232 06/12/2013 SP 1 SJ Web Edition; Device: Cyclone IV GX EP4CGX15BN11C8.

Nacib Neme
  • 111
  • 3
  • Your feedback should have a "transport delay". (look it up, sorry I have no time for further details; someone else might) And welcome to the "electronics" group! – P2000 Nov 05 '21 at 23:41
  • I don't think that's the cause. The issue also happens in the functional simulation. Also, wouldn't transport delay also break L? – Nacib Neme Nov 05 '21 at 23:49
  • Type bit is an enumerated type with two values '0' and '1'. Where are these Xs coming from? Not the VHDL model where the default value is '0'. – user16145658 Nov 06 '21 at 00:06
  • @user16145658 That's exactly my question. – Nacib Neme Nov 06 '21 at 00:51
  • Besides the lack of standard compliant simulation display your component instantiation is missing the reserved work entity before work.displayem, lacking any use clause making a package with a component declaration visible. Fix that, write a testbench, simulate in Modelsim and provide Modelsim's waveform display image instead of the RTL Viewer. The delay appears to be around 10 ns. – user16145658 Nov 06 '21 at 01:28

0 Answers0