mirror of
https://github.com/verilator/verilator.git
synced 2026-09-07 01:52:17 +02:00
Previously V3InlineCFuncs inlined call sites but never deleted the now dead callees. Also missed a lot of opportunities due to evaluation order. Rewrite using a graph based algorithm, using only a single traversal of the netlist. This is clearer, more accurate, and faster at compile time. Also add a clean -fno-inline-cfuncs disable. Setting the limits to 0 still disables inlining, except of empty functions, which can be inlined with 0 limits (they are no ops). It will also prune unused functions without -fno-inline-cfuncs. Pass now also respects `--output-split`
33 lines
1017 B
Python
Executable File
33 lines
1017 B
Python
Executable File
#!/usr/bin/env python3
|
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
|
#
|
|
# 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-FileCopyrightText: 2024 Wilson Snyder
|
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
|
|
|
import json
|
|
import vltest_bootstrap
|
|
|
|
test.scenarios('vlt')
|
|
test.top_filename = "t/t_enum_type_methods.v"
|
|
|
|
out_filename = test.obj_dir + "/V" + test.name + ".tree.json"
|
|
|
|
test.compile(verilator_flags2=[
|
|
'--no-std', '--debug-check', '--no-json-edit-nums', '--flatten', '-fno-inline-cfuncs'
|
|
],
|
|
verilator_make_gmake=False,
|
|
make_top_shell=False,
|
|
make_main=False)
|
|
|
|
# not files_identical as output is too sensitive to internal changes
|
|
test.file_grep(out_filename, r'"type":"MODULE"')
|
|
|
|
# check JSON is parsable
|
|
with open(out_filename, 'r', encoding="utf8") as fh:
|
|
json.load(fh)
|
|
|
|
test.passes()
|