aboutsummaryrefslogtreecommitdiffstats
path: root/frontends/ilang
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-07-10 15:58:01 -0700
committerEddie Hung <eddie@fpgeh.com>2019-07-10 15:58:01 -0700
commitcea7441d8ae7df8d22f510e6a101ec46a9d7751e (patch)
tree8067ba09ecfaf6d9cf32e8ed9adba42be27b86a4 /frontends/ilang
parentc865559f9540c29cb9c6302edc8b4a2620c0b49d (diff)
parentbb2144ae733f1a2c5e629a8251bfbdcc15559aa4 (diff)
downloadyosys-cea7441d8ae7df8d22f510e6a101ec46a9d7751e.tar.gz
yosys-cea7441d8ae7df8d22f510e6a101ec46a9d7751e.tar.bz2
yosys-cea7441d8ae7df8d22f510e6a101ec46a9d7751e.zip
Merge remote-tracking branch 'origin/master' into xc7dsp
Diffstat (limited to 'frontends/ilang')
-rw-r--r--frontends/ilang/ilang_parser.y13
1 files changed, 9 insertions, 4 deletions
diff --git a/frontends/ilang/ilang_parser.y b/frontends/ilang/ilang_parser.y
index 44c99906a..b4b9693da 100644
--- a/frontends/ilang/ilang_parser.y
+++ b/frontends/ilang/ilang_parser.y
@@ -282,14 +282,14 @@ proc_stmt:
} case_body sync_list TOK_END EOL;
switch_stmt:
- attr_list TOK_SWITCH sigspec EOL {
+ TOK_SWITCH sigspec EOL {
RTLIL::SwitchRule *rule = new RTLIL::SwitchRule;
- rule->signal = *$3;
+ rule->signal = *$2;
rule->attributes = attrbuf;
switch_stack.back()->push_back(rule);
attrbuf.clear();
- delete $3;
- } switch_body TOK_END EOL;
+ delete $2;
+ } attr_list switch_body TOK_END EOL;
attr_list:
/* empty */ |
@@ -298,9 +298,11 @@ attr_list:
switch_body:
switch_body TOK_CASE {
RTLIL::CaseRule *rule = new RTLIL::CaseRule;
+ rule->attributes = attrbuf;
switch_stack.back()->back()->cases.push_back(rule);
switch_stack.push_back(&rule->switches);
case_stack.push_back(rule);
+ attrbuf.clear();
} compare_list EOL case_body {
switch_stack.pop_back();
case_stack.pop_back();
@@ -319,12 +321,15 @@ compare_list:
/* empty */;
case_body:
+ case_body attr_stmt |
case_body switch_stmt |
case_body assign_stmt |
/* empty */;
assign_stmt:
TOK_ASSIGN sigspec sigspec EOL {
+ if (attrbuf.size() != 0)
+ rtlil_frontend_ilang_yyerror("dangling attribute");
case_stack.back()->actions.push_back(RTLIL::SigSig(*$2, *$3));
delete $2;
delete $3;