Fix PowerPC runtime error, bug288

This commit is contained in:
Wilson Snyder 2011-08-22 21:02:09 -04:00
parent f9bbf31d65
commit 3fae8ade05
8 changed files with 20 additions and 15 deletions

View File

@ -5,6 +5,8 @@ indicates the contributor was also the author of the fix; Thanks!
* Verilator 3.821****
**** Fix PowerPC runtime error, bug288. [Ahmed El-Mahmoudy]
**** Fix internal error on integer casts, bug374. [Chandan Egbert]
* Verilator 3.820 2011/07/28

View File

@ -58,7 +58,7 @@ pkgdatadir = @pkgdatadir@
# Compile options
CFG_WITH_DEFENV = @CFG_WITH_DEFENV@
CPPFLAGSNOWALL += @CPPFLAGS@
CPPFLAGS += @CPPFLAGS@
LDFLAGS += @LDFLAGS@
#### End of system configuration section. ####
@ -85,17 +85,18 @@ endif
# -lfl not needed as Flex invoked with %nowrap option
LIBS = -lm
CPPFLAGSNOWALL += -MMD
CPPFLAGSNOWALL += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir)
CPPFLAGSNOWALL += -DYYDEBUG # Required to get nice error messages
#CPPFLAGSNOWALL += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool
CPPFLAGSNOWALL += $(COPT)
CPPFLAGS = $(CPPFLAGSNOWALL)
CPPFLAGS += -MMD
CPPFLAGS += -I. -I$(bldsrc) -I$(srcdir) -I$(incdir)
CPPFLAGS += -DYYDEBUG # Required to get nice error messages
#CPPFLAGS += -DVL_LEAK_CHECKS # If running valgrind or other hunting tool
CPPFLAGS += $(COPT)
CPPFLAGS += -MP # Only works on recent GCC versions
ifeq ($(VERILATOR_AUTHOR_SITE),1) # Local... Else don't burden users
CPPFLAGSNOWALL += -MP # Only works on recent GCC versions
CPPFLAGS += -W -Wall -Wno-unused-parameter -Wno-char-subscripts -Werror
#CPPFLAGS += -pedantic-errors
endif
CPPFLAGSWALL = $(CPPFLAGS)
CPPFLAGSNOWALL = $(CPPFLAGS)
ifneq ($(SYSTEMPERL),) # Intuit SYSTEMPERL_INCLUDE as it's new
SYSTEMPERL_INCLUDE ?= $(SYSTEMPERL)/src
@ -262,9 +263,9 @@ V3Number_test: V3Number_test.o
$(PERL) $(ASTGEN) -I$(srcdir) $*.cpp
%.o: %.cpp
$(OBJCACHE) ${CXX} ${CPPFLAGS} -c $<
$(OBJCACHE) ${CXX} ${CPPFLAGSWALL} -c $<
%.o: %.c
$(OBJCACHE) ${CC} ${CPPFLAGS} -c $<
$(OBJCACHE) ${CC} ${CPPFLAGSWALL} -c $<
V3ParseLex.o: V3ParseLex.cpp V3Lexer.yy.cpp V3ParseBison.c
$(OBJCACHE) ${CXX} ${CPPFLAGSNOWALL} -c $<

View File

@ -3465,7 +3465,7 @@ struct AstBufIf1 : public AstNodeBiop {
virtual void numberOperate(V3Number& out, const V3Number& lhs, const V3Number& rhs) { out.opBufIf1(lhs,rhs); }
virtual string emitVerilog() { return "bufif(%r,%l)"; }
virtual string emitC() { V3ERROR_NA; return "";} // Lclean || Rclean
virtual string emitSimpleOperator() { V3ERROR_NA; return false;} // Lclean || Rclean
virtual string emitSimpleOperator() { V3ERROR_NA; return "";} // Lclean || Rclean
virtual bool cleanOut() {V3ERROR_NA; return "";} // Lclean || Rclean
virtual bool cleanLhs() {return false;} virtual bool cleanRhs() {return false;}
virtual bool sizeMattersLhs() {return false;} virtual bool sizeMattersRhs() {return false;}

View File

@ -316,7 +316,7 @@ public:
public:
// CREATORS
V3ParseImp(AstNetlist* rootp, V3InFilter* filterp)
: m_sym(rootp), m_filterp(filterp) {
: m_filterp(filterp), m_sym(rootp) {
m_fileline = NULL;
m_rootp = rootp; m_lexerp = NULL;
m_inCellDefine = false;

View File

@ -62,7 +62,7 @@ public:
void V3ParseImp::stateExitPsl() { parsep()->m_lexerp->stateExitPsl(); }
void V3ParseImp::statePushVlg() { parsep()->m_lexerp->stateExitPsl(); }
void V3ParseImp::statePop() { parsep()->m_lexerp->statePop(); }
int V3ParseImp::yylexThis() { parsep()->m_lexerp->yylex(); }
int V3ParseImp::yylexThis() { return parsep()->m_lexerp->yylex(); }
//######################################################################
// Read class functions

View File

@ -538,6 +538,7 @@ void V3PreLex::unused() {
if (0) {
// Prevent unused warnings
yy_top_state();
yyerror((char*)"");
}
}

View File

@ -963,7 +963,8 @@ double V3ParseImp::parseDouble(const char* textp, size_t length) {
*dp++ = '\0';
char* endp = strgp;
double d = strtod(strgp, &endp);
if ((endp-strgp) != length) { yyerrorf("Syntax error parsing real: %s",strgp); }
size_t parsed_len = endp-strgp;
if (parsed_len != length) { yyerrorf("Syntax error parsing real: %s",strgp); }
delete strgp;
return d;
}

View File

@ -71,7 +71,7 @@ public:
m_varIO = AstVarType::UNKNOWN;
m_varDTypep = NULL;
m_pinNum = -1;
m_instModule;
m_instModule = "";
m_instParamp = NULL;
m_modp = NULL;
m_modTypeImpNum = 0;