Re: FlipFlop testbench with reset



On 6 Mar 2007 08:14:33 -0800, "Verictor" <stehuang@xxxxxxxxx> wrote:

Hi,

When writing a testbench for a simple circuit, e.g., divided-by-2, it
is not desired to have a reset signal on the flip flop (for various
reasons). In this case, the simulation always reports the output as
"x". Is there a way to workaround? Of course, it is easy to include a
reset and simulate the circuit then remove it when the result is good.
But is there a direct way to do that?

Thanks

You can use a force statement at the output of the flop and keep it
for at least one clock cycle so it gets a chance to be clocked in.
Then you can release it. Or you can use an initial statement to set
the initilal value to zero as opposed to X. If you want to keep the
same testbench for the gate level sims too, force is better because
there is no more reg to initialize in gate level netlist.
.



Relevant Pages

  • Re: Turning a light on and off with momentary switch
    ... The circuit that you want to build consists of three sections. ... The second section is the flip-flop that is wired to toggle. ... 74HC74 D type flip-flop or even a JK flip flop. ... >switch and then turn it back off when the momentary switch is hit again. ...
    (sci.electronics.basics)
  • Toggling D Flip Flop with LVC Device
    ... Has anyone any experience with building a simple toggling D flip flop ... the circuit operates as expected - textbook ... type operation - the Q output toggles with each switch depression; ... output toggles on the rising edge of the CLK input. ...
    (sci.electronics.design)
  • Re: Toggling D Flip Flop with LVC Device
    ... Using a standard toggling flip flop circuit - that is connecting the ... the circuit operates as expected - textbook ... type operation - the Q output toggles with each switch depression; ... output toggles on the rising edge of the CLK input. ...
    (sci.electronics.design)
  • Re: Toggling D Flip Flop with LVC Device
    ... Using a standard toggling flip flop circuit - that is connecting the ... \Q output back to the Data input of the flip flop and drive the CLK ... the circuit operates as expected - textbook ... type operation - the Q output toggles with each switch depression; ...
    (sci.electronics.design)
  • Re: please tell me how to learn testbench?
    ... A testbench is what how you decide to test. ... it depends on your ideas and the needs of you special circuit. ... Sometimes it is elegant to generate the stimuli ... outside of your HDL environment (you may use whatever tool you are ...
    (comp.arch.fpga)