1
0
mirror of https://github.com/myhdl/myhdl.git synced 2024-12-14 07:44:38 +08:00

cursory conf_sim method

This commit is contained in:
Keerthan Jaic 2016-03-15 13:41:55 -04:00
parent 49053b352e
commit f261156e54

View File

@ -143,6 +143,7 @@ class _BlockInstance(object):
if hasattr(mod, 'vhdl_code'):
self.vhdl_code = _UserVhdlCode(mod.vhdl_code, self.symdict, mod.name,
mod.modfunc, mod.sourcefile, mod.sourceline)
self._conf_sim = {'trace': False}
def _verifySubs(self):
for inst in self.subs:
@ -237,7 +238,13 @@ class _BlockInstance(object):
setattr(converter, k, v)
return converter(self)
def conf_sim(self, trace=False):
self._conf_sim['trace'] = trace
def run(self, duration=None, quiet=0):
if self.sim is None:
self.sim = myhdl._Simulation.Simulation(self)
sim = self
if self._conf_sim['trace']:
sim = myhdl.traceSignals(self)
self.sim = myhdl._Simulation.Simulation(sim)
self.sim.run(duration, quiet)