Don't merge bit select assignments in C code (#2971)

This commit is contained in:
Geza Lore 2021-05-18 19:28:48 +01:00 committed by GitHub
parent 0f7ec6c9ba
commit 9699192de8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 1 deletions

View File

@ -14,6 +14,7 @@ Verilator 4.203 devel
**Minor:**
* Fix initialization of assoc in assoc array (#2914). [myftptoyman]
* Fix merging of assignments in C++ code (#2970). [Ruper Swarbrick]
Verilator 4.202 2021-04-24

View File

@ -1719,7 +1719,7 @@ private:
VL_DO_DANGLING(streamp->deleteTree(), streamp);
// Further reduce, any of the nodes may have more reductions.
return true;
} else if (replaceAssignMultiSel(nodep)) {
} else if (m_doV && replaceAssignMultiSel(nodep)) {
return true;
}
return false;

View File

@ -0,0 +1,16 @@
#!/usr/bin/env perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2021 by Wilson Snyder. This program is free software; you
# can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
scenarios(vlt => 1);
lint();
ok(1);
1;

View File

@ -0,0 +1,14 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2021 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module t_no_sel_assign_merge_in_cpp (
input wire [(8*39)-1:0] d_i,
output wire [(8*32)-1:0] d_o
);
for (genvar i = 0; i < 8; i = i + 1) begin
assign d_o[i*32 +: 32] = d_i[i*39 +: 32];
end
endmodule