diff options
author | Clifford Wolf <clifford@clifford.at> | 2019-05-06 20:57:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-06 20:57:15 +0200 |
commit | 752553d8e91643228714e04d9887d32f5d47870a (patch) | |
tree | e7e427b9e6558800b6131022c880af8ccc053845 /frontends/ilang | |
parent | 1706798f4e595266a8758ae6d0ff9d978299de10 (diff) | |
parent | 8c6e94d57c430fc516dbcfbde312dbd7c860477b (diff) | |
download | yosys-752553d8e91643228714e04d9887d32f5d47870a.tar.gz yosys-752553d8e91643228714e04d9887d32f5d47870a.tar.bz2 yosys-752553d8e91643228714e04d9887d32f5d47870a.zip |
Merge pull request #946 from YosysHQ/clifford/specify
Add specify parser
Diffstat (limited to 'frontends/ilang')
-rw-r--r-- | frontends/ilang/ilang_lexer.l | 1 | ||||
-rw-r--r-- | frontends/ilang/ilang_parser.y | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/frontends/ilang/ilang_lexer.l b/frontends/ilang/ilang_lexer.l index d8e01ae4d..4fd0ae855 100644 --- a/frontends/ilang/ilang_lexer.l +++ b/frontends/ilang/ilang_lexer.l @@ -53,6 +53,7 @@ USING_YOSYS_NAMESPACE "attribute" { return TOK_ATTRIBUTE; } "parameter" { return TOK_PARAMETER; } "signed" { return TOK_SIGNED; } +"real" { return TOK_REAL; } "wire" { return TOK_WIRE; } "memory" { return TOK_MEMORY; } "width" { return TOK_WIDTH; } diff --git a/frontends/ilang/ilang_parser.y b/frontends/ilang/ilang_parser.y index 7bb216dd0..0df792997 100644 --- a/frontends/ilang/ilang_parser.y +++ b/frontends/ilang/ilang_parser.y @@ -61,7 +61,7 @@ USING_YOSYS_NAMESPACE %token TOK_CELL TOK_CONNECT TOK_SWITCH TOK_CASE TOK_ASSIGN TOK_SYNC %token TOK_LOW TOK_HIGH TOK_POSEDGE TOK_NEGEDGE TOK_EDGE TOK_ALWAYS TOK_GLOBAL TOK_INIT %token TOK_UPDATE TOK_PROCESS TOK_END TOK_INVALID TOK_EOL TOK_OFFSET -%token TOK_PARAMETER TOK_ATTRIBUTE TOK_MEMORY TOK_SIZE TOK_SIGNED TOK_UPTO +%token TOK_PARAMETER TOK_ATTRIBUTE TOK_MEMORY TOK_SIZE TOK_SIGNED TOK_REAL TOK_UPTO %type <rsigspec> sigspec_list_reversed %type <sigspec> sigspec sigspec_list @@ -241,6 +241,12 @@ cell_body: free($4); delete $5; } | + cell_body TOK_PARAMETER TOK_REAL TOK_ID constant EOL { + current_cell->parameters[$4] = *$5; + current_cell->parameters[$4].flags |= RTLIL::CONST_FLAG_REAL; + free($4); + delete $5; + } | cell_body TOK_CONNECT TOK_ID sigspec EOL { if (current_cell->hasPort($3)) rtlil_frontend_ilang_yyerror(stringf("ilang error: redefinition of cell port %s.", $3).c_str()); |