[FIRRTL] Reject "is invalid" if FIRRTL >=3

Fix the parser to reject "is invalid" if the specified FIRRTL version is
>= 3.0.0.

Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
This commit is contained in:
Schuyler Eldridge 2024-10-25 16:26:37 -04:00
parent 8a12831dcd
commit 85f4ca05dd
No known key found for this signature in database
GPG Key ID: 50C5E9936AAD536D
2 changed files with 12 additions and 0 deletions

View File

@ -4017,6 +4017,9 @@ ParseResult FIRStmtParser::parseLeadingExpStmt(Value lhs) {
parseOptionalInfo())
return failure();
if (removedFeature({3, 0, 0}, "'is invalid' statements", loc))
return failure();
locationProcessor.setLoc(loc);
emitInvalidate(lhs);
return success();

View File

@ -1634,3 +1634,12 @@ circuit RegWith:
; expected-error @below {{'reg with' registers were removed in FIRRTL 3.0.0}}
reg r_0 : UInt<5>, clock with :
reset => (UInt<1>(0h0), r_0)
;// -----
FIRRTL version 3.0.0
circuit IsInvalid:
module IsInvalid:
output a: UInt<1>
; expected-error @below {{'is invalid' statements were removed in FIRRTL 3.0.0}}
a is invalid