Re: [myhdl-list] dff
Brought to you by:
jandecaluwe
From: Jan D. <ja...@ja...> - 2009-07-11 07:27:48
|
Amway India wrote: > Hello > > test_dff.py is once again enclosed > > from random import randrange > > def test_dff(): > q, d, clk = [Signal(bool(0)) for i in range(3)] > > dff_inst = dff(q,d,clk) > > @always (delay (10)) > def clkgen(): > clk.next = not clk > > @always (clk.negedge) > def stimulus (): > d.next = randrange(2) > > return dff_inst, clkgen, stimulus > > > def simulate (timesteps): > tb = traceSignals(test_dff) > sim = Simulation(tb) > sim.run(timesteps) > > simulate(2000) > ********************************************** > The Above is the test_dff.py code. > The following is the run result > ********************************************** > [vimal@vlsiworkgroup cordichdl]$ python test_dff.py > Traceback (most recent call last): > File "test_dff.py", line 24, in <module> > simulate(2000) > File "test_dff.py", line 20, in simulate > tb = traceSignals(test_dff) > NameError: global name 'traceSignals' is not defined > *************************************************** > > I hope i used traceSignals. Where is the wrong? The error is what is says: traceSignals is not defined. Import it from package myhdl, or use 'from myhdl import *' to import all identifiers from myhdl. You may want to check how identifier definition and imports work in python in general. Jan -- Jan Decaluwe - Resources bvba - http://www.jandecaluwe.com Python as a HDL: http://www.myhdl.org VHDL development, the modern way: http://www.sigasi.com Analog design automation: http://www.mephisto-da.com World-class digital design: http://www.easics.com |