mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Fix null characters in shortened identifiers (#4946).
This commit is contained in:
parent
acb63c929b
commit
8ba494c71f
1
Changes
1
Changes
@ -27,6 +27,7 @@ Verilator 5.023 devel
|
||||
* Fix try-lock spuriously fails (#4931) (#4938). [Kamil Rakoczy]
|
||||
* Fix V3Unknown unpacked struct x-assign (#4934). [Yan Xu]
|
||||
* Fix DFG removing forceable signals (#4942). [Geza Lore]
|
||||
* Fix null characters in shortened identifiers (#4946). [Abdul Hameed]
|
||||
|
||||
|
||||
Verilator 5.022 2024-02-24
|
||||
|
@ -563,8 +563,13 @@ string VName::hashedName() {
|
||||
VHashSha256 hash{m_name};
|
||||
const string suffix = "__Vhsh" + hash.digestSymbol();
|
||||
if (s_minLength < s_maxLength) {
|
||||
s_dehashMap[suffix] = m_name.substr(s_minLength);
|
||||
m_hashed = m_name.substr(0, s_minLength) + suffix;
|
||||
// Keep a prefix from the original name
|
||||
// Backup over digits so adding __Vhash doesn't look like a encoded hex digit
|
||||
// ("__0__Vhsh")
|
||||
size_t prefLength = s_minLength;
|
||||
while (prefLength >= 1 && m_name[prefLength - 1] != '_') --prefLength;
|
||||
s_dehashMap[suffix] = m_name.substr(prefLength);
|
||||
m_hashed = m_name.substr(0, prefLength) + suffix;
|
||||
} else {
|
||||
s_dehashMap[suffix] = m_name;
|
||||
m_hashed = suffix;
|
||||
|
@ -1,4 +1,4 @@
|
||||
%Error: obj_vlt/t_inst_long_bad/t_inst_long.v:4:3: Cannot find file containing module: 'long_long_long_long_long_long_lo__Vhsh1JZCXQVBM1QiASYlLmgTuAXYyUr7VAbJYwVHfiAD'
|
||||
%Error: obj_vlt/t_inst_long_bad/t_inst_long.v:4:3: Cannot find file containing module: 'long_long_long_long_long_long___Vhsh1JZCXQVBM1QiASYlLmgTuAXYyUr7VAbJYwVHfiAD'
|
||||
4 | long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_ inst ();
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
... Unsupported: Name is longer than 127 characters; automatic file lookup not supported.
|
||||
|
16
test_regress/t/t_inst_name_long.pl
Executable file
16
test_regress/t/t_inst_name_long.pl
Executable 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 2003 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);
|
||||
|
||||
compile();
|
||||
|
||||
ok(1);
|
||||
1;
|
46
test_regress/t/t_inst_name_long.v
Normal file
46
test_regress/t/t_inst_name_long.v
Normal file
@ -0,0 +1,46 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2024 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
// verilator lint_off PINMISSING
|
||||
// verilator lint_off WIDTHEXPAND
|
||||
|
||||
module t;
|
||||
// Original issue
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/XxxxxxxxXxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
// Change sizes
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/XxxxxxxXxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/Xxxxxxxxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/XxxxxXxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/XxxxXxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/XxxXxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/XxxxxxxxxXxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/XxxxxxxxxxXxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
sub #(.PARAM("FALSE"))
|
||||
\$mul$/nxx_xxxxxxx/xxxxxxx/XxxxxxxxxxxXxxxxxxxxx/xxx/.././xxx/xxx_xxxxxxxxxx_xxxxx_xxxx_xxx_xxx.v:30$7 (
|
||||
);
|
||||
|
||||
endmodule
|
||||
|
||||
module sub #(parameter PARAM = "TRUE")
|
||||
(input [5:0] ACC_FIR);
|
||||
always @(ACC_FIR) $display("WARNING: instance %m input is %d", PARAM);
|
||||
endmodule
|
Loading…
Reference in New Issue
Block a user