From f68c16a5e650e85f1784f120179495d85c895e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Boro=C5=84ski?= <94375110+kboronski-ant@users.noreply.github.com> Date: Mon, 6 Mar 2023 13:43:58 +0100 Subject: [PATCH] Fix symbol entries when inheriting classes (#3995) (#3996) --- src/V3LinkDot.cpp | 2 ++ test_regress/t/t_class_extends_vsyment.pl | 17 +++++++++++++++++ test_regress/t/t_class_extends_vsyment.v | 15 +++++++++++++++ 3 files changed, 34 insertions(+) create mode 100755 test_regress/t/t_class_extends_vsyment.pl create mode 100644 test_regress/t/t_class_extends_vsyment.v diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index db591012f..94ac413fb 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -3362,6 +3362,8 @@ private: } } } + m_ds.m_dotSymp = m_curSymp; + iterateChildren(nodep); } // V3Width when determines types needs to find enum values and such diff --git a/test_regress/t/t_class_extends_vsyment.pl b/test_regress/t/t_class_extends_vsyment.pl new file mode 100755 index 000000000..8eeb2a6f6 --- /dev/null +++ b/test_regress/t/t_class_extends_vsyment.pl @@ -0,0 +1,17 @@ +#!/usr/bin/env perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2020 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(vlt => 1); + +compile( + ); + +ok(1); +1; diff --git a/test_regress/t/t_class_extends_vsyment.v b/test_regress/t/t_class_extends_vsyment.v new file mode 100644 index 000000000..ac17ba1cf --- /dev/null +++ b/test_regress/t/t_class_extends_vsyment.v @@ -0,0 +1,15 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed under the Creative Commons Public Domain, for +// any use, without warranty, 2022 by Antmicro Ltd. +// SPDX-License-Identifier: CC0-1.0 + +class Foo; +endclass + +class Bar extends Foo; + int m_field = get_1(); + function int get_1(); + return 1; + endfunction +endclass