Skip to content

Commit

Permalink
Fix missed check on valid assignment component for UDPs
Browse files Browse the repository at this point in the history
  • Loading branch information
amykyta3 committed Aug 3, 2023
1 parent f31a1b7 commit 3168ce4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions systemrdl/properties/user_defined.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ def assign_value(self, comp_def: 'comp.Component', value: Any, src_ref: 'SourceR
# As per 15.2.1-c. UDP is still "bound" to the component, so give
# it the NoValue class as a value

# Check if property is allowed in this component
if type(comp_def) not in self.bindable_to:
self.env.msg.fatal(
"The property '%s' is not valid for '%s' components"
% (self.get_name(), type(comp_def).__name__.lower()),
src_ref
)

# Circumvent the usual assignment function to avoid some pesky validation
comp_def.properties[self.get_name()] = rdltypes.NoValue
if src_ref is not None:
Expand Down

0 comments on commit 3168ce4

Please sign in to comment.