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.
This commit is contained in:
Cary R 2009-05-07 18:39:09 -07:00 committed by Stephen Williams
parent fad37da1dc
commit f1c5b58845
1 changed files with 3 additions and 3 deletions

View File

@ -1018,7 +1018,7 @@ bool of_ASSIGN_V0X1(vthread_t thr, vvp_code_t cp)
if (off >= (long)sig->size()) return true; if (off >= (long)sig->size()) return true;
else if (off < 0 ) { else if (off < 0 ) {
// We fell off the LSB end. // We fell off the LSB end.
if ((unsigned)-off > wid ) return true; if ((unsigned)-off >= wid ) return true;
// Trim the bits before the LSB // Trim the bits before the LSB
wid += off; wid += off;
bit -= 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; if (off >= (long)sig->size()) return true;
else if (off < 0 ) { else if (off < 0 ) {
// We fell off the LSB end. // We fell off the LSB end.
if ((unsigned)-off > wid ) return true; if ((unsigned)-off >= wid ) return true;
// Trim the bits before the LSB // Trim the bits before the LSB
wid += off; wid += off;
bit -= off; bit -= off;
@ -1094,7 +1094,7 @@ bool of_ASSIGN_V0X1E(vthread_t thr, vvp_code_t cp)
return true; return true;
} else if (off < 0 ) { } else if (off < 0 ) {
// We fell off the LSB end. // We fell off the LSB end.
if ((unsigned)-off > wid ) { if ((unsigned)-off >= wid ) {
thr->event = 0; thr->event = 0;
thr->ecount = 0; thr->ecount = 0;
return true; return true;