mirror of
https://github.com/myhdl/myhdl.git
synced 2025-01-24 21:52:56 +08:00
Added additional helpful info from the .name attribute about which block is failing to return a valid block.
This commit is contained in:
parent
9fd45e74dd
commit
c66482e966
@ -35,7 +35,7 @@ from myhdl._Signal import _Signal, _isListOfSigs
|
|||||||
|
|
||||||
class _error:
|
class _error:
|
||||||
pass
|
pass
|
||||||
_error.ArgType = "A block should return block or instantiator objects"
|
_error.ArgType = "%s: A block should return block or instantiator objects"
|
||||||
_error.InstanceError = "%s: subblock %s should be encapsulated in a block decorator"
|
_error.InstanceError = "%s: subblock %s should be encapsulated in a block decorator"
|
||||||
|
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ class _Block(object):
|
|||||||
def _verifySubs(self):
|
def _verifySubs(self):
|
||||||
for inst in self.subs:
|
for inst in self.subs:
|
||||||
if not isinstance(inst, (_Block, _Instantiator, Cosimulation)):
|
if not isinstance(inst, (_Block, _Instantiator, Cosimulation)):
|
||||||
raise BlockError(_error.ArgType)
|
raise BlockError(_error.ArgType % (self.name,))
|
||||||
if isinstance(inst, (_Block, _Instantiator)):
|
if isinstance(inst, (_Block, _Instantiator)):
|
||||||
if not inst.modctxt:
|
if not inst.modctxt:
|
||||||
raise BlockError(_error.InstanceError % (self.name, inst.callername))
|
raise BlockError(_error.InstanceError % (self.name, inst.callername))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user