Re: multiple tracing per run

Henry Gomersall <[email protected]> Tue, 26 Jan 2016 13:29:43 +0000
Newsgroups gmane.comp.python.myhdl
Message-ID <[email protected]>
On 25/01/16 19:14, Marcel Hellwig wrote:
> I use python unittest for testing things and sometimes I want to have a
> closer look, why something fails and create a vcd dump.
> The problem is, when I want to dump multiple test-cases, this won't
> work, because of
> 
>> > ERROR: test_write_read (__main__.MyTestCase)
>> > ----------------------------------------------------------------------
>> > Traceback (most recent call last):
>> >   File "test_registerbank.py", line 30, in wrapper
>> >     return Simulation(self.dut_cl, clkGen, stimulus).run()
>> >   File
>> > "/home/marcel/projects/micro/VE2/lib/python2.7/site-packages/myhdl/_Simulation.py",
>> > line 129, in run
>> >     _extend(s._update())
>> >   File
>> > "/home/marcel/projects/micro/VE2/lib/python2.7/site-packages/myhdl/_Signal.py",
>> > line 201, in _update
>> >     self._printVcd()
>> >   File
>> > "/home/marcel/projects/micro/VE2/lib/python2.7/site-packages/myhdl/_Signal.py",
>> > line 321, in _printVcdBit
>> >     print("%d%s" % (self._val, self._code), file=sim._tf)
>> > ValueError: I/O operation on closed file
> Is there a change to do a clean shutdown of the old trace-run and start
> a new one (e.g. putting that code in setup and teardown method of the
> testcase)

I'm somewhat unfamiliar with the tracing code, but it is (at least it
used to be) necessary to manually call the _finalize method on the
simulator before being able to run it again. I assume this carries
through to the trace code?

Henry

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140