-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Labels
enhancementProposed feature requests and improvementsProposed feature requests and improvements
Description
With blocks should have the form
with ConditionalUpdate() as condition:
with condition(...):
...
with condition(...):
...
etc.
Since the keywords and structure are intuitive, a common error may be to forget that each with
statement takes a ConditionalUpdate object as argument (and not just a condition). E.g.,
with ConditionalUpdate() as condition:
with (...):
...
with (...):
...
etc.
Right now this throws AttributeError: __exit__
, which is not helpful if you don't know what you did wrong. If possible, a better error message would be useful.
Here's a complete example that throws the error message:
import sys
sys.path.append("..")
import pyrtl
a = pyrtl.WireVector(1)
b = pyrtl.WireVector(1)
c = pyrtl.WireVector(1)
with pyrtl.ConditionalUpdate() as condition:
with condition(a & b):
c |= 1
with (a | b):
c |= 0
Metadata
Metadata
Assignees
Labels
enhancementProposed feature requests and improvementsProposed feature requests and improvements