Forum Discussion

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

'Post-map' matches 'rtl functional' but differs from 'post-fit'

Can you tell me why post-fit (quartus_fit) mismatches the post-synthesis (quartus_map) simulation? I had a design with counter. A test bench waits for CLK to release the reset. This works in post-synthesis. But a delay after clock edge is needed to reset the post-fit counter. How is it possible?

14 Replies

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

    Do you mean that post-fit includes the timing infromation, despite of the "Functional Simulation Only" option in netlist writer?

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

    --- Quote Start ---

    Do you mean that post-fit includes the timing infromation, despite of the "Functional Simulation Only" option in netlist writer?

    --- Quote End ---

    Most likely not if explicitely set. I asked, because functional simulation of post-fit netlist seems unusual to me. I only used it for timing analysis. The question is however, which difference in the netlist can change execution sequence in functional simulation?.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Have you tried doing this again without using the buffer port type? Its hardly used by anyone, and not really the standard way to create output registers. Usually you would use an internal signal to store the value and assign an output to the internal signal. Another thing I notice is that in your code you have 2 separate if statements resetting the counter. It would be more common to use something like:

     
      if CNT= 1000 or START = '1' then   
        CNT <= 0;
      else
        CNT <= CNT + 1;
      end if;
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    @Tricky: I don't see, why the said constructs, that are legal and well-defined VHDL code, should change the synthesis result.

    Regarding negative integers, I understood a bit more when reviewing your post. The integer signal has to be converted to a numerical bit-vector during synthesis. One should expect integer range 0 to 1000 to be converted to unsigned(9 downto 0). Quartus generally accepts integer signals, also for ports, and generates correct code for it. They are even suggested in the Quartus language templates. But in the said case, Quartus converts the integer apparently to a signed signal:

    CNT <= IEEE.STD_LOGIC_ARITH.CONV_INTEGER(SIGNED(ww_CNT));

    That's no problem in logic synthesis, because the bit-vector is identical. But the simulator stumbles upon it. It may be necessary to change to an unsigned port signal for simulation of Quartus post-fit netlists.