mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-08 15:13:24 +00:00
Merge pull request #5143 from YosysHQ/krys/typedef_struct_global
SystemVerilog: Fix typedef struct in global space
This commit is contained in:
commit
545753cc5a
3 changed files with 15 additions and 1 deletions
|
@ -1433,6 +1433,7 @@ bool AstNode::simplify(bool const_fold, int stage, int width_hint, bool sign_hin
|
||||||
current_ast_mod->children.push_back(wnode);
|
current_ast_mod->children.push_back(wnode);
|
||||||
}
|
}
|
||||||
basic_prep = true;
|
basic_prep = true;
|
||||||
|
is_custom_type = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1855,7 +1855,7 @@ struct_decl:
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
struct_type: struct_union { astbuf2 = $1; } struct_body { $$ = astbuf2; }
|
struct_type: struct_union { astbuf2 = $1; astbuf2->is_custom_type = true; } struct_body { $$ = astbuf2; }
|
||||||
;
|
;
|
||||||
|
|
||||||
struct_union:
|
struct_union:
|
||||||
|
|
13
tests/svtypes/typedef_struct_global.ys
Normal file
13
tests/svtypes/typedef_struct_global.ys
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
read_verilog -sv << EOF
|
||||||
|
typedef struct packed {
|
||||||
|
logic y;
|
||||||
|
logic x;
|
||||||
|
} Vec_2_B;
|
||||||
|
|
||||||
|
module top;
|
||||||
|
|
||||||
|
Vec_2_B two_dee;
|
||||||
|
wire foo = two_dee.x;
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
EOF
|
Loading…
Add table
Add a link
Reference in a new issue