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:
parent
4497f0f32c
commit
c32f1f5f2c
@ -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)
|
||||
|
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user