From 547eb6a836ca1fea55eeed6b779f572828ddd44b Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 13 Sep 2026 14:54:34 -0400 Subject: [PATCH] Remove deprecated `--structs-packed`. --- Changes | 1 + docs/guide/deprecations.rst | 8 -------- docs/guide/exe_verilator.rst | 9 ++++----- docs/guide/warnings.rst | 10 +++------- src/V3Options.cpp | 4 ---- src/V3Options.h | 2 -- src/V3Width.cpp | 6 +----- test_regress/t/t_flag_structs_packed.out | 3 --- test_regress/t/t_flag_structs_packed.py | 19 ------------------ test_regress/t/t_flag_structs_packed.v | 21 -------------------- test_regress/t/t_flag_structs_packed_bad.out | 6 ------ test_regress/t/t_flag_structs_packed_bad.py | 17 ---------------- 12 files changed, 9 insertions(+), 97 deletions(-) delete mode 100644 test_regress/t/t_flag_structs_packed.out delete mode 100755 test_regress/t/t_flag_structs_packed.py delete mode 100644 test_regress/t/t_flag_structs_packed.v delete mode 100644 test_regress/t/t_flag_structs_packed_bad.out delete mode 100755 test_regress/t/t_flag_structs_packed_bad.py diff --git a/Changes b/Changes index 9102be2c4..c235004d8 100644 --- a/Changes +++ b/Changes @@ -18,6 +18,7 @@ Verilator 5.053 devel * Add covergroup runtime registry (#8134). [Matthew Ballance] * Add initial support for solo `binsof` (#8298). [Marco Bartoli] * Add `-fno-dead-members` and optimize dead class member functions (#8830). +* Remove deprecated `--structs-packed`. * Change JSON dumps to suppress empty strings, etc. * Support VPI interface references (#8081). [Todd Strader] * Support nested array and associative array element member access in constraint 1/4 - pre-cleanup (#8237). [Kamil Danecki, Antmicro Ltd.] diff --git a/docs/guide/deprecations.rst b/docs/guide/deprecations.rst index 7d69ab1c2..2dbc7243f 100644 --- a/docs/guide/deprecations.rst +++ b/docs/guide/deprecations.rst @@ -18,14 +18,6 @@ C++14 compiler support the Ubuntu LTS versions of GCC and clang use C++20 by default, estimated May 2028.) -`--structs-packed` option - The :vlopt:`--structs-packed` option was introduced when Verilator was - first implementing unpacked structs. That feature has been stable now - for multiple years, so :vlopt:`--structs-packed` should no longer be - used. Thus :vlopt:`--structs-packed` will change to a no-operation flag - and the related :option:`UNPACKED` warning will never be issued no - sooner than September 2026. - tcmalloc support Verilator currently supports the default malloc, tcmalloc, or jemalloc. As jemalloc has better performance, support for tcmalloc may be removed diff --git a/docs/guide/exe_verilator.rst b/docs/guide/exe_verilator.rst index 1f0d23324..ae1f9301d 100644 --- a/docs/guide/exe_verilator.rst +++ b/docs/guide/exe_verilator.rst @@ -1792,12 +1792,11 @@ Summary: .. option:: --structs-packed - Deprecated; discontinue use of this option. + Removed in 5.054. - Converts all unpacked structures to packed structures, and issues an - :option:`UNPACKED` warning. Specifying this option allows for backward - compatibility with versions before Verilator 5.006, when Verilator would - always pack unpacked structures. + Converted all unpacked structures to packed structures, Specifying this + option allowed for backward compatibility with versions before Verilator + 5.006, when Verilator would always pack unpacked structures. .. option:: -sv diff --git a/docs/guide/warnings.rst b/docs/guide/warnings.rst index b8115bfc6..d4db0efa9 100644 --- a/docs/guide/warnings.rst +++ b/docs/guide/warnings.rst @@ -2503,14 +2503,10 @@ List Of Warnings .. option:: UNPACKED - Warns that unpacked structs and unions are not supported because - :vlopt:`--structs-packed` was used, or by up through version 5.004. + Historical, never issued since version 5.004. - Ignoring this warning will make Verilator treat the structure as packed, - which may make Verilator simulations differ from other simulators. This - downgrading may also result in what would typically be a legal unpacked - struct/array inside an unpacked struct/array becoming an illegal - unpacked struct/array inside a packed struct/array. + Warned that unpacked structs and unions were not supported, or disabled + by the since-removed `--structs-packed` option. .. option:: UNSATCONSTR diff --git a/src/V3Options.cpp b/src/V3Options.cpp index b40a6b04a..2381410e9 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -1774,10 +1774,6 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, DECL_OPTION("-std-package", OnOff, &m_stdPackage); DECL_OPTION("-std-waiver", OnOff, &m_stdWaiver); DECL_OPTION("-stop-fail", OnOff, &m_stopFail); - DECL_OPTION("-structs-packed", CbOnOff, [this, fl](bool flag) { - m_structsPacked = flag; - fl->v3warn(DEPRECATED, "Option --structs-packed is deprecated, avoid use"); - }).undocumented(); DECL_OPTION("-sv", CbCall, [this]() { m_defaultLanguage = V3LangCode::L1800_2023; }); DECL_OPTION("-no-threads", CbCall, [this, fl]() { diff --git a/src/V3Options.h b/src/V3Options.h index 30a56b629..c32f0827d 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -294,7 +294,6 @@ private: VOptionBool m_schedZeroDelay; // main switch: --sched-zero-delay bool m_stdPackage = true; // main switch: --std-package bool m_stdWaiver = true; // main switch: --std-waiver - bool m_structsPacked = false; // main switch: --structs-packed bool m_systemC = false; // main switch: --sc: System C instead of simple C++ bool m_stats = false; // main switch: --stats bool m_statsVars = false; // main switch: --stats-vars @@ -510,7 +509,6 @@ public: bool statsVars() const { return m_statsVars; } bool stdPackage() const { return m_stdPackage; } bool stdWaiver() const { return m_stdWaiver; } - bool structsPacked() const { return m_structsPacked; } bool assertOn() const { return m_assert; } // assertOn as __FILE__ may be defined bool assertCase() const { return m_assertCase; } bool autoflush() const { return m_autoflush; } diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 7e0099b87..9954767b2 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -3827,7 +3827,6 @@ class WidthVisitor final : public VNVisitor { if (unionp->isTagged()) { nodep->v3warn(E_UNSUPPORTED, "Unsupported: tagged union"); } } // UINFOTREE(9, nodep, "", "class-in"); - if (!nodep->packed() && v3Global.opt.structsPacked()) nodep->packed(true); userIterateChildren(nodep, nullptr); // First size all members nodep->dtypep(nodep); nodep->isFourstate(false); @@ -3835,10 +3834,7 @@ class WidthVisitor final : public VNVisitor { for (AstMemberDType* itemp = nodep->membersp(); itemp; itemp = VN_AS(itemp->nextp(), MemberDType)) { AstNodeDType* const dtp = itemp->subDTypep()->skipRefp(); - if (nodep->packed() - && !dtp->isIntegralOrPacked() - // Historically lax: - && !v3Global.opt.structsPacked()) + if (nodep->packed() && !dtp->isIntegralOrPacked()) itemp->v3error("Unpacked data type " << dtp->prettyDTypeNameQ() << " in packed struct/union (IEEE 1800-2023 7.2.1)"); diff --git a/test_regress/t/t_flag_structs_packed.out b/test_regress/t/t_flag_structs_packed.out deleted file mode 100644 index dd4a09029..000000000 --- a/test_regress/t/t_flag_structs_packed.out +++ /dev/null @@ -1,3 +0,0 @@ -%Warning-DEPRECATED: Option --structs-packed is deprecated, avoid use - ... For warning description see https://verilator.org/warn/DEPRECATED?v=latest - ... Use "/* verilator lint_off DEPRECATED */" and lint_on around source to disable this message. diff --git a/test_regress/t/t_flag_structs_packed.py b/test_regress/t/t_flag_structs_packed.py deleted file mode 100755 index 3db2135f9..000000000 --- a/test_regress/t/t_flag_structs_packed.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/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 vltest_bootstrap - -test.scenarios('linter') - -test.compile(verilator_flags2=['-Wno-fatal', '--structs-packed'], - expect_filename=test.golden_filename) - -test.execute() - -test.passes() diff --git a/test_regress/t/t_flag_structs_packed.v b/test_regress/t/t_flag_structs_packed.v deleted file mode 100644 index b1c8293f5..000000000 --- a/test_regress/t/t_flag_structs_packed.v +++ /dev/null @@ -1,21 +0,0 @@ -// DESCRIPTION: Verilator: Verilog Test module -// -// This file ONLY is placed under the Creative Commons Public Domain. -// SPDX-FileCopyrightText: 2009 Wilson Snyder -// SPDX-License-Identifier: CC0-1.0 - -module x; - - typedef struct {int a;} notpacked_t; - - typedef struct packed {notpacked_t b;} ispacked_t; - - ispacked_t p; - - initial begin - p.b = 1; - if (p.b != 1) $stop; - $write("*-* All Finished *-*\n"); - $finish; - end -endmodule diff --git a/test_regress/t/t_flag_structs_packed_bad.out b/test_regress/t/t_flag_structs_packed_bad.out deleted file mode 100644 index 815b967fa..000000000 --- a/test_regress/t/t_flag_structs_packed_bad.out +++ /dev/null @@ -1,6 +0,0 @@ -%Error: t/t_flag_structs_packed.v:11:38: Unpacked data type 'struct{}x.notpacked_t' in packed struct/union (IEEE 1800-2023 7.2.1) - : ... note: In instance 'x' - 11 | typedef struct packed {notpacked_t b;} ispacked_t; - | ^ - ... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance. -%Error: Exiting due to diff --git a/test_regress/t/t_flag_structs_packed_bad.py b/test_regress/t/t_flag_structs_packed_bad.py deleted file mode 100755 index e9f49f826..000000000 --- a/test_regress/t/t_flag_structs_packed_bad.py +++ /dev/null @@ -1,17 +0,0 @@ -#!/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 vltest_bootstrap - -test.scenarios('linter') -test.top_filename = "t/t_flag_structs_packed.v" - -test.lint(fails=test.vlt_all, expect_filename=test.golden_filename) - -test.passes()