From 9eafca5e28b95970805d7c436975eb9ac467ec58 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Thu, 17 Jun 2021 04:17:43 +0100 Subject: [PATCH] Remove deprecated --no-relative-cfuncs (#3024) --- Changes | 1 + bin/verilator | 1 - docs/guide/deprecations.rst | 4 -- docs/guide/exe_verilator.rst | 4 -- src/V3CCtors.cpp | 3 +- src/V3Descope.cpp | 9 +--- src/V3Options.cpp | 5 -- src/V3Options.h | 2 - .../t/t_inst_tree_inl0_pub1_norelcfuncs.pl | 52 ------------------- 9 files changed, 4 insertions(+), 77 deletions(-) delete mode 100755 test_regress/t/t_inst_tree_inl0_pub1_norelcfuncs.pl diff --git a/Changes b/Changes index 70f794f7e..4a9148a89 100644 --- a/Changes +++ b/Changes @@ -18,6 +18,7 @@ Verilator 4.205 devel **Minor:** +* Remove deprecated --no-relative-cfuncs option (#3024). [Geza Lore] * Merge const static data globally into a new constant pool (#3013). [Geza Lore] * Fix error on unsupported recursive functions (#2957). [Trefor Southwell] diff --git a/bin/verilator b/bin/verilator index 0b5f4b636..752412a3c 100755 --- a/bin/verilator +++ b/bin/verilator @@ -379,7 +379,6 @@ detailed descriptions of these arguments. -pvalue+= Overwrite toplevel parameter --quiet-exit Don't print the command on failure --relative-includes Resolve includes relative to current file - --no-relative-cfuncs Disallow 'this->' in generated functions --reloop-limit Minimum iterations for forming loops --report-unoptflat Extra diagnostics for UNOPTFLAT --rr Run Verilator and record with rr diff --git a/docs/guide/deprecations.rst b/docs/guide/deprecations.rst index ddb7546db..2bc811c1a 100644 --- a/docs/guide/deprecations.rst +++ b/docs/guide/deprecations.rst @@ -11,10 +11,6 @@ C++11 compiler support require C++14 or newer compilers for both compiling Verilator and compiling Verilated models no sooner than January 2022. -No-Relative-Cfuncs Option - The :vlopt:`--no-relative-cfuncs` option is not be required by any C++11 - compliant compiler and is planned for removal no sooner than July 2021. - Inhibit-Sim Option The :vlopt:`--inhibit-sim` option is planned for removal no sooner than July 2021. diff --git a/docs/guide/exe_verilator.rst b/docs/guide/exe_verilator.rst index 0fa6c7ab5..626a6575d 100644 --- a/docs/guide/exe_verilator.rst +++ b/docs/guide/exe_verilator.rst @@ -661,10 +661,6 @@ Summary: Backward compatible alias for :vlopt:`--pins-bv 33 <--pins-bv>`. -.. option:: --no-relative-cfuncs - - Deprecated. - .. option:: --no-skip-identical =item --skip-identical Rarely needed. Disables or enables skipping execution of Verilator if diff --git a/src/V3CCtors.cpp b/src/V3CCtors.cpp index ca8b6d31d..3cc1a9344 100644 --- a/src/V3CCtors.cpp +++ b/src/V3CCtors.cpp @@ -145,8 +145,7 @@ void V3CCtors::evalAsserts() { // if (signal & CONST(upper_non_clean_mask)) { fail; } AstVarRef* const vrefp = new AstVarRef(varp->fileline(), varp, VAccess::READ); - vrefp->selfPointer(v3Global.opt.relativeCFuncs() ? "this" - : "vlSymsp->TOPp"); + vrefp->selfPointer("this"); AstNode* newp = vrefp; if (varp->isWide()) { newp = new AstWordSel( diff --git a/src/V3Descope.cpp b/src/V3Descope.cpp index 44ba216d2..2cd49254d 100644 --- a/src/V3Descope.cpp +++ b/src/V3Descope.cpp @@ -74,15 +74,10 @@ private: string descopedSelfPointer(const AstScope* scopep) { UASSERT(scopep, "Var/Func not scoped"); - // It's possible to disable relative references. This is a concession - // to older compilers (gcc < 4.5.x) that don't understand __restrict__ - // well and emit extra ld/st to guard against pointer aliasing - // when this-> and vlSyms-> are mixed in the same function. - bool relativeRefOk = v3Global.opt.relativeCFuncs(); - // + // Whether to use relative references via 'this->' + bool relativeRefOk = true; // Static functions can't use this if (!m_allowThis) relativeRefOk = false; - // // Class methods need relative if (m_modp && VN_IS(m_modp, Class)) relativeRefOk = true; diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 8a5893a5b..dfc5ff830 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -1243,11 +1243,6 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char DECL_OPTION("-quiet-exit", OnOff, &m_quietExit); - DECL_OPTION("-relative-cfuncs", CbOnOff, [this, fl](bool flag) { - m_relativeCFuncs = flag; - if (!m_relativeCFuncs) - fl->v3warn(DEPRECATED, "Deprecated --no-relative-cfuncs, unnecessary with C++11."); - }); DECL_OPTION("-relative-includes", OnOff, &m_relativeIncludes); DECL_OPTION("-reloop-limit", CbVal, [this, fl](const char* valp) { m_reloopLimit = std::atoi(valp); diff --git a/src/V3Options.h b/src/V3Options.h index 3f33c90d3..af6e127b8 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -260,7 +260,6 @@ private: bool m_public = false; // main switch: --public bool m_publicFlatRW = false; // main switch: --public-flat-rw bool m_quietExit = false; // main switch: --quiet-exit - bool m_relativeCFuncs = true; // main switch: --relative-cfuncs bool m_relativeIncludes = false; // main switch: --relative-includes bool m_reportUnoptflat = false; // main switch: --report-unoptflat bool m_savable = false; // main switch: --savable @@ -473,7 +472,6 @@ public: bool ignc() const { return m_ignc; } bool inhibitSim() const { return m_inhibitSim; } bool quietExit() const { return m_quietExit; } - bool relativeCFuncs() const { return m_relativeCFuncs; } bool reportUnoptflat() const { return m_reportUnoptflat; } bool verilate() const { return m_verilate; } bool vpi() const { return m_vpi; } diff --git a/test_regress/t/t_inst_tree_inl0_pub1_norelcfuncs.pl b/test_regress/t/t_inst_tree_inl0_pub1_norelcfuncs.pl deleted file mode 100755 index 3e2ae31fc..000000000 --- a/test_regress/t/t_inst_tree_inl0_pub1_norelcfuncs.pl +++ /dev/null @@ -1,52 +0,0 @@ -#!/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_inst_tree.v"); - -compile( - verilator_flags2 => ['--stats', '-Wno-DEPRECATED', '--norelative-cfuncs', - "$Self->{t_dir}/t_inst_tree_inl0_pub1.vlt", - $Self->wno_unopthreads_for_few_cores()] - ); - -if ($Self->{vlt_all}) { - # Fewer optimizations than t_inst_tree_inl0_pub1 which allows - # relative CFuncs: - file_grep($Self->{stats}, qr/Optimizations, Combined CFuncs\s+(\d+)/i, - ($Self->{vltmt} ? 0 : 31)); - - # Should not find any 'this->' or 'vlSelf->' except some specific cases - my @files = `ls $Self->{obj_dir}/*.cpp`; - foreach my $file (@files) { - chomp $file; - my $text = file_contents($file); - $text =~ s/(vlSelf|this)->vlSymsp//g; - $text =~ s/vlSelf->.* = VL_RAND_RESET.*;//g; - $text =~ s/vlSelf->__Vm_even_cycle//g; - $text =~ s/vlSelf->__Vm_even_cycle//g; - $text =~ s/vlSelf->__Vm_mtaskstate_(final|\d+)//g; - $text =~ s/vlSelf->__Vm_threadPoolp//g; - if ($text =~ m/this->/ || $text =~ m/vlSelf->/) { - error("$file has unexpected this-> refs when --norelative-cfuncs"); - } - } -} - -execute( - check_finished => 1, - expect => -'\] (%m|.*t\.ps): Clocked -', - ); - -ok(1); -1;