mirror of
https://github.com/YosysHQ/yosys
synced 2025-06-06 06:03:23 +00:00
Revert "verilog: specify polarity to be separate token"
This reverts commit 2122e0d053de659d5264500dc18965ba10013590.
This commit is contained in:
parent
ddbe81df78
commit
5084fa9d8a
2 changed files with 12 additions and 19 deletions
|
@ -518,12 +518,7 @@ import[ \t\r\n]+\"(DPI|DPI-C)\"[ \t\r\n]+function[ \t\r\n]+ {
|
||||||
|
|
||||||
".*" { return TOK_WILDCARD_CONNECT; }
|
".*" { return TOK_WILDCARD_CONNECT; }
|
||||||
|
|
||||||
[+-] {
|
[-+]?[=*]> {
|
||||||
if (!specify_mode) REJECT;
|
|
||||||
frontend_verilog_yylval.ch = yytext[0];
|
|
||||||
return TOK_SPECIFY_POL;
|
|
||||||
}
|
|
||||||
[=*]> {
|
|
||||||
if (!specify_mode) REJECT;
|
if (!specify_mode) REJECT;
|
||||||
yylval->string = new std::string(yytext);
|
yylval->string = new std::string(yytext);
|
||||||
return TOK_SPECIFY_OPER;
|
return TOK_SPECIFY_OPER;
|
||||||
|
|
|
@ -204,7 +204,6 @@ static void addRange(AstNode *parent, int msb = 31, int lsb = 0, bool isSigned =
|
||||||
%token <string> TOK_SVA_LABEL TOK_SPECIFY_OPER TOK_MSG_TASKS
|
%token <string> TOK_SVA_LABEL TOK_SPECIFY_OPER TOK_MSG_TASKS
|
||||||
%token <string> TOK_BASE TOK_BASED_CONSTVAL TOK_UNBASED_UNSIZED_CONSTVAL
|
%token <string> TOK_BASE TOK_BASED_CONSTVAL TOK_UNBASED_UNSIZED_CONSTVAL
|
||||||
%token <string> TOK_USER_TYPE TOK_PKG_USER_TYPE
|
%token <string> TOK_USER_TYPE TOK_PKG_USER_TYPE
|
||||||
%token <ch> TOK_SPECIFY_POL
|
|
||||||
%token TOK_ASSERT TOK_ASSUME TOK_RESTRICT TOK_COVER TOK_FINAL
|
%token TOK_ASSERT TOK_ASSUME TOK_RESTRICT TOK_COVER TOK_FINAL
|
||||||
%token ATTR_BEGIN ATTR_END DEFATTR_BEGIN DEFATTR_END
|
%token ATTR_BEGIN ATTR_END DEFATTR_BEGIN DEFATTR_END
|
||||||
%token TOK_MODULE TOK_ENDMODULE TOK_PARAMETER TOK_LOCALPARAM TOK_DEFPARAM
|
%token TOK_MODULE TOK_ENDMODULE TOK_PARAMETER TOK_LOCALPARAM TOK_DEFPARAM
|
||||||
|
@ -237,7 +236,7 @@ static void addRange(AstNode *parent, int msb = 31, int lsb = 0, bool isSigned =
|
||||||
%type <specify_triple_ptr> specify_triple specify_opt_triple
|
%type <specify_triple_ptr> specify_triple specify_opt_triple
|
||||||
%type <specify_rise_fall_ptr> specify_rise_fall
|
%type <specify_rise_fall_ptr> specify_rise_fall
|
||||||
%type <ast> specify_if specify_condition
|
%type <ast> specify_if specify_condition
|
||||||
%type <ch> specify_edge specify_polarity
|
%type <ch> specify_edge
|
||||||
|
|
||||||
// operator precedence from low to high
|
// operator precedence from low to high
|
||||||
%left OP_LOR
|
%left OP_LOR
|
||||||
|
@ -869,21 +868,14 @@ specify_item_list:
|
||||||
specify_item specify_item_list |
|
specify_item specify_item_list |
|
||||||
/* empty */;
|
/* empty */;
|
||||||
|
|
||||||
specify_polarity:
|
|
||||||
TOK_SPECIFY_POL |
|
|
||||||
/* empty */ {
|
|
||||||
$$ = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
specify_item:
|
specify_item:
|
||||||
specify_if '(' specify_edge expr specify_polarity TOK_SPECIFY_OPER specify_target ')' '=' specify_rise_fall ';' {
|
specify_if '(' specify_edge expr TOK_SPECIFY_OPER specify_target ')' '=' specify_rise_fall ';' {
|
||||||
AstNode *en_expr = $1;
|
AstNode *en_expr = $1;
|
||||||
char specify_edge = $3;
|
char specify_edge = $3;
|
||||||
AstNode *src_expr = $4;
|
AstNode *src_expr = $4;
|
||||||
char oper_polarity = $5;
|
string *oper = $5;
|
||||||
string *oper = $6;
|
specify_target *target = $6;
|
||||||
specify_target *target = $7;
|
specify_rise_fall *timing = $9;
|
||||||
specify_rise_fall *timing = $10;
|
|
||||||
|
|
||||||
if (specify_edge != 0 && target->dat == nullptr)
|
if (specify_edge != 0 && target->dat == nullptr)
|
||||||
frontend_verilog_yyerror("Found specify edge but no data spec.\n");
|
frontend_verilog_yyerror("Found specify edge but no data spec.\n");
|
||||||
|
@ -895,8 +887,14 @@ specify_item:
|
||||||
cell->children.back()->str = target->dat ? "$specify3" : "$specify2";
|
cell->children.back()->str = target->dat ? "$specify3" : "$specify2";
|
||||||
SET_AST_NODE_LOC(cell, en_expr ? @1 : @2, @10);
|
SET_AST_NODE_LOC(cell, en_expr ? @1 : @2, @10);
|
||||||
|
|
||||||
|
char oper_polarity = 0;
|
||||||
char oper_type = oper->at(0);
|
char oper_type = oper->at(0);
|
||||||
|
|
||||||
|
if (oper->size() == 3) {
|
||||||
|
oper_polarity = oper->at(0);
|
||||||
|
oper_type = oper->at(1);
|
||||||
|
}
|
||||||
|
|
||||||
cell->children.push_back(new AstNode(AST_PARASET, AstNode::mkconst_int(oper_type == '*', false, 1)));
|
cell->children.push_back(new AstNode(AST_PARASET, AstNode::mkconst_int(oper_type == '*', false, 1)));
|
||||||
cell->children.back()->str = "\\FULL";
|
cell->children.back()->str = "\\FULL";
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue