Re: [myhdl-list] dff
Brought to you by:
jandecaluwe
From: Amway I. <i....@ya...> - 2009-07-11 07:14:28
|
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? --- On Fri, 10/7/09, Jan Decaluwe <ja...@ja...> wrote: From: Jan Decaluwe <ja...@ja...> Subject: Re: [myhdl-list] dff To: myh...@li... Date: Friday, 10 July, 2009, 7:42 PM Amway India wrote: > Hello Everybody > > To day tried to run dff model from myhdl documentation and it is giving > some errors which are enclosed. I wrote two files 1.dff.py and 2. > test_dff.py: > > dff.py > from myhdl import * > def dff(q, d, clk): > @always(clk.posedge) > def logic(): > q.next = d > return logic > > test_dff.py > 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) > > When i run > $python test_dff.py gives > traceSignal not defined > > What is the reason? traceSignal is indeed not defined in package myhdl. traceSignals should be. -- 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 ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ myhdl-list mailing list myh...@li... https://lists.sourceforge.net/lists/listinfo/myhdl-list Yahoo! recommends that you upgrade to the new and safer Internet Explorer 8. http://downloads.yahoo.com/in/internetexplorer/ |