always kw conversion visits items with attributes

* Fixing a bug where always_* are not converted when attributed
* Added tests and updated Changelog for the attributed always_* fix
This commit is contained in:
qcorradi 2023-05-23 09:42:26 +01:00 committed by Zachary Snow
parent a129e3bc68
commit 485ffffa01
4 changed files with 24 additions and 0 deletions

View File

@ -8,6 +8,8 @@
static prefixes, which could cause deep recursion and run out of memory on
some designs
* Fixed overzealous removal of explicitly unconnected ports (e.g., `.a()`)
* Fixed an issue that left `always_comb`, `always_latch`, and `always_ff`
unconverted when tagged with an attribute
* Fixed unneeded scoping of constant function calls used in type lookups
* `/*/` is no longer interpreted as a self-closing block comment, e.g.,
`$display("a"/*/,"b"/* */);` previously printed "ab", but now prints "a"

View File

@ -198,6 +198,8 @@ traverseModuleItem item@(MIPackageItem (Function _ _ x decls _)) = do
traverseModuleItem item@(MIPackageItem (Task _ x decls _)) = do
insertElem x $ Proc [] (ports decls)
return item
traverseModuleItem (MIAttr attr item) =
MIAttr attr <$> traverseModuleItem item
traverseModuleItem other = return other
toEvent :: (Bool, [Expr]) -> Event

10
test/core/always_attr.sv Normal file
View File

@ -0,0 +1,10 @@
module top;
reg a, b, c;
(* test *) always_ff @(posedge a)
c <= b;
(* test *) always_latch
if (c)
b <= 1;
(* test *) always_comb
a = b;
endmodule

10
test/core/always_attr.v Normal file
View File

@ -0,0 +1,10 @@
module top;
reg a, b, c;
(* test *) always @(posedge a)
c <= b;
(* test *) always @*
if (c)
b <= 1;
(* test *) always @*
a = b;
endmodule