Skip to content

Commit e81e59e

Browse files
committed
test of "default value" under conditional_assignement
1 parent 120d457 commit e81e59e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pyrtl/conditional.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,15 @@ def _finalize():
203203
# handle wirevector and register assignments
204204
else:
205205
if isinstance(lhs, Register):
206-
result = lhs # default for registers is "self"
206+
if hasattr(lhs, 'condition_default'):
207+
result = lhs.condition_default
208+
else:
209+
result = lhs # default for registers is "self"
207210
elif isinstance(lhs, WireVector):
208-
result = 0 # default for wire is "0"
211+
if hasattr(lhs, 'condition_default'):
212+
result = lhs.condition_default
213+
else:
214+
result = 0 # default for wire is "0"
209215
else:
210216
raise PyrtlInternalError('unknown assignment in finalize')
211217
predlist = _predicate_map[lhs]

0 commit comments

Comments
 (0)