mirror of
https://github.com/verilator/verilator.git
synced 2025-04-04 19:52:39 +00:00
parent
1a1d2ecfd9
commit
5869fdf7f6
@ -116,6 +116,7 @@ Tomasz Gorochowik
|
||||
Tymoteusz Blazejczyk
|
||||
Udi Finkelstein
|
||||
Unai Martinez-Corral
|
||||
Varun Koyyalagunta
|
||||
Vassilis Papaefstathiou
|
||||
Veripool API Bot
|
||||
Victor Besyakov
|
||||
|
@ -673,7 +673,35 @@ void EmitCSyms::emitSymImp() {
|
||||
puts("_vm_pgoProfiler.write(\"" + topClassName()
|
||||
+ "\", _vm_contextp__->profVltFilename());\n");
|
||||
}
|
||||
puts("}\n\n");
|
||||
puts("}\n");
|
||||
|
||||
if (v3Global.needTraceDumper()) {
|
||||
if (!optSystemC()) {
|
||||
puts("\nvoid " + symClassName() + "::_traceDump() {\n");
|
||||
// Caller checked for __Vm_dumperp non-nullptr
|
||||
puts("const VerilatedLockGuard lock(__Vm_dumperMutex);\n");
|
||||
puts("__Vm_dumperp->dump(VL_TIME_Q());\n");
|
||||
puts("}\n");
|
||||
}
|
||||
|
||||
puts("\nvoid " + symClassName() + "::_traceDumpOpen() {\n");
|
||||
puts("const VerilatedLockGuard lock(__Vm_dumperMutex);\n");
|
||||
puts("if (VL_UNLIKELY(!__Vm_dumperp)) {\n");
|
||||
puts("__Vm_dumperp = new " + v3Global.opt.traceClassLang() + "();\n");
|
||||
puts("__Vm_modelp->trace(__Vm_dumperp, 0, 0);\n");
|
||||
puts("std::string dumpfile = _vm_contextp__->dumpfileCheck();\n");
|
||||
puts("__Vm_dumperp->open(dumpfile.c_str());\n");
|
||||
puts("__Vm_dumping = true;\n");
|
||||
puts("}\n");
|
||||
puts("}\n");
|
||||
|
||||
puts("\nvoid " + symClassName() + "::_traceDumpClose() {\n");
|
||||
puts("const VerilatedLockGuard lock(__Vm_dumperMutex);\n");
|
||||
puts("__Vm_dumping = false;\n");
|
||||
puts("VL_DO_CLEAR(delete __Vm_dumperp, __Vm_dumperp = nullptr);\n");
|
||||
puts("}\n");
|
||||
}
|
||||
puts("\n");
|
||||
|
||||
// Constructor
|
||||
puts(symClassName() + "::" + symClassName()
|
||||
@ -923,33 +951,6 @@ void EmitCSyms::emitSymImp() {
|
||||
|
||||
m_ofpBase->puts("}\n");
|
||||
|
||||
if (v3Global.needTraceDumper()) {
|
||||
if (!optSystemC()) {
|
||||
puts("\nvoid " + symClassName() + "::_traceDump() {\n");
|
||||
// Caller checked for __Vm_dumperp non-nullptr
|
||||
puts("const VerilatedLockGuard lock(__Vm_dumperMutex);\n");
|
||||
puts("__Vm_dumperp->dump(VL_TIME_Q());\n");
|
||||
puts("}\n");
|
||||
}
|
||||
|
||||
puts("\nvoid " + symClassName() + "::_traceDumpOpen() {\n");
|
||||
puts("const VerilatedLockGuard lock(__Vm_dumperMutex);\n");
|
||||
puts("if (VL_UNLIKELY(!__Vm_dumperp)) {\n");
|
||||
puts("__Vm_dumperp = new " + v3Global.opt.traceClassLang() + "();\n");
|
||||
puts("__Vm_modelp->trace(__Vm_dumperp, 0, 0);\n");
|
||||
puts("std::string dumpfile = _vm_contextp__->dumpfileCheck();\n");
|
||||
puts("__Vm_dumperp->open(dumpfile.c_str());\n");
|
||||
puts("__Vm_dumping = true;\n");
|
||||
puts("}\n");
|
||||
puts("}\n");
|
||||
|
||||
puts("\nvoid " + symClassName() + "::_traceDumpClose() {\n");
|
||||
puts("const VerilatedLockGuard lock(__Vm_dumperMutex);\n");
|
||||
puts("__Vm_dumping = false;\n");
|
||||
puts("VL_DO_CLEAR(delete __Vm_dumperp, __Vm_dumperp = nullptr);\n");
|
||||
puts("}\n");
|
||||
}
|
||||
|
||||
closeSplit();
|
||||
m_ofp = nullptr;
|
||||
VL_DO_CLEAR(delete m_ofpBase, m_ofpBase = nullptr);
|
||||
|
18
test_regress/t/t_trace_split_cfuncs.pl
Executable file
18
test_regress/t/t_trace_split_cfuncs.pl
Executable file
@ -0,0 +1,18 @@
|
||||
#!/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(
|
||||
v_flags2 => ["--trace", "--output-split-cfuncs", "1"]
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
14
test_regress/t/t_trace_split_cfuncs.v
Normal file
14
test_regress/t/t_trace_split_cfuncs.v
Normal 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, 2022 by Varun Koyyalagunta.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
module t ();
|
||||
|
||||
initial begin
|
||||
$dumpfile("dump.vcd");
|
||||
$dumpvars();
|
||||
end
|
||||
|
||||
endmodule
|
18
test_regress/t/t_trace_split_cfuncs_dpi_export.pl
Executable file
18
test_regress/t/t_trace_split_cfuncs_dpi_export.pl
Executable file
@ -0,0 +1,18 @@
|
||||
#!/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(
|
||||
v_flags2 => ["--trace", "--output-split-cfuncs", "1"]
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
18
test_regress/t/t_trace_split_cfuncs_dpi_export.v
Normal file
18
test_regress/t/t_trace_split_cfuncs_dpi_export.v
Normal file
@ -0,0 +1,18 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2022 by Varun Koyyalagunta.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
module t ();
|
||||
|
||||
function automatic void func();
|
||||
endfunction
|
||||
export "DPI-C" function func;
|
||||
|
||||
initial begin
|
||||
$dumpfile("dump.vcd");
|
||||
$dumpvars();
|
||||
end
|
||||
|
||||
endmodule
|
Loading…
Reference in New Issue
Block a user