Skip to content

Commit

Permalink
Simplify compiler elaborate exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
amykyta3 committed Apr 20, 2023
1 parent 01add89 commit 0c63b76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions systemrdl/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,13 +370,13 @@ def elaborate(self, top_def_name: Optional[str]=None, inst_name: Optional[str]=N
parameter = p
break
else:
raise ValueError("Parameter '%s' is not available for override" % param_name)
self.msg.fatal("Elaboration top does not have a parameter '%s' that is available for override" % param_name)

literal_expr = ast.ExternalLiteral(self.env, value)
assign_expr = ast.AssignmentCast(self.env, None, literal_expr, parameter.param_type)
assign_type = assign_expr.predict_type()
if assign_type is None:
raise TypeError("Incorrect type for parameter '%s'" % param_name)
self.msg.fatal("Incorrect type for top-level parameter override of '%s'" % param_name)

parameter.expr = assign_expr

Expand Down

0 comments on commit 0c63b76

Please sign in to comment.