From 0fbdcbeb02531f83ab990640b36d1ef57ac55733 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Sat, 8 Dec 2007 21:10:58 -0800 Subject: [PATCH] Minor cleanup. Minor cleanup of some commented out code, and some minor simplification of the subarray code. --- tgt-vvp/eval_expr.c | 7 ------- vvp/vvp_net.cc | 10 ++++------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/tgt-vvp/eval_expr.c b/tgt-vvp/eval_expr.c index 25cff0ae5..27c5df234 100644 --- a/tgt-vvp/eval_expr.c +++ b/tgt-vvp/eval_expr.c @@ -1862,14 +1862,7 @@ static struct vector_info draw_select_signal(ivl_expr_t sube, use_word = get_number_immediate(ix); } -#if 0 - shiv = draw_eval_expr(bit_idx, STUFF_OK_XZ|STUFF_OK_RO); - fprintf(vvp_out, " %%ix/get 0, %u, %u;\n", shiv.base, shiv.wid); - if (shiv.base >= 8) - clr_vector(shiv); -#else draw_eval_expr_into_integer(bit_idx, 0); -#endif /* Try the special case that the base is 0 and the width exactly matches the signal. Just load the signal in one diff --git a/vvp/vvp_net.cc b/vvp/vvp_net.cc index cc66e6425..16622460c 100644 --- a/vvp/vvp_net.cc +++ b/vvp/vvp_net.cc @@ -357,10 +357,9 @@ unsigned long* vvp_vector4_t::subarray(unsigned adr, unsigned wid) const tmp >>= 2UL * off; // Test for X bits but not beyond the desired wid. - unsigned long xmask = WORD_X_BITS; if (wid < (BITS_PER_WORD-off)) - xmask &= ~(-1UL << 2*wid); - if (tmp & xmask) + tmp &= ~(-1UL << 2*wid); + if (tmp & WORD_X_BITS) goto x_out; // Where in the target array to write the next bit. @@ -376,10 +375,9 @@ unsigned long* vvp_vector4_t::subarray(unsigned adr, unsigned wid) const tmp = bits_ptr_[adr/BITS_PER_WORD]; // If this is the last word, then only test // for X in the valid bits. - xmask = WORD_X_BITS; if ((wid-idx) < BITS_PER_WORD) - xmask &= ~(WORD_Z_BITS<<2*(wid-idx)); - if (tmp & xmask) + tmp &= ~(WORD_Z_BITS<<2*(wid-idx)); + if (tmp & WORD_X_BITS) goto x_out; adr_bit = 0; }