verilator/test_regress/t/t_flag_parameter_hier.py

31 lines
1.1 KiB
Python
Raw Normal View History

2024-09-08 19:00:03 +02:00
#!/usr/bin/env python3
2020-04-23 14:04:15 +02:00
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
2024-09-08 19:00:03 +02:00
# Copyright 2024 by Wilson Snyder. This program is free software; you
2020-04-23 14:04:15 +02:00
# 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
2024-09-08 19:00:03 +02:00
import vltest_bootstrap
2020-04-23 14:04:15 +02:00
2024-09-08 19:00:03 +02:00
test.scenarios('simulator')
test.compile(
# For Verilator, all PARAMs at all levels are overridden
2020-04-23 14:04:15 +02:00
# Error if parameter not found
2024-09-08 19:00:03 +02:00
#verilator_flags2 = ['-GPARAM=10 -Gtop.t.x.HIER=20'], # HIER would error
verilator_flags2=['-GPARAM=10'],
2020-04-23 14:04:15 +02:00
# For NC, always implies a hierarchy, only HIER will be set
# Warns if sets nothing
2024-09-08 19:00:03 +02:00
nc_flags2=['+defparam+PARAM=10 +defparam+top.t.x.HIER=20'],
2020-04-23 14:04:15 +02:00
# For VCS, all PARAMs at all levels are overridden. Hierarchy not allowed.
# Informational on all overrides
2024-09-08 19:00:03 +02:00
vcs_flags2=['-pvalue+PARAM=10 -px.HIER=20'],
2020-04-23 14:04:15 +02:00
# For icarus -P without hierarchy does nothing, only can ref into top
2024-09-08 19:00:03 +02:00
iv_flags2=['-PPARAM=10', '-Ptop.HIER=30', '-Ptop.t.x.HIER=20'])
2020-04-23 14:04:15 +02:00
2024-09-08 19:00:03 +02:00
test.execute()
2020-04-23 14:04:15 +02:00
2024-09-08 19:00:03 +02:00
test.passes()