mirror of https://github.com/llvm/circt.git
[PyCDE] Clarify BackedgeBuilder error message
Presumably, this error message stems from when BackedgeBuilder was initially used solely for creating backedges to top-level port assignments when creating a new module instance. However, the `BackedgeBuilder` is also used for other operations (and useful as a general tool), wherein 'port' may be misleading. Changing this to `Backedge` makes it explicit that a backedge was created, and was expected to be assigned to.
This commit is contained in:
parent
d904317dd1
commit
041a5dc6a4
|
@ -59,8 +59,8 @@ with Context() as ctx, Location.unknown():
|
|||
print(e)
|
||||
|
||||
# Note, the error here is actually caught and printed below.
|
||||
# CHECK: Uninitialized ports remain in circuit!
|
||||
# CHECK: Port: [[PORT_NAME:.+]]
|
||||
# CHECK: Uninitialized backedges remain in circuit!
|
||||
# CHECK: Backedge: [[PORT_NAME:.+]]
|
||||
# CHECK: InstanceOf: hw.module @one_input(%[[PORT_NAME]]: i32)
|
||||
# CHECK: Instance: hw.instance "inst1" @one_input({{.+}})
|
||||
inst1 = one_input.instantiate("inst1")
|
||||
|
|
|
@ -178,7 +178,7 @@ class BackedgeBuilder(AbstractContextManager):
|
|||
def __init__(self,
|
||||
creator,
|
||||
type: ir.Type,
|
||||
port_name: str,
|
||||
backedge_name: str,
|
||||
op_view,
|
||||
instance_of: ir.Operation,
|
||||
loc: ir.Location = None):
|
||||
|
@ -186,7 +186,7 @@ class BackedgeBuilder(AbstractContextManager):
|
|||
self.dummy_op = ir.Operation.create("TemporaryBackedge", [type], loc=loc)
|
||||
self.instance_of = instance_of
|
||||
self.op_view = op_view
|
||||
self.port_name = port_name
|
||||
self.port_name = backedge_name
|
||||
self.erased = False
|
||||
|
||||
@property
|
||||
|
@ -236,7 +236,7 @@ class BackedgeBuilder(AbstractContextManager):
|
|||
errors = []
|
||||
for edge in list(self.edges):
|
||||
# TODO: Make this use `UnconnectedSignalError`.
|
||||
msg = "Port: " + edge.port_name + "\n"
|
||||
msg = "Backedge: " + edge.port_name + "\n"
|
||||
if edge.instance_of is not None:
|
||||
msg += "InstanceOf: " + str(edge.instance_of).split(" {")[0] + "\n"
|
||||
if edge.op_view is not None:
|
||||
|
@ -245,7 +245,7 @@ class BackedgeBuilder(AbstractContextManager):
|
|||
errors.append(msg)
|
||||
|
||||
if errors:
|
||||
errors.insert(0, "Uninitialized ports remain in circuit!")
|
||||
errors.insert(0, "Uninitialized backedges remain in circuit!")
|
||||
raise RuntimeError("\n".join(errors))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue