Skip to content

Commit

Permalink
handle complete issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alaindargelas committed Nov 3, 2023
1 parent cbed2f4 commit 5e125fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontends/systemverilog/uhdm_ast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2390,7 +2390,7 @@ void UhdmAst::process_module()
shared.top_nodes[module_node->str] = module_node;
visit_one_to_many({vpiParamAssign}, obj_h, [&](AST::AstNode *node) {
if (node) {
if (node->children[0]->type != AST::AST_CONSTANT) {
if ((!node->children.empty()) && ((node->children[0]->type != AST::AST_CONSTANT))) {
if (shared.top_nodes[type]) {
simplify_parameter(node, module_node);
log_assert(node->children[0]->type == AST::AST_CONSTANT || node->children[0]->type == AST::AST_REALVALUE);
Expand Down
6 changes: 4 additions & 2 deletions tests/simple_tests/ParameterType/dut.sv
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module dut(input logic clk, input logic i, output logic o);
localparam int GW_CONFIG2[2:0] = '{default:0} ;
sub sub(clk, i, o);
endmodule

module sub(input logic clk, input logic i, output logic o);
localparam int GW_CONFIG2[2:0] = '{default:0} ;
assign o = i;

endmodule

0 comments on commit 5e125fa

Please sign in to comment.