From 2b2680770bf4223b65c3746177365a2df3631783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=80lex=20Torregrosa?= <78434679+atorregrosasmd@users.noreply.github.com> Date: Wed, 7 Apr 2021 15:55:11 +0200 Subject: [PATCH] Improve scope types in FST and VCD traces (#2805). --- include/verilated.cpp | 8 +- include/verilated.h | 2 +- include/verilated_fst_c.cpp | 29 ++++++- include/verilated_trace.h | 3 +- include/verilated_trace_defs.h | 42 ++++++++++ include/verilated_vcd_c.cpp | 19 +++-- src/V3EmitC.cpp | 2 +- src/V3TraceDecl.cpp | 30 ++++--- test_regress/driver.pl | 2 +- test_regress/t/t_interface_ref_trace.out | 40 +++++----- test_regress/t/t_interface_ref_trace_fst.out | 80 +++++++++---------- .../t/t_interface_ref_trace_fst_sc.out | 80 +++++++++---------- test_regress/t/t_trace_array_fst.out | 2 +- test_regress/t/t_trace_array_fst_sc.out | 2 +- .../t/t_trace_complex_structs_fst.out | 28 +++---- .../t/t_trace_complex_structs_fst_sc.out | 28 +++---- 16 files changed, 241 insertions(+), 156 deletions(-) create mode 100644 include/verilated_trace_defs.h diff --git a/include/verilated.cpp b/include/verilated.cpp index ce762726e..14949b740 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -2538,12 +2538,14 @@ void Verilated::debug(int level) VL_MT_SAFE { } } -const char* Verilated::catName(const char* n1, const char* n2, const char* delimiter) VL_MT_SAFE { +const char* Verilated::catName(const char* n1, const char* n2, int scopet, + const char* delimiter) VL_MT_SAFE { // Returns new'ed data // Used by symbol table creation to make module names static VL_THREAD_LOCAL char* t_strp = nullptr; static VL_THREAD_LOCAL size_t t_len = 0; - size_t newlen = std::strlen(n1) + std::strlen(n2) + std::strlen(delimiter) + 1; + size_t newlen + = std::strlen(n1) + std::strlen(n2) + std::strlen(delimiter) + (scopet > 0 ? 2 : 1); if (VL_UNLIKELY(!t_strp || newlen > t_len)) { if (t_strp) delete[] t_strp; t_strp = new char[newlen]; @@ -2551,6 +2553,8 @@ const char* Verilated::catName(const char* n1, const char* n2, const char* delim } char* dp = t_strp; for (const char* sp = n1; *sp;) *dp++ = *sp++; + // Add scope type + if (scopet) *dp++ = (char)(0x80 + scopet); for (const char* sp = delimiter; *sp;) *dp++ = *sp++; for (const char* sp = n2; *sp;) *dp++ = *sp++; *dp++ = '\0'; diff --git a/include/verilated.h b/include/verilated.h index 07a609e57..f9a15307c 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -841,7 +841,7 @@ public: public: // METHODS - INTERNAL USE ONLY (but public due to what uses it) // Internal: Create a new module name by concatenating two strings - static const char* catName(const char* n1, const char* n2, + static const char* catName(const char* n1, const char* n2, int scopet = 0, const char* delimiter = "."); // Returns static data // Internal: Throw signal assertion diff --git a/include/verilated_fst_c.cpp b/include/verilated_fst_c.cpp index ca7ab3495..79b209c2e 100644 --- a/include/verilated_fst_c.cpp +++ b/include/verilated_fst_c.cpp @@ -51,6 +51,24 @@ // clang-format on +//============================================================================= +// Check that vltscope_t matches fstScopeType +static_assert((int)FST_ST_VCD_MODULE == (int)VLT_TRACE_SCOPE_MODULE, "VLT_TRACE_SCOPE_MODULE mismatches"); +static_assert((int)FST_ST_VCD_TASK == (int)VLT_TRACE_SCOPE_TASK, "VLT_TRACE_SCOPE_TASK mismatches"); +static_assert((int)FST_ST_VCD_FUNCTION == (int)VLT_TRACE_SCOPE_FUNCTION, + "VLT_TRACE_SCOPE_FUNCTION mismatches"); +static_assert((int)FST_ST_VCD_BEGIN == (int)VLT_TRACE_SCOPE_BEGIN, "VLT_TRACE_SCOPE_BEGIN mismatches"); +static_assert((int)FST_ST_VCD_FORK == (int)VLT_TRACE_SCOPE_FORK, "VLT_TRACE_SCOPE_FORK mismatches"); +static_assert((int)FST_ST_VCD_GENERATE == (int)VLT_TRACE_SCOPE_GENERATE, + "VLT_TRACE_SCOPE_GENERATE mismatches"); +static_assert((int)FST_ST_VCD_STRUCT == (int)VLT_TRACE_SCOPE_STRUCT, "VLT_TRACE_SCOPE_STRUCT mismatches"); +static_assert((int)FST_ST_VCD_UNION == (int)VLT_TRACE_SCOPE_UNION, "VLT_TRACE_SCOPE_UNION mismatches"); +static_assert((int)FST_ST_VCD_CLASS == (int)VLT_TRACE_SCOPE_CLASS, "VLT_TRACE_SCOPE_CLASS mismatches"); +static_assert((int)FST_ST_VCD_INTERFACE == (int)VLT_TRACE_SCOPE_INTERFACE, + "VLT_TRACE_SCOPE_INTERFACE mismatches"); +static_assert((int)FST_ST_VCD_PACKAGE == (int)VLT_TRACE_SCOPE_PACKAGE, "VLT_TRACE_SCOPE_PACKAGE mismatches"); +static_assert((int)FST_ST_VCD_PROGRAM == (int)VLT_TRACE_SCOPE_PROGRAM, "VLT_TRACE_SCOPE_PROGRAM mismatches"); + //============================================================================= // Specialization of the generics for this trace format @@ -140,6 +158,7 @@ void VerilatedFst::declare(vluint32_t code, const char* name, int dtypenum, fstV std::string symbol_name(tokens.back()); tokens.pop_back(); // Remove symbol name from hierarchy tokens.insert(tokens.begin(), moduleName()); // Add current module to the hierarchy + std::string tmpModName; // Find point where current and new scope diverge auto cur_it = m_curScope.begin(); @@ -158,7 +177,15 @@ void VerilatedFst::declare(vluint32_t code, const char* name, int dtypenum, fstV // Follow the hierarchy of the new variable from the common scope point while (new_it != tokens.end()) { - fstWriterSetScope(m_fst, FST_ST_VCD_SCOPE, new_it->c_str(), nullptr); + if ((new_it->back() & 0x80)) { + tmpModName = *new_it; + tmpModName.pop_back(); + // If the scope ends with a non-ascii character, it will be 0x80 + fstScopeType + fstWriterSetScope(m_fst, (fstScopeType)(new_it->back() & 0x7f), tmpModName.c_str(), + nullptr); + } else + fstWriterSetScope(m_fst, FST_ST_VCD_SCOPE, new_it->c_str(), nullptr); + m_curScope.push_back(*new_it); new_it = tokens.erase(new_it); } diff --git a/include/verilated_trace.h b/include/verilated_trace.h index bdfed6f85..db3b71efc 100644 --- a/include/verilated_trace.h +++ b/include/verilated_trace.h @@ -25,6 +25,7 @@ // clang-format off #include "verilated.h" +#include "verilated_trace_defs.h" #include #include @@ -225,7 +226,7 @@ protected: void declCode(vluint32_t code, vluint32_t bits, bool tri); // Is this an escape? - bool isScopeEscape(char c) { return c != '\f' && (std::isspace(c) || c == m_scopeEscape); } + bool isScopeEscape(char c) { return std::isspace(c) || c == m_scopeEscape; } // Character that splits scopes. Note whitespace are ALWAYS escapes. char scopeEscape() { return m_scopeEscape; } diff --git a/include/verilated_trace_defs.h b/include/verilated_trace_defs.h new file mode 100644 index 000000000..69290c148 --- /dev/null +++ b/include/verilated_trace_defs.h @@ -0,0 +1,42 @@ +// -*- mode: C++; c-file-style: "cc-mode" -*- +//============================================================================= +// +// Code available from: https://verilator.org +// +// Copyright 2001-2021 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 +// +//============================================================================= +/// +/// \file +/// \brief Verilated tracing types +/// +/// This file is not part of the Verilated public-facing API. +/// It is only for internal use by Verilated tracing routines. +/// +//============================================================================= +#ifndef VERILATOR_VERILATED_TRACE_DEFS_H_ +#define VERILATOR_VERILATED_TRACE_DEFS_H_ + +// Verilator tracing scope types: +// The values should match FST_ST_VCD_* from fstScopeType in gtkwave/fstapi.h +// verilated_fst_c.cpp contains assertions to enforce this +enum VltTraceScope { + VLT_TRACE_SCOPE_MODULE = 0, + VLT_TRACE_SCOPE_TASK = 1, + VLT_TRACE_SCOPE_FUNCTION = 2, + VLT_TRACE_SCOPE_BEGIN = 3, + VLT_TRACE_SCOPE_FORK = 4, + VLT_TRACE_SCOPE_GENERATE = 5, + VLT_TRACE_SCOPE_STRUCT = 6, + VLT_TRACE_SCOPE_UNION = 7, + VLT_TRACE_SCOPE_CLASS = 8, + VLT_TRACE_SCOPE_INTERFACE = 9, + VLT_TRACE_SCOPE_PACKAGE = 10, + VLT_TRACE_SCOPE_PROGRAM = 11 +}; + +#endif // guard diff --git a/include/verilated_vcd_c.cpp b/include/verilated_vcd_c.cpp index 796e742a1..e11ed947d 100644 --- a/include/verilated_vcd_c.cpp +++ b/include/verilated_vcd_c.cpp @@ -419,20 +419,25 @@ void VerilatedVcd::dumpHeader() { printIndent(1); // Find character after name end const char* sp = np; - while (*sp && *sp != ' ' && *sp != '\t' && *sp != '\f') sp++; + while (*sp && *sp != ' ' && *sp != '\t' && !(*sp & '\x80')) sp++; - if (*sp == '\f') { - printStr("$scope struct "); - } else { - printStr("$scope module "); - } + printStr("$scope "); + if (*sp & '\x80') { + switch (*sp & 0x7f) { + case VLT_TRACE_SCOPE_STRUCT: printStr("struct "); break; + case VLT_TRACE_SCOPE_INTERFACE: printStr("interface "); break; + case VLT_TRACE_SCOPE_UNION: printStr("union "); break; + default: printStr("module "); + } + } else + printStr("module "); for (; *np && *np != ' ' && *np != '\t'; np++) { if (*np == '[') { printStr("("); } else if (*np == ']') { printStr(")"); - } else if (*np != '\f') { + } else if (!(*np & '\x80')) { *m_writep++ = *np; } } diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index a83efb16b..48ad6de4a 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -3606,7 +3606,7 @@ class EmitCTrace final : EmitCStmts { puts(","); if (nodep->isScoped()) puts("Verilated::catName(scopep,"); putsQuoted(VIdProtect::protectWordsIf(nodep->showname(), nodep->protect())); - if (nodep->isScoped()) puts(",\" \")"); + if (nodep->isScoped()) puts(",(int)scopet,\" \")"); // Direction if (v3Global.opt.traceFormat().fst()) { puts("," + cvtToStr(enumNum)); diff --git a/src/V3TraceDecl.cpp b/src/V3TraceDecl.cpp index 22d0b2cfe..248fffec4 100644 --- a/src/V3TraceDecl.cpp +++ b/src/V3TraceDecl.cpp @@ -22,6 +22,7 @@ #include "config_build.h" #include "verilatedos.h" +#include "verilated_trace_defs.h" // For VLT_TRACE_SCOPE_* #include "V3Global.h" #include "V3TraceDecl.h" @@ -72,7 +73,7 @@ private: FileLine* const flp = m_topScopep->fileline(); AstCFunc* const funcp = new AstCFunc(flp, name, m_topScopep); string argTypes("void* userp, " + v3Global.opt.traceClassBase() + "* tracep"); - if (m_interface) argTypes += ", const char* scopep"; + if (m_interface) argTypes += ", int scopet, const char* scopep"; funcp->argTypes(argTypes); funcp->funcType(type); funcp->symProlog(true); @@ -84,8 +85,12 @@ private: } void callCFuncSub(AstCFunc* basep, AstCFunc* funcp, AstIntfRef* irp) { AstCCall* callp = new AstCCall(funcp->fileline(), funcp); - callp->argTypes("userp, tracep"); - if (irp) callp->addArgsp(irp->unlinkFrBack()); + if (irp) { + callp->argTypes("userp, tracep, VLT_TRACE_SCOPE_INTERFACE"); + callp->addArgsp(irp->unlinkFrBack()); + } else { + callp->argTypes("userp, tracep"); + } basep->addStmtsp(callp); } AstCFunc* newCFuncSub(AstCFunc* basep) { @@ -94,6 +99,9 @@ private: if (!m_interface) callCFuncSub(basep, funcp, nullptr); return funcp; } + + std::string getScopeChar(VltTraceScope sct) { return std::string(1, (char)(0x80 + sct)); } + void addTraceDecl(const VNumRange& arrayRange, int widthOverride) { // If !=0, is packed struct/array where basicp size // misreflects one element @@ -295,16 +303,12 @@ private: VL_RESTORER(m_traShowname); VL_RESTORER(m_traValuep); { - // Add @ to mark as struct - // Since it is not a valid symbol for verilog variable names, no - // collision should happen - if (v3Global.opt.traceFormat().fst()) { - m_traShowname += string(" ") + itemp->prettyName(); - } else { - m_traShowname += string("\f ") + itemp->prettyName(); - } - if (VN_IS(nodep, StructDType)) { + // Mark scope as a struct by setting the last char to 0x80 + the + // fstScopeType + m_traShowname + += getScopeChar(VLT_TRACE_SCOPE_STRUCT) + " " + itemp->prettyName(); + m_traValuep = new AstSel(nodep->fileline(), m_traValuep->cloneTree(true), itemp->lsb(), subtypep->width()); @@ -312,6 +316,8 @@ private: iterate(subtypep); VL_DO_CLEAR(m_traValuep->deleteTree(), m_traValuep = nullptr); } else { // Else union, replicate fields + m_traShowname + += getScopeChar(VLT_TRACE_SCOPE_UNION) + " " + itemp->prettyName(); iterate(subtypep); } } diff --git a/test_regress/driver.pl b/test_regress/driver.pl index aceaed76a..c33ebb2bb 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -2273,7 +2273,7 @@ sub _vcd_read { my @hier = ($data); my $lasthier; while (defined(my $line = $fh->getline)) { - if ($line =~ /\$scope (module|struct)\s+(\S+)/) { + if ($line =~ /\$scope (module|struct|interface)\s+(\S+)/) { $hier[$#hier]->{$1} ||= {}; push @hier, $hier[$#hier]->{$1}; $lasthier = $hier[$#hier]; diff --git a/test_regress/t/t_interface_ref_trace.out b/test_regress/t/t_interface_ref_trace.out index b9de5a2a5..67a6e327b 100644 --- a/test_regress/t/t_interface_ref_trace.out +++ b/test_regress/t/t_interface_ref_trace.out @@ -10,7 +10,7 @@ $timescale 1ps $end $var wire 32 # cyc [31:0] $end $scope module a $end $scope module ac1 $end - $scope module intf_for_check $end + $scope interface intf_for_check $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 $ value [31:0] $end @@ -21,7 +21,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module ac2 $end - $scope module intf_for_check $end + $scope interface intf_for_check $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 ' value [31:0] $end @@ -32,7 +32,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module ac3 $end - $scope module intf_for_check $end + $scope interface intf_for_check $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 * value [31:0] $end @@ -43,7 +43,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module as3 $end - $scope module intf_for_struct $end + $scope interface intf_for_struct $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 * value [31:0] $end @@ -53,7 +53,7 @@ $timescale 1ps $end $upscope $end $upscope $end $upscope $end - $scope module intf_in_sub_all $end + $scope interface intf_in_sub_all $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 * value [31:0] $end @@ -62,7 +62,7 @@ $timescale 1ps $end $var wire 32 , val200 [31:0] $end $upscope $end $upscope $end - $scope module intf_one $end + $scope interface intf_one $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 $ value [31:0] $end @@ -71,7 +71,7 @@ $timescale 1ps $end $var wire 32 & val200 [31:0] $end $upscope $end $upscope $end - $scope module intf_two $end + $scope interface intf_two $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 ' value [31:0] $end @@ -83,7 +83,7 @@ $timescale 1ps $end $upscope $end $scope module abcdefghijklmnopqrstuvwxyz $end $scope module ac1 $end - $scope module intf_for_check $end + $scope interface intf_for_check $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 ' value [31:0] $end @@ -94,7 +94,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module ac2 $end - $scope module intf_for_check $end + $scope interface intf_for_check $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 $ value [31:0] $end @@ -105,7 +105,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module ac3 $end - $scope module intf_for_check $end + $scope interface intf_for_check $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 - value [31:0] $end @@ -116,7 +116,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module as3 $end - $scope module intf_for_struct $end + $scope interface intf_for_struct $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 - value [31:0] $end @@ -126,7 +126,7 @@ $timescale 1ps $end $upscope $end $upscope $end $upscope $end - $scope module intf_in_sub_all $end + $scope interface intf_in_sub_all $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 - value [31:0] $end @@ -135,7 +135,7 @@ $timescale 1ps $end $var wire 32 / val200 [31:0] $end $upscope $end $upscope $end - $scope module intf_one $end + $scope interface intf_one $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 ' value [31:0] $end @@ -144,7 +144,7 @@ $timescale 1ps $end $var wire 32 ) val200 [31:0] $end $upscope $end $upscope $end - $scope module intf_two $end + $scope interface intf_two $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 $ value [31:0] $end @@ -155,7 +155,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module c1 $end - $scope module intf_for_check $end + $scope interface intf_for_check $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 $ value [31:0] $end @@ -166,7 +166,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module c2 $end - $scope module intf_for_check $end + $scope interface intf_for_check $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 ' value [31:0] $end @@ -176,7 +176,7 @@ $timescale 1ps $end $upscope $end $upscope $end $upscope $end - $scope module intf_1 $end + $scope interface intf_1 $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 $ value [31:0] $end @@ -185,7 +185,7 @@ $timescale 1ps $end $var wire 32 & val200 [31:0] $end $upscope $end $upscope $end - $scope module intf_2 $end + $scope interface intf_2 $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 ' value [31:0] $end @@ -195,7 +195,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module s1 $end - $scope module intf_for_struct $end + $scope interface intf_for_struct $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 $ value [31:0] $end @@ -206,7 +206,7 @@ $timescale 1ps $end $upscope $end $upscope $end $scope module s2 $end - $scope module intf_for_struct $end + $scope interface intf_for_struct $end $var wire 1 0 clk $end $var wire 32 # cyc [31:0] $end $var wire 32 ' value [31:0] $end diff --git a/test_regress/t/t_interface_ref_trace_fst.out b/test_regress/t/t_interface_ref_trace_fst.out index 7ccec6303..ffe8c0410 100644 --- a/test_regress/t/t_interface_ref_trace_fst.out +++ b/test_regress/t/t_interface_ref_trace_fst.out @@ -13,53 +13,53 @@ $var wire 1 ! clk $end $scope module t $end $var wire 1 ! clk $end $var integer 32 " cyc $end -$scope module intf_1 $end +$scope interface intf_1 $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $scope module s1 $end -$scope module intf_for_struct $end +$scope interface intf_for_struct $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $upscope $end $scope module c1 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $upscope $end $scope module a $end -$scope module intf_one $end +$scope interface intf_one $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $scope module ac1 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end @@ -67,74 +67,74 @@ $upscope $end $upscope $end $upscope $end $scope module abcdefghijklmnopqrstuvwxyz $end -$scope module intf_two $end +$scope interface intf_two $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $scope module ac2 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $upscope $end $upscope $end -$scope module intf_2 $end +$scope interface intf_2 $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $scope module s2 $end -$scope module intf_for_struct $end +$scope interface intf_for_struct $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $upscope $end $scope module c2 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $upscope $end $scope module a $end -$scope module intf_two $end +$scope interface intf_two $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $scope module ac2 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end @@ -142,21 +142,21 @@ $upscope $end $upscope $end $upscope $end $scope module abcdefghijklmnopqrstuvwxyz $end -$scope module intf_one $end +$scope interface intf_one $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $scope module ac1 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end @@ -164,32 +164,32 @@ $upscope $end $upscope $end $upscope $end $scope module a $end -$scope module intf_in_sub_all $end +$scope interface intf_in_sub_all $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 ) value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 * val100 $end $var logic 32 + val200 $end $upscope $end $upscope $end $scope module as3 $end -$scope module intf_for_struct $end +$scope interface intf_for_struct $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 ) value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 * val100 $end $var logic 32 + val200 $end $upscope $end $upscope $end $upscope $end $scope module ac3 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 ) value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 * val100 $end $var logic 32 + val200 $end $upscope $end @@ -197,32 +197,32 @@ $upscope $end $upscope $end $upscope $end $scope module abcdefghijklmnopqrstuvwxyz $end -$scope module intf_in_sub_all $end +$scope interface intf_in_sub_all $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 , value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 - val100 $end $var logic 32 . val200 $end $upscope $end $upscope $end $scope module as3 $end -$scope module intf_for_struct $end +$scope interface intf_for_struct $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 , value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 - val100 $end $var logic 32 . val200 $end $upscope $end $upscope $end $upscope $end $scope module ac3 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 , value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 - val100 $end $var logic 32 . val200 $end $upscope $end diff --git a/test_regress/t/t_interface_ref_trace_fst_sc.out b/test_regress/t/t_interface_ref_trace_fst_sc.out index 48b2e47ab..753dc7847 100644 --- a/test_regress/t/t_interface_ref_trace_fst_sc.out +++ b/test_regress/t/t_interface_ref_trace_fst_sc.out @@ -12,53 +12,53 @@ $scope module top $end $scope module t $end $var wire 1 ! clk $end $var integer 32 " cyc $end -$scope module intf_1 $end +$scope interface intf_1 $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $scope module s1 $end -$scope module intf_for_struct $end +$scope interface intf_for_struct $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $upscope $end $scope module c1 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $upscope $end $scope module a $end -$scope module intf_one $end +$scope interface intf_one $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $scope module ac1 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end @@ -66,74 +66,74 @@ $upscope $end $upscope $end $upscope $end $scope module abcdefghijklmnopqrstuvwxyz $end -$scope module intf_two $end +$scope interface intf_two $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $scope module ac2 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 # value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 $ val100 $end $var logic 32 % val200 $end $upscope $end $upscope $end $upscope $end $upscope $end -$scope module intf_2 $end +$scope interface intf_2 $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $scope module s2 $end -$scope module intf_for_struct $end +$scope interface intf_for_struct $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $upscope $end $scope module c2 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $upscope $end $scope module a $end -$scope module intf_two $end +$scope interface intf_two $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $scope module ac2 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end @@ -141,21 +141,21 @@ $upscope $end $upscope $end $upscope $end $scope module abcdefghijklmnopqrstuvwxyz $end -$scope module intf_one $end +$scope interface intf_one $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end $upscope $end $scope module ac1 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 & value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 ' val100 $end $var logic 32 ( val200 $end $upscope $end @@ -163,32 +163,32 @@ $upscope $end $upscope $end $upscope $end $scope module a $end -$scope module intf_in_sub_all $end +$scope interface intf_in_sub_all $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 ) value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 * val100 $end $var logic 32 + val200 $end $upscope $end $upscope $end $scope module as3 $end -$scope module intf_for_struct $end +$scope interface intf_for_struct $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 ) value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 * val100 $end $var logic 32 + val200 $end $upscope $end $upscope $end $upscope $end $scope module ac3 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 ) value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 * val100 $end $var logic 32 + val200 $end $upscope $end @@ -196,32 +196,32 @@ $upscope $end $upscope $end $upscope $end $scope module abcdefghijklmnopqrstuvwxyz $end -$scope module intf_in_sub_all $end +$scope interface intf_in_sub_all $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 , value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 - val100 $end $var logic 32 . val200 $end $upscope $end $upscope $end $scope module as3 $end -$scope module intf_for_struct $end +$scope interface intf_for_struct $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 , value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 - val100 $end $var logic 32 . val200 $end $upscope $end $upscope $end $upscope $end $scope module ac3 $end -$scope module intf_for_check $end +$scope interface intf_for_check $end $var wire 1 ! clk $end $var wire 32 " cyc $end $var integer 32 , value $end -$scope module the_struct $end +$scope struct the_struct $end $var logic 32 - val100 $end $var logic 32 . val200 $end $upscope $end diff --git a/test_regress/t/t_trace_array_fst.out b/test_regress/t/t_trace_array_fst.out index 52b55a782..9c1c6afd6 100644 --- a/test_regress/t/t_trace_array_fst.out +++ b/test_regress/t/t_trace_array_fst.out @@ -13,7 +13,7 @@ $var wire 1 ! clk $end $scope module t $end $var wire 1 ! clk $end $var integer 32 " cyc $end -$scope module biggie $end +$scope struct biggie $end $var logic 1048577 # d $end $upscope $end $upscope $end diff --git a/test_regress/t/t_trace_array_fst_sc.out b/test_regress/t/t_trace_array_fst_sc.out index 7a218ecd0..51dbb33a9 100644 --- a/test_regress/t/t_trace_array_fst_sc.out +++ b/test_regress/t/t_trace_array_fst_sc.out @@ -12,7 +12,7 @@ $scope module top $end $scope module t $end $var wire 1 ! clk $end $var integer 32 " cyc $end -$scope module biggie $end +$scope struct biggie $end $var logic 1048577 # d $end $upscope $end $upscope $end diff --git a/test_regress/t/t_trace_complex_structs_fst.out b/test_regress/t/t_trace_complex_structs_fst.out index 3e0bcd6f8..48f9b2fed 100644 --- a/test_regress/t/t_trace_complex_structs_fst.out +++ b/test_regress/t/t_trace_complex_structs_fst.out @@ -13,26 +13,26 @@ $var wire 1 ! clk $end $scope module t $end $var wire 1 ! clk $end $var integer 32 " cyc $end -$scope module v_strp $end +$scope struct v_strp $end $var logic 1 # b1 $end $var logic 1 $ b0 $end $upscope $end -$scope module v_strp_strp $end -$scope module x1 $end +$scope struct v_strp_strp $end +$scope struct x1 $end $var logic 1 % b1 $end $var logic 1 & b0 $end $upscope $end -$scope module x0 $end +$scope struct x0 $end $var logic 1 ' b1 $end $var logic 1 ( b0 $end $upscope $end $upscope $end -$scope module v_unip_strp $end -$scope module x1 $end +$scope union v_unip_strp $end +$scope struct x1 $end $var logic 1 ) b1 $end $var logic 1 * b0 $end $upscope $end -$scope module x0 $end +$scope struct x0 $end $var logic 1 ) b1 $end $var logic 1 * b0 $end $upscope $end @@ -40,11 +40,11 @@ $upscope $end $var logic 2 + v_arrp $end $var logic 2 , v_arrp_arrp(3) $end $var logic 2 - v_arrp_arrp(4) $end -$scope module v_arrp_strp(3) $end +$scope struct v_arrp_strp(3) $end $var logic 1 . b1 $end $var logic 1 / b0 $end $upscope $end -$scope module v_arrp_strp(4) $end +$scope struct v_arrp_strp(4) $end $var logic 1 0 b1 $end $var logic 1 1 b0 $end $upscope $end @@ -56,21 +56,21 @@ $var logic 1 6 v_arru_arru(4)(1) $end $var logic 1 7 v_arru_arru(4)(2) $end $var logic 2 8 v_arru_arrp(3) $end $var logic 2 9 v_arru_arrp(4) $end -$scope module v_arru_strp(3) $end +$scope struct v_arru_strp(3) $end $var logic 1 : b1 $end $var logic 1 ; b0 $end $upscope $end -$scope module v_arru_strp(4) $end +$scope struct v_arru_strp(4) $end $var logic 1 < b1 $end $var logic 1 = b0 $end $upscope $end $var real 64 > v_real $end $var real 64 ? v_arr_real(0) $end $var real 64 @ v_arr_real(1) $end -$scope module v_str32x2(0) $end +$scope struct v_str32x2(0) $end $var logic 32 A data $end $upscope $end -$scope module v_str32x2(1) $end +$scope struct v_str32x2(1) $end $var logic 32 B data $end $attrbegin misc 07 t.enumed_t 4 ZERO ONE TWO THREE 00000000000000000000000000000000 00000000000000000000000000000001 00000000000000000000000000000010 00000000000000000000000000000011 1 $end $upscope $end @@ -81,7 +81,7 @@ $var logic 32 D v_enumed2 $end $attrbegin misc 07 t.enumb_t 4 BZERO BONE BTWO BTHREE 000 001 010 011 2 $end $attrbegin misc 07 "" 2 $end $var logic 3 E v_enumb $end -$scope module v_enumb2_str $end +$scope struct v_enumb2_str $end $attrbegin misc 07 "" 2 $end $var logic 3 F a $end $attrbegin misc 07 "" 2 $end diff --git a/test_regress/t/t_trace_complex_structs_fst_sc.out b/test_regress/t/t_trace_complex_structs_fst_sc.out index ac1a62444..d666dae4d 100644 --- a/test_regress/t/t_trace_complex_structs_fst_sc.out +++ b/test_regress/t/t_trace_complex_structs_fst_sc.out @@ -12,26 +12,26 @@ $scope module top $end $scope module t $end $var wire 1 ! clk $end $var integer 32 " cyc $end -$scope module v_strp $end +$scope struct v_strp $end $var logic 1 # b1 $end $var logic 1 $ b0 $end $upscope $end -$scope module v_strp_strp $end -$scope module x1 $end +$scope struct v_strp_strp $end +$scope struct x1 $end $var logic 1 % b1 $end $var logic 1 & b0 $end $upscope $end -$scope module x0 $end +$scope struct x0 $end $var logic 1 ' b1 $end $var logic 1 ( b0 $end $upscope $end $upscope $end -$scope module v_unip_strp $end -$scope module x1 $end +$scope union v_unip_strp $end +$scope struct x1 $end $var logic 1 ) b1 $end $var logic 1 * b0 $end $upscope $end -$scope module x0 $end +$scope struct x0 $end $var logic 1 ) b1 $end $var logic 1 * b0 $end $upscope $end @@ -39,11 +39,11 @@ $upscope $end $var logic 2 + v_arrp $end $var logic 2 , v_arrp_arrp(3) $end $var logic 2 - v_arrp_arrp(4) $end -$scope module v_arrp_strp(3) $end +$scope struct v_arrp_strp(3) $end $var logic 1 . b1 $end $var logic 1 / b0 $end $upscope $end -$scope module v_arrp_strp(4) $end +$scope struct v_arrp_strp(4) $end $var logic 1 0 b1 $end $var logic 1 1 b0 $end $upscope $end @@ -55,21 +55,21 @@ $var logic 1 6 v_arru_arru(4)(1) $end $var logic 1 7 v_arru_arru(4)(2) $end $var logic 2 8 v_arru_arrp(3) $end $var logic 2 9 v_arru_arrp(4) $end -$scope module v_arru_strp(3) $end +$scope struct v_arru_strp(3) $end $var logic 1 : b1 $end $var logic 1 ; b0 $end $upscope $end -$scope module v_arru_strp(4) $end +$scope struct v_arru_strp(4) $end $var logic 1 < b1 $end $var logic 1 = b0 $end $upscope $end $var real 64 > v_real $end $var real 64 ? v_arr_real(0) $end $var real 64 @ v_arr_real(1) $end -$scope module v_str32x2(0) $end +$scope struct v_str32x2(0) $end $var logic 32 A data $end $upscope $end -$scope module v_str32x2(1) $end +$scope struct v_str32x2(1) $end $var logic 32 B data $end $attrbegin misc 07 t.enumed_t 4 ZERO ONE TWO THREE 00000000000000000000000000000000 00000000000000000000000000000001 00000000000000000000000000000010 00000000000000000000000000000011 1 $end $upscope $end @@ -80,7 +80,7 @@ $var logic 32 D v_enumed2 $end $attrbegin misc 07 t.enumb_t 4 BZERO BONE BTWO BTHREE 000 001 010 011 2 $end $attrbegin misc 07 "" 2 $end $var logic 3 E v_enumb $end -$scope module v_enumb2_str $end +$scope struct v_enumb2_str $end $attrbegin misc 07 "" 2 $end $var logic 3 F a $end $attrbegin misc 07 "" 2 $end