diff --git a/tools/netlist/include/Netlist.h b/tools/netlist/include/Netlist.h index 7a2c7a097..202df52a1 100644 --- a/tools/netlist/include/Netlist.h +++ b/tools/netlist/include/Netlist.h @@ -67,7 +67,7 @@ struct VariableSelectorBase { /// A variable selector representing an element selector. struct VariableElementSelect : public VariableSelectorBase { - const ast::Expression &expr; + const ast::Expression& expr; ConstantValue index; VariableElementSelect(ast::Expression const& expr, ConstantValue index) : @@ -78,9 +78,7 @@ struct VariableElementSelect : public VariableSelectorBase { return otherKind == VariableSelectorKind::ElementSelect; } - bool indexIsConstant() const { - return !index.bad(); - } + bool indexIsConstant() const { return !index.bad(); } int32_t getIndexInt() const { auto intValue = index.integer().as(); @@ -89,17 +87,18 @@ struct VariableElementSelect : public VariableSelectorBase { } std::string toString() const override { - if (indexIsConstant()) { - return fmt::format("[{}]", index.toString()); - } else { - return fmt::format("[{}]", expr.syntax->toString()); - } + if (indexIsConstant()) { + return fmt::format("[{}]", index.toString()); + } + else { + return fmt::format("[{}]", expr.syntax->toString()); + } } }; /// A variable selector representing a range selector. struct VariableRangeSelect : public VariableSelectorBase { - const ast::RangeSelectExpression &expr; + const ast::RangeSelectExpression& expr; ConstantValue leftIndex, rightIndex; VariableRangeSelect(ast::RangeSelectExpression const& expr, ConstantValue leftIndex, @@ -111,13 +110,9 @@ struct VariableRangeSelect : public VariableSelectorBase { return otherKind == VariableSelectorKind::RangeSelect; } - bool leftIndexIsConstant() const { - return !leftIndex.bad(); - } + bool leftIndexIsConstant() const { return !leftIndex.bad(); } - bool rightIndexIsConstant() const { - return !rightIndex.bad(); - } + bool rightIndexIsConstant() const { return !rightIndex.bad(); } int32_t getLeftIndexInt() const { auto intValue = leftIndex.integer().as(); @@ -134,25 +129,27 @@ struct VariableRangeSelect : public VariableSelectorBase { std::string toString() const override { std::string left; if (leftIndexIsConstant()) { - left = leftIndex.toString(); - } else { - left = expr.left().syntax->toString(); + left = leftIndex.toString(); + } + else { + left = expr.left().syntax->toString(); } std::string right; if (rightIndexIsConstant()) { - right = rightIndex.toString(); - } else { - right = expr.right().syntax->toString(); + right = rightIndex.toString(); + } + else { + right = expr.right().syntax->toString(); } switch (expr.getSelectionKind()) { - case ast::RangeSelectionKind::Simple: - return fmt::format("[{}:{}]", left, right); - case ast::RangeSelectionKind::IndexedUp: - return fmt::format("[{}+:{}]", left, right); - case ast::RangeSelectionKind::IndexedDown: - return fmt::format("[{}-:{}]", left, right); - default: - SLANG_UNREACHABLE; + case ast::RangeSelectionKind::Simple: + return fmt::format("[{}:{}]", left, right); + case ast::RangeSelectionKind::IndexedUp: + return fmt::format("[{}+:{}]", left, right); + case ast::RangeSelectionKind::IndexedDown: + return fmt::format("[{}-:{}]", left, right); + default: + SLANG_UNREACHABLE; } } }; @@ -271,12 +268,12 @@ class NetlistVariableReference : public NetlistNode { NetlistNode(NodeKind::VariableReference, symbol), expression(expr), leftOperand(leftOperand) {} - void addElementSelect(ast::ElementSelectExpression const &expr, const ConstantValue& index) { + void addElementSelect(ast::ElementSelectExpression const& expr, const ConstantValue& index) { selectors.emplace_back(std::make_unique(expr.selector(), index)); } - void addRangeSelect(ast::RangeSelectExpression const& expr, - const ConstantValue& leftIndex, const ConstantValue& rightIndex) { + void addRangeSelect(ast::RangeSelectExpression const& expr, const ConstantValue& leftIndex, + const ConstantValue& rightIndex) { selectors.emplace_back(std::make_unique(expr, leftIndex, rightIndex)); } @@ -300,11 +297,12 @@ class NetlistVariableReference : public NetlistNode { /// Return a string representation of this variable reference. std::string toString() const { - if (selectors.empty()) { - return fmt::format("{}", getName()); - } else { - return fmt::format("{}{}", getName(), selectorString()); - } + if (selectors.empty()) { + return fmt::format("{}", getName()); + } + else { + return fmt::format("{}{}", getName(), selectorString()); + } } public: diff --git a/tools/netlist/include/NetlistVisitor.h b/tools/netlist/include/NetlistVisitor.h index 62b4badea..1e9b142d6 100644 --- a/tools/netlist/include/NetlistVisitor.h +++ b/tools/netlist/include/NetlistVisitor.h @@ -43,16 +43,14 @@ static void connectDeclToVar(Netlist& netlist, NetlistNode& declNode, const std::string& hierarchicalPath) { auto* varNode = netlist.lookupVariable(hierarchicalPath); netlist.addEdge(*varNode, declNode); - DEBUG_PRINT( - fmt::format("Edge decl {} to ref {}\n", varNode->getName(), declNode.getName())); + DEBUG_PRINT(fmt::format("Edge decl {} to ref {}\n", varNode->getName(), declNode.getName())); } static void connectVarToDecl(Netlist& netlist, NetlistNode& varNode, const std::string& hierarchicalPath) { auto* declNode = netlist.lookupVariable(hierarchicalPath); netlist.addEdge(varNode, *declNode); - DEBUG_PRINT( - fmt::format("Edge ref {} to decl {}\n", varNode.getName(), declNode->getName())); + DEBUG_PRINT(fmt::format("Edge ref {} to decl {}\n", varNode.getName(), declNode->getName())); } static void connectVarToVar(Netlist& netlist, NetlistNode& sourceVarNode, @@ -73,9 +71,9 @@ class VariableReferenceVisitor : public ast::ASTVisitor getTypeBitWidthImpl(slang::ast::Type const& type) { size_t fixedSize = type.getBitWidth(); @@ -55,24 +54,24 @@ class AnalyseVariableReference { /// Return the bit width of a slang type, treating unpacked arrays as /// as if they were packed. - int32_t getTypeBitWidth(slang::ast::Type const &type) { - auto [multiplierElem, fixedSizeElem] = getTypeBitWidthImpl(type); - return (int32_t) (multiplierElem * fixedSizeElem); + int32_t getTypeBitWidth(slang::ast::Type const& type) { + auto [multiplierElem, fixedSizeElem] = getTypeBitWidthImpl(type); + return (int32_t)(multiplierElem * fixedSizeElem); } /// Given a scope, return the type of the named field. slang::ast::Type const& getScopeFieldType(const slang::ast::Scope& scope, - const std::string_view name) const { + const std::string_view name) const { auto* symbol = scope.find(name); SLANG_ASSERT(symbol != nullptr); return symbol->getDeclaredType()->getType(); } /// Given a packed struct type, return the bit position of the named field. - ConstantRange getStructFieldRange(const slang::ast::PackedStructType &packedStruct, + ConstantRange getStructFieldRange(const slang::ast::PackedStructType& packedStruct, const std::string_view fieldName) const { int32_t offset = 0; - for (auto &member : packedStruct.members()) { + for (auto& member : packedStruct.members()) { int32_t fieldWidth = member.getDeclaredType()->getType().getBitWidth(); if (member.name == fieldName) { return {offset, offset + fieldWidth - 1}; @@ -83,7 +82,7 @@ class AnalyseVariableReference { } /// Given a packed union type, return the bit position of the named field. - ConstantRange getUnionFieldRange(const slang::ast::PackedUnionType &packedUnion, + ConstantRange getUnionFieldRange(const slang::ast::PackedUnionType& packedUnion, const std::string_view fieldName) const { auto* symbol = packedUnion.find(fieldName); SLANG_ASSERT(symbol != nullptr); @@ -98,7 +97,7 @@ class AnalyseVariableReference { } /// Given an array type, return the range from which the array is indexed. - ConstantRange getArrayRange(const slang::ast::Type &type) { + ConstantRange getArrayRange(const slang::ast::Type& type) { if (type.kind == slang::ast::SymbolKind::PackedArrayType) { auto& arrayType = type.as(); return arrayType.range; @@ -108,17 +107,17 @@ class AnalyseVariableReference { return arrayType.range; } else { - SLANG_ASSERT(0 && "unexpected array type"); + SLANG_ASSERT(0 && "unexpected array type"); } } ConstantRange handleScalarElementSelect(const slang::ast::Type& type, ConstantRange range) { const auto& elementSelector = selectorsIt->get()->as(); if (!elementSelector.indexIsConstant()) { - // If the selector is not a constant, then return the whole scalar as - // the range. No further selectors expected. - SLANG_ASSERT(std::next(selectorsIt) == node.selectors.end()); - return {range.lower(), range.lower() + (int32_t)type.getBitWidth() - 1}; + // If the selector is not a constant, then return the whole scalar as + // the range. No further selectors expected. + SLANG_ASSERT(std::next(selectorsIt) == node.selectors.end()); + return {range.lower(), range.lower() + (int32_t)type.getBitWidth() - 1}; } // Create a new range. int32_t index = range.lower() + elementSelector.getIndexInt(); @@ -126,7 +125,7 @@ class AnalyseVariableReference { return {index, index}; } - ConstantRange handleScalarRangeSelect(const slang::ast::Type &type, ConstantRange range) { + ConstantRange handleScalarRangeSelect(const slang::ast::Type& type, ConstantRange range) { const auto& rangeSelector = selectorsIt->get()->as(); int32_t rightIndex = rangeSelector.getRightIndexInt(); int32_t leftIndex = rangeSelector.getLeftIndexInt(); @@ -134,24 +133,25 @@ class AnalyseVariableReference { SLANG_ASSERT(rangeSelector.leftIndexIsConstant()); SLANG_ASSERT(rangeSelector.rightIndexIsConstant()); // Create a new range. - ConstantRange newRange = {range.lower() + rightIndex, - range.lower() + leftIndex}; + ConstantRange newRange = {range.lower() + rightIndex, range.lower() + leftIndex}; SLANG_ASSERT(range.contains(newRange)); if (std::next(selectorsIt) != node.selectors.end()) { selectorsIt++; return getBitRangeImpl(type, newRange); - } else { + } + else { return newRange; } } - ConstantRange handleScalarRangeSelectIncr(const slang::ast::Type &type, ConstantRange range, bool isUp) { + ConstantRange handleScalarRangeSelectIncr(const slang::ast::Type& type, ConstantRange range, + bool isUp) { const auto& rangeSelector = selectorsIt->get()->as(); if (!rangeSelector.leftIndexIsConstant()) { - // If the selector base is not constant, then return the whole scalar - // as the range and halt analysis of any further selectors. - selectorsIt = node.selectors.end(); - return {range.lower(), range.lower() + (int32_t)type.getBitWidth() - 1}; + // If the selector base is not constant, then return the whole scalar + // as the range and halt analysis of any further selectors. + selectorsIt = node.selectors.end(); + return {range.lower(), range.lower() + (int32_t)type.getBitWidth() - 1}; } // Right index must be constant. SLANG_ASSERT(rangeSelector.rightIndexIsConstant()); @@ -159,24 +159,24 @@ class AnalyseVariableReference { int32_t leftIndex = rangeSelector.getLeftIndexInt(); // Create a new range. auto rangeEnd = isUp ? rightIndex + leftIndex : rightIndex - leftIndex; - ConstantRange newRange = {range.lower() + rightIndex, - range.lower() + rangeEnd}; + ConstantRange newRange = {range.lower() + rightIndex, range.lower() + rangeEnd}; SLANG_ASSERT(range.contains(newRange)); if (std::next(selectorsIt) != node.selectors.end()) { selectorsIt++; return getBitRangeImpl(type, newRange); - } else { + } + else { return newRange; } } - ConstantRange handleArrayElementSelect(const slang::ast::Type &type, ConstantRange range) { + ConstantRange handleArrayElementSelect(const slang::ast::Type& type, ConstantRange range) { const auto& elementSelector = selectorsIt->get()->as(); if (!elementSelector.indexIsConstant()) { - // If the selector is not a constant, then return the whole scalar as - // the range and halt analysis of any further selectors. - selectorsIt = node.selectors.end(); - return {range.lower(), range.lower() + getTypeBitWidth(type) - 1}; + // If the selector is not a constant, then return the whole scalar as + // the range and halt analysis of any further selectors. + selectorsIt = node.selectors.end(); + return {range.lower(), range.lower() + getTypeBitWidth(type) - 1}; } int32_t index = elementSelector.getIndexInt(); auto arrayRange = getArrayRange(type); @@ -186,17 +186,19 @@ class AnalyseVariableReference { // Create a new range. auto* elementType = type.getArrayElementType(); ConstantRange newRange = {range.lower() + (index * getTypeBitWidth(*elementType)), - range.lower() + ((index + 1) * getTypeBitWidth(*elementType)) - 1}; + range.lower() + ((index + 1) * getTypeBitWidth(*elementType)) - + 1}; SLANG_ASSERT(range.contains(newRange)); if (std::next(selectorsIt) != node.selectors.end()) { selectorsIt++; return getBitRangeImpl(*elementType, newRange); - } else { + } + else { return newRange; } } - ConstantRange handleArrayRangeSelect(const slang::ast::Type &type, ConstantRange range) { + ConstantRange handleArrayRangeSelect(const slang::ast::Type& type, ConstantRange range) { const auto& rangeSelector = selectorsIt->get()->as(); int32_t leftIndex = rangeSelector.getLeftIndexInt(); int32_t rightIndex = rangeSelector.getRightIndexInt(); @@ -210,26 +212,30 @@ class AnalyseVariableReference { // Create a new range. auto* elementType = type.getArrayElementType(); ConstantRange newRange = {range.lower() + (rightIndex * getTypeBitWidth(*elementType)), - range.lower() + ((leftIndex + 1) * getTypeBitWidth(*elementType)) - 1}; + range.lower() + + ((leftIndex + 1) * getTypeBitWidth(*elementType)) - 1}; SLANG_ASSERT(range.contains(newRange)); if (std::next(selectorsIt) != node.selectors.end()) { selectorsIt++; return getBitRangeImpl(type, newRange); - } else { + } + else { return newRange; } } - ConstantRange handleArrayRangeSelectIncr(const slang::ast::Type &type, ConstantRange range, bool isUp) { + ConstantRange handleArrayRangeSelectIncr(const slang::ast::Type& type, ConstantRange range, + bool isUp) { const auto& rangeSelector = selectorsIt->get()->as(); auto* elementType = type.getArrayElementType(); auto arrayRange = getArrayRange(type); if (!rangeSelector.leftIndexIsConstant()) { - // If the selector base is not constant, then return the whole array - // as the range and halt analysis of any further selectors. - selectorsIt = node.selectors.end(); - return {range.lower(), - range.lower() + (getTypeBitWidth(*elementType) * (int32_t)arrayRange.width()) - 1}; + // If the selector base is not constant, then return the whole array + // as the range and halt analysis of any further selectors. + selectorsIt = node.selectors.end(); + return {range.lower(), + range.lower() + (getTypeBitWidth(*elementType) * (int32_t)arrayRange.width()) - + 1}; } // Right index must be constant. SLANG_ASSERT(rangeSelector.rightIndexIsConstant()); @@ -240,17 +246,19 @@ class AnalyseVariableReference { rightIndex -= arrayRange.lower(); // Create a new range. ConstantRange newRange = {range.lower() + (rightIndex * getTypeBitWidth(*elementType)), - range.lower() + ((leftIndex + 1) * getTypeBitWidth(*elementType)) - 1}; + range.lower() + + ((leftIndex + 1) * getTypeBitWidth(*elementType)) - 1}; SLANG_ASSERT(range.contains(newRange)); if (std::next(selectorsIt) != node.selectors.end()) { selectorsIt++; return getBitRangeImpl(type, newRange); - } else { + } + else { return newRange; } } - ConstantRange handleStructMemberAccess(const slang::ast::Type &type, ConstantRange range) { + ConstantRange handleStructMemberAccess(const slang::ast::Type& type, ConstantRange range) { const auto& memberAccessSelector = selectorsIt->get()->as(); const auto& packedStruct = type.getCanonicalType().as(); auto fieldRange = getStructFieldRange(packedStruct, memberAccessSelector.name); @@ -259,15 +267,16 @@ class AnalyseVariableReference { range.lower() + fieldRange.upper()}; SLANG_ASSERT(range.contains(newRange)); if (std::next(selectorsIt) != node.selectors.end()) { - selectorsIt++; - const auto& fieldType = getScopeFieldType(packedStruct, memberAccessSelector.name); - return getBitRangeImpl(fieldType, newRange); - } else { - return newRange; + selectorsIt++; + const auto& fieldType = getScopeFieldType(packedStruct, memberAccessSelector.name); + return getBitRangeImpl(fieldType, newRange); + } + else { + return newRange; } } - ConstantRange handleUnionMemberAccess(const slang::ast::Type &type, ConstantRange range) { + ConstantRange handleUnionMemberAccess(const slang::ast::Type& type, ConstantRange range) { const auto& memberAccessSelector = selectorsIt->get()->as(); const auto& packedUnion = type.getCanonicalType().as(); auto fieldRange = getUnionFieldRange(packedUnion, memberAccessSelector.name); @@ -276,15 +285,16 @@ class AnalyseVariableReference { range.lower() + fieldRange.upper()}; SLANG_ASSERT(range.contains(newRange)); if (std::next(selectorsIt) != node.selectors.end()) { - selectorsIt++; - const auto& fieldType = getScopeFieldType(packedUnion, memberAccessSelector.name); - return getBitRangeImpl(fieldType, newRange); - } else { - return newRange; + selectorsIt++; + const auto& fieldType = getScopeFieldType(packedUnion, memberAccessSelector.name); + return getBitRangeImpl(fieldType, newRange); + } + else { + return newRange; } } - ConstantRange handleEnumMemberAccess(const slang::ast::Type &type, ConstantRange range) { + ConstantRange handleEnumMemberAccess(const slang::ast::Type& type, ConstantRange range) { const auto& memberAccessSelector = selectorsIt->get()->as(); const auto& enumeration = type.getCanonicalType().as(); auto fieldRange = getEnumRange(enumeration); @@ -306,7 +316,7 @@ class AnalyseVariableReference { /// Given a variable reference with zero or more selectors, determine the /// bit range that is accessed. - ConstantRange getBitRangeImpl(const slang::ast::Type &type, ConstantRange range) { + ConstantRange getBitRangeImpl(const slang::ast::Type& type, ConstantRange range) { // No selectors if (node.selectors.empty()) { return {0, getTypeBitWidth(node.symbol.getDeclaredType()->getType()) - 1}; @@ -326,26 +336,31 @@ class AnalyseVariableReference { } else if (selectorsIt->get()->isRangeSelect()) { switch (selectorsIt->get()->as().expr.getSelectionKind()) { - case ast::RangeSelectionKind::Simple: - return handleScalarRangeSelect(type, range); - case ast::RangeSelectionKind::IndexedUp: - return handleScalarRangeSelectIncr(type, range, true); - case ast::RangeSelectionKind::IndexedDown: - return handleScalarRangeSelectIncr(type, range, false); - default: - SLANG_UNREACHABLE; + case ast::RangeSelectionKind::Simple: + return handleScalarRangeSelect(type, range); + case ast::RangeSelectionKind::IndexedUp: + return handleScalarRangeSelectIncr(type, range, true); + case ast::RangeSelectionKind::IndexedDown: + return handleScalarRangeSelectIncr(type, range, false); + default: + SLANG_UNREACHABLE; } - } else if (selectorsIt->get()->isMemberAccess()) { + } + else if (selectorsIt->get()->isMemberAccess()) { if (type.isStruct()) { return handleStructMemberAccess(type, range); - } else if (type.isPackedUnion()) { + } + else if (type.isPackedUnion()) { return handleUnionMemberAccess(type, range); - } else if (type.isEnum()) { + } + else if (type.isEnum()) { return handleEnumMemberAccess(type, range); - } else { + } + else { SLANG_ASSERT(0 && "unsupported member selector"); } - } else { + } + else { SLANG_ASSERT(0 && "unsupported scalar selector"); } } @@ -360,14 +375,14 @@ class AnalyseVariableReference { } else if (selectorsIt->get()->isRangeSelect()) { switch (selectorsIt->get()->as().expr.getSelectionKind()) { - case ast::RangeSelectionKind::Simple: - return handleArrayRangeSelect(type, range); - case ast::RangeSelectionKind::IndexedUp: - return handleArrayRangeSelectIncr(type, range, true); - case ast::RangeSelectionKind::IndexedDown: - return handleArrayRangeSelectIncr(type, range, false); - default: - SLANG_UNREACHABLE; + case ast::RangeSelectionKind::Simple: + return handleArrayRangeSelect(type, range); + case ast::RangeSelectionKind::IndexedUp: + return handleArrayRangeSelectIncr(type, range, true); + case ast::RangeSelectionKind::IndexedDown: + return handleArrayRangeSelectIncr(type, range, false); + default: + SLANG_UNREACHABLE; } } else { @@ -394,13 +409,13 @@ class SplitVariables { SplitVariables(Netlist& netlist) : netlist(netlist) { split(); } private: - /// Return true if the selection made by the target node intersects with the /// selection made by the source node. bool isIntersectingSelection(NetlistVariableReference& sourceNode, NetlistVariableReference& targetNode) const { - return AnalyseVariableReference(sourceNode).getBitRange().overlaps( - AnalyseVariableReference(targetNode).getBitRange()); + return AnalyseVariableReference(sourceNode) + .getBitRange() + .overlaps(AnalyseVariableReference(targetNode).getBitRange()); } void split() { diff --git a/tools/netlist/tests/CMakeLists.txt b/tools/netlist/tests/CMakeLists.txt index f4ecb2cdf..0afc4a9e3 100644 --- a/tools/netlist/tests/CMakeLists.txt +++ b/tools/netlist/tests/CMakeLists.txt @@ -5,9 +5,13 @@ add_executable( netlist_unittests - ../../../tests/unittests/main.cpp ../../../tests/unittests/Test.cpp + ../../../tests/unittests/main.cpp + ../../../tests/unittests/Test.cpp ../source/Netlist.cpp - DepthFirstSearchTests.cpp DirectedGraphTests.cpp NameTests.cpp PathTests.cpp + DepthFirstSearchTests.cpp + DirectedGraphTests.cpp + NameTests.cpp + PathTests.cpp VariableSelectorsTests.cpp) target_link_libraries( diff --git a/tools/netlist/tests/NameTests.cpp b/tools/netlist/tests/NameTests.cpp index 31237d605..841ff83db 100644 --- a/tools/netlist/tests/NameTests.cpp +++ b/tools/netlist/tests/NameTests.cpp @@ -55,4 +55,3 @@ endmodule auto netlist = createNetlist(compilation); CHECK(netlist.numNodes() > 0); } - diff --git a/tools/netlist/tests/NetlistTest.h b/tools/netlist/tests/NetlistTest.h index 33d94fc07..f92b6a88f 100644 --- a/tools/netlist/tests/NetlistTest.h +++ b/tools/netlist/tests/NetlistTest.h @@ -6,7 +6,6 @@ #include "PathFinder.h" #include "SplitVariables.h" #include "Test.h" - #include using namespace netlist; @@ -19,10 +18,9 @@ inline Netlist createNetlist(Compilation& compilation) { return netlist; } -inline bool pathExists(Netlist &netlist, const std::string& startName, const std::string& endName) { +inline bool pathExists(Netlist& netlist, const std::string& startName, const std::string& endName) { PathFinder pathFinder(netlist); auto* startNode = netlist.lookupPort(startName); auto* endNode = netlist.lookupPort(endName); return !pathFinder.find(*startNode, *endNode).empty(); } - diff --git a/tools/netlist/tests/VariableSelectorsTests.cpp b/tools/netlist/tests/VariableSelectorsTests.cpp index 6d4540e67..7aa1c6ae2 100644 --- a/tools/netlist/tests/VariableSelectorsTests.cpp +++ b/tools/netlist/tests/VariableSelectorsTests.cpp @@ -10,13 +10,12 @@ #include "SplitVariables.h" #include - /// Helper method to extract a variable reference from a netlist and return the /// bit range associated with it. -ConstantRange getBitRange(Netlist &netlist, std::string_view variableSyntax) { +ConstantRange getBitRange(Netlist& netlist, std::string_view variableSyntax) { auto* node = netlist.lookupVariableReference(variableSyntax); if (node == nullptr) { - throw std::runtime_error(fmt::format("Could not find node {}", variableSyntax)); + throw std::runtime_error(fmt::format("Could not find node {}", variableSyntax)); } return AnalyseVariableReference::create(*node).getBitRange(); } @@ -418,7 +417,7 @@ endmodule //===---------------------------------------------------------------------===// TEST_CASE("Struct with packed array members") { - // Test recursion from packed struct. + // Test recursion from packed struct. auto tree = SyntaxTree::fromText(R"( module m; struct packed { @@ -445,7 +444,7 @@ endmodule } TEST_CASE("Packed struct with packed union and enum members") { - // Test recursion from packed struct. + // Test recursion from packed struct. auto tree = SyntaxTree::fromText(R"( module m; typedef enum int { A, B, C } enum_t; @@ -480,7 +479,7 @@ endmodule } TEST_CASE("Packed arrays of structs etc") { - // Test recursion from packed packed array, packed struct, packed union. + // Test recursion from packed packed array, packed struct, packed union. auto tree = SyntaxTree::fromText(R"( module m; typedef enum int { A, B, C } enum_t;