Add approximate support for SV "var" keyword, fixes #987
authorClifford Wolf <clifford@clifford.at>
Sat, 4 May 2019 05:52:51 +0000 (07:52 +0200)
committerClifford Wolf <clifford@clifford.at>
Sat, 4 May 2019 05:52:51 +0000 (07:52 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
frontends/verilog/verilog_lexer.l
frontends/verilog/verilog_parser.y

index 6ef38252a1f03beeee65e0fa3fb6da9f300cf3b9..59ef3e36ef7d2ddce28174ff8991cd45385ba2fc 100644 (file)
@@ -207,6 +207,7 @@ YOSYS_NAMESPACE_END
 "checker"    { if (formal_mode) return TOK_CHECKER; SV_KEYWORD(TOK_CHECKER); }
 "endchecker" { if (formal_mode) return TOK_ENDCHECKER; SV_KEYWORD(TOK_ENDCHECKER); }
 "logic"      { SV_KEYWORD(TOK_LOGIC); }
+"var"        { SV_KEYWORD(TOK_VAR); }
 "bit"        { SV_KEYWORD(TOK_REG); }
 
 "eventually"   { if (formal_mode) return TOK_EVENTUALLY; SV_KEYWORD(TOK_EVENTUALLY); }
index 40968d17a12bcaf7052b00b0ca53b62e1b1a3b89..f011e07eaa9134b3046e04ce21db5df442f01c2d 100644 (file)
@@ -110,7 +110,7 @@ static void free_attr(std::map<std::string, AstNode*> *al)
 %token ATTR_BEGIN ATTR_END DEFATTR_BEGIN DEFATTR_END
 %token TOK_MODULE TOK_ENDMODULE TOK_PARAMETER TOK_LOCALPARAM TOK_DEFPARAM
 %token TOK_PACKAGE TOK_ENDPACKAGE TOK_PACKAGESEP
-%token TOK_INTERFACE TOK_ENDINTERFACE TOK_MODPORT
+%token TOK_INTERFACE TOK_ENDINTERFACE TOK_MODPORT TOK_VAR
 %token TOK_INPUT TOK_OUTPUT TOK_INOUT TOK_WIRE TOK_REG TOK_LOGIC
 %token TOK_INTEGER TOK_SIGNED TOK_ASSIGN TOK_ALWAYS TOK_INITIAL
 %token TOK_BEGIN TOK_END TOK_IF TOK_ELSE TOK_FOR TOK_WHILE TOK_REPEAT
@@ -456,6 +456,9 @@ wire_type_token:
        TOK_LOGIC {
                astbuf3->is_logic = true;
        } |
+       TOK_VAR {
+               astbuf3->is_logic = true;
+       } |
        TOK_INTEGER {
                astbuf3->is_reg = true;
                astbuf3->range_left = 31;