diff --git a/ivtest/ivltests/br_gh632.v b/ivtest/ivltests/br_gh632.v new file mode 100644 index 000000000..83050b919 --- /dev/null +++ b/ivtest/ivltests/br_gh632.v @@ -0,0 +1,21 @@ +module tb(); + +reg [15:0] array[1:0]; + +reg [3:0] shift_distance; + +wire [15:0] shifted_value; + +assign shifted_value = array[0] >> shift_distance; + +initial begin + array[0] = 16'h1234; + shift_distance = 4; + #0; + if (shifted_value === 16'h0123) + $display("PASSED"); + else + $display("FAILED"); +end + +endmodule diff --git a/ivtest/regress-vlg.list b/ivtest/regress-vlg.list index 7f49555ce..cd4062f0c 100644 --- a/ivtest/regress-vlg.list +++ b/ivtest/regress-vlg.list @@ -341,6 +341,7 @@ br_gh515 normal ivltests br_gh531 normal ivltests gold=br_gh531.gold br_gh533 CE ivltests br_gh567 normal,-g2001 ivltests gold=br_gh567.gold +br_gh632 normal ivltests br_ml20150315 normal ivltests gold=br_ml_20150315.gold br_ml20150321 CE ivltests br_ml20150606 normal ivltests diff --git a/tgt-vvp/vvp_scope.c b/tgt-vvp/vvp_scope.c index 557a45527..1b25e1604 100644 --- a/tgt-vvp/vvp_scope.c +++ b/tgt-vvp/vvp_scope.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001-2020 Stephen Williams (steve@icarus.com) + * Copyright (c) 2001-2022 Stephen Williams (steve@icarus.com) * * This source code is free software; you can redistribute it * and/or modify it in source code form under the terms of the GNU @@ -1851,17 +1851,16 @@ static void draw_lpm_shiftl(ivl_lpm_t net) const char* signed_flag = ivl_lpm_signed(net)? "s" : ""; const char*dly = draw_lpm_output_delay(net, IVL_VT_LOGIC); + const char *lval = draw_net_input(ivl_lpm_data(net, 0)); + const char *rval = draw_net_input(ivl_lpm_data(net, 1)); + if (ivl_lpm_type(net) == IVL_LPM_SHIFTR) fprintf(vvp_out, "L_%p%s .shift/r%s %u", net, dly, signed_flag, width); else fprintf(vvp_out, "L_%p%s .shift/l %u", net, dly, width); - fprintf(vvp_out, ", %s", draw_net_input(ivl_lpm_data(net, 0))); - - fprintf(vvp_out, ", %s", draw_net_input(ivl_lpm_data(net, 1))); - - fprintf(vvp_out, ";\n"); + fprintf(vvp_out, ", %s, %s;\n", lval, rval); } static void draw_type_string_of_nex(ivl_nexus_t nex)