Fix dangling vec4 stack when force assignment is suppressed.

Also improve the %debug/thr instruction.
This commit is contained in:
Stephen Williams 2014-02-07 16:10:28 -08:00
parent 60d37e1f53
commit c9e8392dc7
3 changed files with 10 additions and 6 deletions

View File

@ -961,8 +961,10 @@ static void force_vector_to_lval(ivl_statement_t net)
/* An out-of-range or undefined index will have been
converted to a canonical offset of 1'bx. Skip the
assignment in this case. */
if (number_is_unknown(word_idx))
if (number_is_unknown(word_idx)) {
fprintf(vvp_out, " %%pop/vec4 1; force to out of bounds index suppressed.\n");
return;
}
use_word = get_number_immediate(word_idx);
/* We do not currently support using a word from a variable

View File

@ -141,7 +141,7 @@ static const struct opcode_table_s opcode_table[] = {
{ "%cvt/vr", of_CVT_VR, 1, {OA_NUMBER, OA_NONE, OA_NONE} },
{ "%deassign",of_DEASSIGN,3,{OA_FUNC_PTR, OA_BIT1, OA_BIT2} },
{ "%deassign/wr",of_DEASSIGN_WR,1,{OA_FUNC_PTR, OA_NONE, OA_NONE} },
{ "%debug/thr", of_DEBUG_THR, 0,{OA_NONE, OA_NONE, OA_NONE} },
{ "%debug/thr", of_DEBUG_THR, 1,{OA_STRING, OA_NONE, OA_NONE} },
{ "%delay", of_DELAY, 2, {OA_BIT1, OA_BIT2, OA_NONE} },
{ "%delayx", of_DELAYX, 1, {OA_NUMBER, OA_NONE, OA_NONE} },
{ "%delete/obj",of_DELETE_OBJ,1,{OA_FUNC_PTR,OA_NONE, OA_NONE} },

View File

@ -97,7 +97,7 @@ using namespace std;
struct vthread_s {
vthread_s();
void debug_dump(ostream&fd);
void debug_dump(ostream&fd, const char*label_text);
/* This is the program counter. */
vvp_code_t pc;
@ -277,8 +277,9 @@ inline vthread_s::vthread_s()
stack_obj_size_ = 0;
}
void vthread_s::debug_dump(ostream&fd)
void vthread_s::debug_dump(ostream&fd, const char*label)
{
fd << "**** " << label << endl;
fd << "**** Flags: ";
for (int idx = 0 ; idx < FLAGS_COUNT ; idx += 1)
fd << flags[idx];
@ -2471,9 +2472,10 @@ bool of_DEASSIGN_WR(vthread_t, vvp_code_t cp)
/*
* %debug/thr
*/
bool of_DEBUG_THR(vthread_t thr, vvp_code_t)
bool of_DEBUG_THR(vthread_t thr, vvp_code_t cp)
{
thr->debug_dump(cerr);
const char*text = cp->text;
thr->debug_dump(cerr, text);
return true;
}