handle resetall when creating implicit nets

This commit is contained in:
Zachary Snow 2024-06-15 22:29:53 -04:00
parent 6eda946f57
commit d3dbaf0684
4 changed files with 18 additions and 3 deletions

View File

@ -3,6 +3,7 @@
### Bug Fixes
* Fixed `--write path/to/dir/` with directives like `` `default_nettype ``
* Fixed `` `resetall `` not resetting the `` `default_nettype ``
### Other Enhancements

View File

@ -27,9 +27,12 @@ traverseDescription defaultNetType (PackageItem (Directive str)) =
where
prefix = "`default_nettype "
defaultNetType' =
if isPrefixOf prefix str
then parseDefaultNetType $ drop (length prefix) str
else defaultNetType
if isPrefixOf prefix str then
parseDefaultNetType $ drop (length prefix) str
else if str == "`resetall" then
Just TWire
else
defaultNetType
traverseDescription defaultNetType description =
(defaultNetType, partScoper traverseDeclM
(traverseModuleItemM defaultNetType)

View File

@ -0,0 +1,6 @@
`default_nettype none
`resetall
module top;
assign y = 1;
assign x = ~y;
endmodule

View File

@ -0,0 +1,5 @@
module top;
wire x, y;
assign y = 1;
assign x = ~y;
endmodule