mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
parent
367249ec84
commit
c812a9b18f
@ -553,7 +553,7 @@ string V3Options::filePath(FileLine* fl, const string& modname, const string& la
|
||||
// Find a filename to read the specified module name,
|
||||
// using the incdir and libext's.
|
||||
// Return "" if not found.
|
||||
const string filename = V3Os::filenameCleanup(modname);
|
||||
const string filename = V3Os::filenameCleanup(VName::dehash(modname));
|
||||
if (!V3Os::filenameIsRel(filename)) {
|
||||
// filename is an absolute path, so can find getStdPackagePath()
|
||||
string exists = filePathCheckOneDir(filename, "");
|
||||
@ -585,8 +585,8 @@ void V3Options::filePathLookedMsg(FileLine* fl, const string& modname) {
|
||||
static bool shown_notfound_msg = false;
|
||||
if (modname.find("__Vhsh") != string::npos) {
|
||||
std::cerr << V3Error::warnMoreStandalone()
|
||||
<< "... Unsupported: Name is longer than 127 characters;"
|
||||
<< " automatic file lookup not supported.\n";
|
||||
<< "... Note: Name is longer than 127 characters; automatic"
|
||||
<< " file lookup may have failed due to OS filename length limits.\n";
|
||||
std::cerr << V3Error::warnMoreStandalone()
|
||||
<< "... Suggest putting filename with this module/package"
|
||||
<< " onto command line instead.\n";
|
||||
|
58
test_regress/t/t_inst_long.pl
Executable file
58
test_regress/t/t_inst_long.pl
Executable file
@ -0,0 +1,58 @@
|
||||
#!/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
|
||||
|
||||
use IO::File;
|
||||
use strict;
|
||||
use vars qw($Self);
|
||||
|
||||
scenarios(vlt => 1);
|
||||
|
||||
my $length = 200;
|
||||
my $long = "long_" x (($length + 4) / 5);
|
||||
|
||||
sub gen_top {
|
||||
my $filename = shift;
|
||||
|
||||
my $fh = IO::File->new(">$filename")
|
||||
or $Self->error("Can't write $filename");
|
||||
$fh->print("// Generated by t_inst_long.pl\n");
|
||||
$fh->print("module t;\n");
|
||||
$fh->print("\n");
|
||||
$fh->print(" ${long} inst ();\n");
|
||||
$fh->print("\n");
|
||||
$fh->print("endmodule\n");
|
||||
$fh->close;
|
||||
}
|
||||
|
||||
sub gen_sub {
|
||||
my $filename = shift;
|
||||
|
||||
my $fh = IO::File->new(">$filename")
|
||||
or $Self->error("Can't write $filename");
|
||||
$fh->print("// Generated by t_inst_long.pl\n");
|
||||
$fh->print("module ${long};\n");
|
||||
$fh->print("\n");
|
||||
$fh->print(" initial begin\n");
|
||||
$fh->print(" \$write(\"*-* All Finished *-*\\n\");\n");
|
||||
$fh->print(" \$finish;\n");
|
||||
$fh->print(" end\n");
|
||||
$fh->print("endmodule\n");
|
||||
$fh->close;
|
||||
}
|
||||
|
||||
top_filename("$Self->{obj_dir}/t_inst_long.v", $long);
|
||||
|
||||
gen_top($Self->{top_filename});
|
||||
gen_sub("$Self->{obj_dir}/${long}.v");
|
||||
|
||||
compile();
|
||||
|
||||
ok(1);
|
||||
1;
|
@ -1,6 +1,6 @@
|
||||
%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 ();
|
||||
%Error: t/t_inst_long_bad.v:9:3: Cannot find file containing module: 'long_long_long_long_long_long___Vhsh1JZCXQVBM1QiASYlLmgTuAXYyUr7VAbJYwVHfiAD'
|
||||
9 | 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.
|
||||
... Note: Name is longer than 127 characters; automatic file lookup may have failed due to OS filename length limits.
|
||||
... Suggest putting filename with this module/package onto command line instead.
|
||||
%Error: Exiting due to
|
||||
|
@ -8,49 +8,7 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
|
||||
# Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
use IO::File;
|
||||
use strict;
|
||||
use vars qw($Self);
|
||||
|
||||
scenarios(vlt => 1);
|
||||
|
||||
my $length = 200;
|
||||
my $long = "long_" x (($length + 4) / 5);
|
||||
|
||||
sub gen_top {
|
||||
my $filename = shift;
|
||||
|
||||
my $fh = IO::File->new(">$filename")
|
||||
or $Self->error("Can't write $filename");
|
||||
$fh->print("// Generated by t_inst_long.pl\n");
|
||||
$fh->print("module t;\n");
|
||||
$fh->print("\n");
|
||||
$fh->print(" ${long} inst ();\n");
|
||||
$fh->print("\n");
|
||||
$fh->print("endmodule\n");
|
||||
$fh->close;
|
||||
}
|
||||
|
||||
sub gen_sub {
|
||||
my $filename = shift;
|
||||
|
||||
my $fh = IO::File->new(">$filename")
|
||||
or $Self->error("Can't write $filename");
|
||||
$fh->print("// Generated by t_inst_long.pl\n");
|
||||
$fh->print("module ${long};\n");
|
||||
$fh->print("\n");
|
||||
$fh->print(" initial begin\n");
|
||||
$fh->print(" \$write(\"*-* All Finished *-*\\n\");\n");
|
||||
$fh->print(" \$finish;\n");
|
||||
$fh->print(" end\n");
|
||||
$fh->print("endmodule\n");
|
||||
$fh->close;
|
||||
}
|
||||
|
||||
top_filename("$Self->{obj_dir}/t_inst_long.v", $long);
|
||||
|
||||
gen_top($Self->{top_filename});
|
||||
gen_sub("$Self->{obj_dir}/${long}.v");
|
||||
scenarios(linter => 1);
|
||||
|
||||
lint(
|
||||
fails => 1,
|
||||
|
11
test_regress/t/t_inst_long_bad.v
Normal file
11
test_regress/t/t_inst_long_bad.v
Normal file
@ -0,0 +1,11 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2012 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
module t;
|
||||
|
||||
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 ();
|
||||
|
||||
endmodule
|
Loading…
Reference in New Issue
Block a user