diff options
author | David Shah <dave@ds0.me> | 2019-11-22 08:24:01 +0000 |
---|---|---|
committer | David Shah <dave@ds0.me> | 2020-02-02 16:12:33 +0000 |
commit | 50f86c11b2bb9e561f5a0cf10e053b1aa4918abd (patch) | |
tree | 8950c8ea991b5724190ad38ca6b37e9691834fb2 | |
parent | 9f5613100b360beb60608df1296ee81dc185e56c (diff) | |
download | yosys-50f86c11b2bb9e561f5a0cf10e053b1aa4918abd.tar.gz yosys-50f86c11b2bb9e561f5a0cf10e053b1aa4918abd.tar.bz2 yosys-50f86c11b2bb9e561f5a0cf10e053b1aa4918abd.zip |
sv: Add lexing and parsing of .* (wildcard port conns)
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r-- | frontends/verilog/verilog_lexer.l | 2 | ||||
-rw-r--r-- | frontends/verilog/verilog_parser.y | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/frontends/verilog/verilog_lexer.l b/frontends/verilog/verilog_lexer.l index ca23df3e8..39520bd51 100644 --- a/frontends/verilog/verilog_lexer.l +++ b/frontends/verilog/verilog_lexer.l @@ -431,6 +431,8 @@ import[ \t\r\n]+\"(DPI|DPI-C)\"[ \t\r\n]+function[ \t\r\n]+ { "+:" { return TOK_POS_INDEXED; } "-:" { return TOK_NEG_INDEXED; } +".*" { return TOK_AUTOCONNECT_ALL; } + [-+]?[=*]> { if (!specify_mode) REJECT; frontend_verilog_yylval.string = new std::string(yytext); diff --git a/frontends/verilog/verilog_parser.y b/frontends/verilog/verilog_parser.y index a30935e0a..cb413e13a 100644 --- a/frontends/verilog/verilog_parser.y +++ b/frontends/verilog/verilog_parser.y @@ -138,7 +138,7 @@ struct specify_rise_fall { %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 TOK_VAR +%token TOK_INTERFACE TOK_ENDINTERFACE TOK_MODPORT TOK_VAR TOK_AUTOCONNECT_ALL %token TOK_INPUT TOK_OUTPUT TOK_INOUT TOK_WIRE TOK_WAND TOK_WOR TOK_REG TOK_LOGIC %token TOK_INTEGER TOK_SIGNED TOK_ASSIGN TOK_ALWAYS TOK_INITIAL %token TOK_ALWAYS_FF TOK_ALWAYS_COMB TOK_ALWAYS_LATCH @@ -1580,6 +1580,9 @@ cell_port: node->children.back()->str = *$3; delete $3; free_attr($1); + } | + attr TOK_AUTOCONNECT_ALL { + astbuf2->attributes[ID(autoconnect)] = AstNode::mkconst_int(1, false); }; always_comb_or_latch: |