diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vhd2vl.l | 8 | ||||
-rw-r--r-- | src/vhd2vl.y | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/vhd2vl.l b/src/vhd2vl.l index 661824f..e7419de 100644 --- a/src/vhd2vl.l +++ b/src/vhd2vl.l @@ -84,6 +84,7 @@ void getbasedstring(unsigned skip); "unsigned" | "std_logic_vector" | "std_ulogic_vector" { return BITVECT; } +"real" { return REAL; } "downto" { return DOWNTO; } "to" { return TO; } "type" {return TYPE; } @@ -148,6 +149,13 @@ void getbasedstring(unsigned skip); return NATURAL; } +[0-9]+e[0-9]+ | +[0-9]+\.[0-9]+e[0-9]+ { + yylval.txt=malloc(strlen(yytext)+1); + strcpy(yylval.txt, yytext); + return SCIENTIFIC; +} + [0-9]+\.[0-9]+ { getstring(0); return FLOAT; diff --git a/src/vhd2vl.y b/src/vhd2vl.y index 9847f4a..9525785 100644 --- a/src/vhd2vl.y +++ b/src/vhd2vl.y @@ -703,6 +703,7 @@ slist *emit_io_list(slist *sl) %token <txt> LASTVALUE EVENT POSEDGE NEGEDGE %token <txt> STRING NAME RANGE NULLV OPEN %token <txt> CONVFUNC_1 CONVFUNC_2 BASED FLOAT LEFT +%token <txt> SCIENTIFIC REAL %token <n> NATURAL %type <n> trad @@ -1033,6 +1034,9 @@ type : BIT { $$->nlo = addtxt(NULL,"0"); $$->nhi = addtxt(NULL,"31"); } + | REAL { + $$=new_vrange(tSCALAR); + } | BITVECT '(' vec_range ')' {$$=$3;} | NAME { sglist *sg; @@ -2054,6 +2058,12 @@ expr : signal { e->sl=addvec(NULL,$1); $$=e; } + | SCIENTIFIC { + expdata *e=xmalloc(sizeof(expdata)); + e->op='t'; /* Terminal symbol */ + e->sl=addtxt(NULL,$1); + $$=e; + } | FLOAT { expdata *e=xmalloc(sizeof(expdata)); e->op='t'; /* Terminal symbol */ |