From f1c5b588458f31e94dff65a9bfbb4805aad2fa93 Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 7 May 2009 18:39:09 -0700 Subject: [PATCH] Fix the %assign/v0/x1 operators for width equal negative offset case. This patch fixes the three %assign/v0/x1 operators to correctly notice that the select has fallen off the start of the vector for the case that the negative offset equaled the width. --- vvp/vthread.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vvp/vthread.cc b/vvp/vthread.cc index ce7b91d33..1b87cbc22 100644 --- a/vvp/vthread.cc +++ b/vvp/vthread.cc @@ -1018,7 +1018,7 @@ bool of_ASSIGN_V0X1(vthread_t thr, vvp_code_t cp) if (off >= (long)sig->size()) return true; else if (off < 0 ) { // We fell off the LSB end. - if ((unsigned)-off > wid ) return true; + if ((unsigned)-off >= wid ) return true; // Trim the bits before the LSB wid += off; bit -= off; @@ -1055,7 +1055,7 @@ bool of_ASSIGN_V0X1D(vthread_t thr, vvp_code_t cp) if (off >= (long)sig->size()) return true; else if (off < 0 ) { // We fell off the LSB end. - if ((unsigned)-off > wid ) return true; + if ((unsigned)-off >= wid ) return true; // Trim the bits before the LSB wid += off; bit -= off; @@ -1094,7 +1094,7 @@ bool of_ASSIGN_V0X1E(vthread_t thr, vvp_code_t cp) return true; } else if (off < 0 ) { // We fell off the LSB end. - if ((unsigned)-off > wid ) { + if ((unsigned)-off >= wid ) { thr->event = 0; thr->ecount = 0; return true;