From eb5c035dde9155b368022f14605a1fb4a08e424c Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 22 Mar 2010 19:07:03 -0400 Subject: [PATCH] Internals: Fix some missing branch prediction --- include/verilated.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/verilated.cpp b/include/verilated.cpp index 3f11d9731..272522a0d 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -833,7 +833,7 @@ void VL_READMEM_W(bool hex, int width, int depth, int array_lsb, int fnwords, } else { needinc = true; //printf(" Value width=%d @%x = %c\n", width, addr, c); - if (addr >= (IData)(depth+array_lsb) || addr < (IData)(array_lsb)) { + if (VL_UNLIKELY(addr >= (IData)(depth+array_lsb) || addr < (IData)(array_lsb))) { vl_fatal (ofilenamez, linenum, "", "$readmem file address beyond bounds of array"); } else { int entry = addr - array_lsb; @@ -861,7 +861,7 @@ void VL_READMEM_W(bool hex, int width, int depth, int array_lsb, int fnwords, _VL_SHIFTL_INPLACE_W(width, datap, (IData)shift); datap[0] |= value; } - if (value>=(1<=(1<= m_funcnumMax) { m_funcnumMax = funcnum+1; } } else { - if (funcnum >= m_funcnumMax) { + if (VL_UNLIKELY(funcnum >= m_funcnumMax)) { vl_fatal(__FILE__,__LINE__,"","Internal: Bad funcnum vs. pre-finalize maximum"); } - if (!m_callbacksp) { // First allocation + if (VL_UNLIKELY(!m_callbacksp)) { // First allocation m_callbacksp = new void* [m_funcnumMax]; memset(m_callbacksp, 0, m_funcnumMax*sizeof(void*)); }