1
0
mirror of https://github.com/myhdl/myhdl.git synced 2025-01-24 21:52:56 +08:00

improve trace_sigs

This commit is contained in:
jand 2003-07-21 11:20:24 +00:00
parent 4497f0f32c
commit c32f1f5f2c
3 changed files with 16 additions and 11 deletions

View File

@ -49,6 +49,11 @@ def fun():
inst = gen(clk)
return inst
def fun2():
clk = Signal(bool(0))
inst = gen(clk)
return inst
def dummy():
clk = Signal(bool(0))
inst = gen(clk)

View File

@ -63,12 +63,12 @@ re_assname = re.compile(r"^\s*(?P<assname>\w[\w\d]*)\s*=")
def trace_sigs(dut, *args, **kwargs):
global _tracing
if _tracing:
return dut(*args, **kwargs) # skip
if not callable(dut):
raise ArgTypeError("got %s" % type(dut))
if _isgeneratorfunction(dut):
raise ArgTypeError("got generator function")
if _tracing:
return dut(*args, **kwargs) # skip
_tracing = 1
try:
o = getouterframes(currentframe())[1]