Fix ENUMVALUE on parameter, again (#3777).

This commit is contained in:
Wilson Snyder 2022-12-11 21:10:12 -05:00
parent 01b521a0ea
commit 609bfa46e8
3 changed files with 20 additions and 3 deletions

View File

@ -1979,7 +1979,7 @@ private:
}
void visit(AstCastWrap* nodep) override {
// Inserted by V3Width only so we know has been resolved
UASSERT_OBJ(nodep->didWidth(), nodep, "CastWrap should have width'ed earlier");
userIterateAndNext(nodep->lhsp(), WidthVP{nodep->dtypep(), BOTH}.p());
}
void castSized(AstNode* nodep, AstNode* underp, int width) {
const AstBasicDType* underDtp = VN_CAST(underp->dtypep(), BasicDType);

View File

@ -8,9 +8,13 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(linter => 1);
scenarios(simulator => 1);
lint(
compile(
);
execute(
check_finished => 1,
);
ok(1);

View File

@ -16,8 +16,21 @@ module SubB
();
endmodule
function automatic letters_t lfunc(int a);
return letters_t'(1);
endfunction
module t ();
localparam FMT = lfunc(1);
SubA suba0 ();
SubA #(.LETTER(letters_t'(1))) suba1 ();
SubB #(.LETTER(letters_t'(1))) subb2 ();
initial begin
if (lfunc(1) != B) $stop;
if (FMT != B) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
endmodule