diff --git a/Changes b/Changes index 595169eb5..1b16de243 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,8 @@ indicates the contributor was also the author of the fix; Thanks! * Verilator 3.60** +*** Verilator now works under DJGPP (Pentium GCC). [John Stroebel] + **** Add default define for VL_PRINTF. [John Stroebel] **** Removed coverage request variable; see Coverage limitations in docs. diff --git a/TODO b/TODO index 1b5da6d7e..04442285b 100644 --- a/TODO +++ b/TODO @@ -97,6 +97,7 @@ Performance: Track recirculation and convert into clock-enables Clock enables should become new clocking domains for speed If floped(a) & flopped(b) and no other a&b, then instead flop(a&b). + Sort by output bitselects so can combine more assignments (see DDP example dx_dm signal) //********************************************************************** //* Detailed notes on 'todo' features diff --git a/src/V3PreLex.l b/src/V3PreLex.l index dca86e82c..bfbed3c9e 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -59,7 +59,8 @@ static void pslMoreNeeded(bool flag) { V3PreLex::s_currentLexp->m_pslMoreNeeded %x INCMODE ws [ \t\r\f] -newline [\n] +nl [\n] +cr [\m] quote [\"] backslash [\\] symb [a-zA-Z_][a-zA-Z0-9_$]* @@ -68,7 +69,7 @@ psl [p]sl /**************************************************************/ %% -^{ws}*"`line"{ws}+.*{newline} { V3PreLex::s_currentLexp->lineDirective(yytext); } +^{ws}*"`line"{ws}+.*{nl} { V3PreLex::s_currentLexp->lineDirective(yytext); } /* Special directives we recognise */ "`include" { return(VP_INCLUDE); } @@ -95,7 +96,7 @@ psl [p]sl /* Pass-through strings */ {quote} { yy_push_state(STRMODE); yymore(); } <> { linenoInc(); yyerror("EOF in unterminated string"); yyleng=0; yyterminate(); } -{newline} { linenoInc(); yyerror("Unterminated string"); BEGIN(INITIAL); } +{nl} { linenoInc(); yyerror("Unterminated string"); BEGIN(INITIAL); } [^\"\\] { yymore(); } {backslash}. { yymore(); } {quote} { yy_pop_state(); @@ -104,7 +105,7 @@ psl [p]sl /* Pass-through include <> filenames */ <> { linenoInc(); yyerror("EOF in unterminated include filename"); yyleng=0; yyterminate(); } -{newline} { linenoInc(); yyerror("Unterminated include filename"); BEGIN(INITIAL); } +{nl} { linenoInc(); yyerror("Unterminated include filename"); BEGIN(INITIAL); } [^\>\\] { yymore(); } {backslash}. { yymore(); } [\>] { yy_pop_state(); return (VP_STRING); } @@ -113,19 +114,19 @@ psl [p]sl "/*" { yy_push_state(CMTMODE); yymore(); } "//"[^\n]* { return (VP_COMMENT);} <> { linenoInc(); yyerror("EOF (missing return?) in define value"); yyleng=0; yyterminate(); } -{newline} { linenoInc(); +{nl} { linenoInc(); yy_pop_state(); return (VP_DEFVALUE); } /* Note contains a return */ [^\/\*\n\m\\]+ | [\\][^\n] | . { appendDefValue(yytext,yyleng); } -[\\]\n { linenoInc(); appendDefValue("\n",1); } +[\\]{nl} { linenoInc(); appendDefValue("\n",1); } /* Define arguments */ "/*" { yy_push_state(CMTMODE); yymore(); } "//"[^\n]* { return (VP_COMMENT);} <> { yyerror("EOF in define argument list\n"); yyleng = 0; yyterminate(); } -{newline} { linenoInc(); yytext="\n"; yyleng=1; return(VP_WHITE); } +{nl} { linenoInc(); yytext="\n"; yyleng=1; return(VP_WHITE); } {quote} { yy_push_state(STRMODE); yymore(); } [(] { V3PreLex::s_currentLexp->m_parenLevel++; appendDefValue(yytext,yyleng); } [,)] { if (V3PreLex::s_currentLexp->m_parenLevel>1) { @@ -140,7 +141,7 @@ psl [p]sl /* One line comments. */ "//"{ws}*{psl} { if (optPsl()) { pslMoreNeeded(true); yy_push_state(PSLONEM); return(VP_PSL); } else { yy_push_state(CMTONEM); yymore(); } } -"//"{newline} { linenoInc(); yytext="\n"; yyleng=1; return (VP_WHITE); } +"//"{nl} { linenoInc(); yytext="\n"; yyleng=1; return (VP_WHITE); } "//" { if (pslMoreNeeded()) { pslMoreNeeded(true); yy_push_state(PSLONEM); return(VP_PSL); } else { yy_push_state(CMTONEM); yymore(); } } [^\n]* { yy_pop_state(); return (VP_COMMENT); } @@ -150,10 +151,10 @@ psl [p]sl [})] { pslParenLevelDec(); return (VP_TEXT); } [;] { if (!pslParenLevel()) {BEGIN PSLONEE; pslMoreNeeded(false);} return (VP_TEXT); } <> { yyerror("EOF in '/* ... */' psl comment\n"); yyleng=0; yyterminate(); } -{newline} { linenoInc(); yy_pop_state(); return(VP_WHITE); } +{nl} { linenoInc(); yy_pop_state(); return(VP_WHITE); } /* Completed psl oneline comments */ -{newline} { linenoInc(); yy_pop_state(); return(VP_WHITE); } +{nl} { linenoInc(); yy_pop_state(); return(VP_WHITE); } {ws}+ { yymore(); } . { yyerror("Unexpected text following psl assertion\n"); } @@ -163,13 +164,13 @@ psl [p]sl {psl} { yyleng -= 3; BEGIN PSLMUL1; return (VP_COMMENT); } {ws}+ { yymore(); } "*/" { yy_pop_state(); return(VP_COMMENT); } -{newline} { linenoInc(); yymore(); } +{nl} { linenoInc(); yymore(); } <> { yyerror("EOF in '/* ... */' block comment\n"); yyleng=0; yyterminate(); } . { BEGIN CMTMODE; yymore(); } /* Non 'psl' beginning in comment */ . { yymore(); } /* Psl C-style comments. */ -.|{newline} { yyless(0); BEGIN PSLMULM; return(VP_PSL); } +.|{nl} { yyless(0); BEGIN PSLMULM; return(VP_PSL); } "*/" { yy_pop_state(); return(VP_COMMENT); } "//"[^\n]* { return (VP_COMMENT); } /* Comments inside block comments get literal inclusion (later removal) */ <> { yyerror("EOF in '/* ... */' psl comment\n"); yyleng=0; yyterminate(); } @@ -178,7 +179,7 @@ psl [p]sl "`"{symb} { return (VP_DEFREF); } /* Generics */ -{newline} { linenoInc(); return(VP_WHITE); } +{nl} { linenoInc(); return(VP_WHITE); } {symb} { return (VP_SYMBOL); } {ws}+ { return (VP_WHITE); } . { return (VP_TEXT); }