diff --git a/tools/netlist/include/Debug.h b/tools/netlist/include/Debug.h index 111877cf7..ed2c78402 100644 --- a/tools/netlist/include/Debug.h +++ b/tools/netlist/include/Debug.h @@ -7,20 +7,20 @@ //------------------------------------------------------------------------------ #pragma once -#include - #include "Config.h" +#include namespace netlist { -template -void DebugMessage(const char *filename, const int line, fmt::format_string fmt, T &&...args) { - fmt::print("{}:{}: ", filename, line); - fmt::print(fmt, std::forward(args)...); +template +void DebugMessage(const char* filename, const int line, fmt::format_string fmt, T&&... args) { + fmt::print("{}:{}: ", filename, line); + fmt::print(fmt, std::forward(args)...); } -template void InfoMessage(fmt::format_string fmt, T &&...args) { - fmt::print(fmt, std::forward(args)...); +template +void InfoMessage(fmt::format_string fmt, T&&... args) { + fmt::print(fmt, std::forward(args)...); } } // namespace netlist @@ -35,6 +35,6 @@ template void InfoMessage(fmt::format_string fmt, T &&...a #endif #define INFO_PRINT(str, ...) \ - if (!Config::getInstance().quietEnabled) { \ + if (!Config::getInstance().quietEnabled) { \ InfoMessage(str __VA_OPT__(, ) __VA_ARGS__); \ } diff --git a/tools/netlist/include/NetlistVisitor.h b/tools/netlist/include/NetlistVisitor.h index 688772658..4c280e45d 100644 --- a/tools/netlist/include/NetlistVisitor.h +++ b/tools/netlist/include/NetlistVisitor.h @@ -111,10 +111,12 @@ class VariableReferenceVisitor : public ast::ASTVisitorgetType()); node.bounds = {static_cast(bounds->first), static_cast(bounds->second)}; - } else { + } + else { node.bounds = {0, getTypeBitWidth(expr.symbol.getType()) - 1}; } - DEBUG_PRINT("Variable reference: {} bounds {}:{}\n", node.toString(), node.bounds.lower(), node.bounds.upper()); + DEBUG_PRINT("Variable reference: {} bounds {}:{}\n", node.toString(), node.bounds.lower(), + node.bounds.upper()); // Clear the selectors for the next named value. selectors.clear();