Fix vvp code generation for c. assign shift of array word (issue #632)
This commit is contained in:
parent
15e1a7a3f2
commit
831db5a0d7
|
|
@ -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
|
||||
|
|
@ -342,6 +342,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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2001-2021 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
|
||||
|
|
@ -1881,17 +1881,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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue