From 69705ef32b8c2e778c52b95e3aec0a9cf3d0f84d Mon Sep 17 00:00:00 2001 From: Cary R Date: Thu, 21 Feb 2013 19:28:38 -0800 Subject: [PATCH] vlog95: a sign extend can have an out of scope reference. If modules instantiations were always handled correctly this would not be needed, but for now looking for the nexus driver outside the scope is needed to make some of the tests work. --- tgt-vlog95/logic_lpm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tgt-vlog95/logic_lpm.c b/tgt-vlog95/logic_lpm.c index 8d55e133e..343834f00 100644 --- a/tgt-vlog95/logic_lpm.c +++ b/tgt-vlog95/logic_lpm.c @@ -465,7 +465,7 @@ void emit_nexus_as_ca(ivl_scope_t scope, ivl_nexus_t nex, unsigned allow_UD) assert(! must_be_sig); // HERE: I think we need special input code like the following. #if 0 - /* If these is a signal in this scope that is also driven by + /* If there is a signal in this scope that is also driven by * the LPM then use the signal instead. */ sig = find_local_signal(scope, ivl_lpm_q(lpm), &word); if (sig) emit_nexus_as_ca(scope, ivl_signal_nex(sig, word), 0); @@ -1009,9 +1009,12 @@ static void emit_lpm_as_ca(ivl_scope_t scope, ivl_lpm_t lpm) fprintf(vlog_out, ")"); break; case IVL_LPM_SIGN_EXT: +// HERE: pr1002 and one other test fails if this assert is used. A more +// robust method is needed to make sure things work as expected. // assert(! sign_extend); sign_extend = 1; - emit_nexus_as_ca(scope, ivl_lpm_data(lpm, 0), 0); + emit_nexus_as_ca(scope, ivl_lpm_data(lpm, 0), 1); + sign_extend = 0; break; case IVL_LPM_SUB: fprintf(vlog_out, "(");