mirror of
https://github.com/verilator/verilator.git
synced 2025-04-05 04:02:37 +00:00
Fix sformatf internal error on initial automatics (#5423)
This commit is contained in:
parent
9a307c4abd
commit
201e343795
@ -376,6 +376,7 @@ class LinkResolveVisitor final : public VNVisitor {
|
||||
expectFormat(nodep, nodep->text(), nodep->exprsp(), true);
|
||||
}
|
||||
void visit(AstSFormatF* nodep) override {
|
||||
if (nodep->user2SetOnce()) return;
|
||||
iterateChildren(nodep);
|
||||
// Cleanup old-school displays without format arguments
|
||||
if (!nodep->hasFormat()) {
|
||||
|
21
test_regress/t/t_initial_assign_sformatf.pl
Executable file
21
test_regress/t/t_initial_assign_sformatf.pl
Executable file
@ -0,0 +1,21 @@
|
||||
#!/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(simulator => 1);
|
||||
|
||||
compile(
|
||||
);
|
||||
|
||||
execute(
|
||||
check_finished => 1,
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
32
test_regress/t/t_initial_assign_sformatf.v
Normal file
32
test_regress/t/t_initial_assign_sformatf.v
Normal file
@ -0,0 +1,32 @@
|
||||
// DESCRIPTION: Verilator: SystemVerilog interface test module
|
||||
//
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2012 by Iztok Jeras.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
interface intf();
|
||||
|
||||
function automatic string get_scope;
|
||||
string the_scope = $sformatf("%m");
|
||||
return the_scope;
|
||||
endfunction
|
||||
|
||||
initial $display(get_scope());
|
||||
endinterface
|
||||
|
||||
module t (/*AUTOARG*/
|
||||
// Inputs
|
||||
clk
|
||||
);
|
||||
|
||||
input clk;
|
||||
|
||||
// finish report
|
||||
always @ (posedge clk) begin
|
||||
$write("*-* All Finished *-*\n");
|
||||
$finish;
|
||||
end
|
||||
|
||||
intf the_intf();
|
||||
|
||||
endmodule
|
24
test_regress/t/t_initial_assign_sformatf_debug.pl
Executable file
24
test_regress/t/t_initial_assign_sformatf_debug.pl
Executable file
@ -0,0 +1,24 @@
|
||||
#!/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(simulator => 1);
|
||||
|
||||
top_filename("t/t_initial_assign_sformatf.v");
|
||||
|
||||
compile(
|
||||
verilator_flags2 => ['--debug'],
|
||||
);
|
||||
|
||||
execute(
|
||||
check_finished => 1,
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
Loading…
Reference in New Issue
Block a user