aboutsummaryrefslogtreecommitdiffstats
path: root/manual/CHAPTER_Prog/stubnets.cc
diff options
context:
space:
mode:
Diffstat (limited to 'manual/CHAPTER_Prog/stubnets.cc')
-rw-r--r--manual/CHAPTER_Prog/stubnets.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/manual/CHAPTER_Prog/stubnets.cc b/manual/CHAPTER_Prog/stubnets.cc
index ef4b1245d..4849c6a7b 100644
--- a/manual/CHAPTER_Prog/stubnets.cc
+++ b/manual/CHAPTER_Prog/stubnets.cc
@@ -5,15 +5,16 @@
// binary, for any purpose, commercial or non-commercial, and by any
// means.
-#include "kernel/rtlil.h"
-#include "kernel/register.h"
+#include "kernel/yosys.h"
#include "kernel/sigtools.h"
-#include "kernel/log.h"
#include <string>
#include <map>
#include <set>
+USING_YOSYS_NAMESPACE
+PRIVATE_NAMESPACE_BEGIN
+
// this function is called for each module in the design
static void find_stub_nets(RTLIL::Design *design, RTLIL::Module *module, bool report_bits)
{
@@ -62,7 +63,7 @@ static void find_stub_nets(RTLIL::Design *design, RTLIL::Module *module, bool re
// for each bit (unless it is a constant):
// check if it is used at least two times and add to stub_bits otherwise
- for (int i = 0; i < SIZE(sig); i++)
+ for (int i = 0; i < GetSize(sig); i++)
if (sig[i].wire != NULL && (bit_usage_count[sig[i]] + usage_offset) < 2)
stub_bits.insert(i);
@@ -72,7 +73,7 @@ static void find_stub_nets(RTLIL::Design *design, RTLIL::Module *module, bool re
// report stub bits and/or stub wires, don't report single bits
// if called with report_bits set to false.
- if (SIZE(stub_bits) == SIZE(sig)) {
+ if (GetSize(stub_bits) == GetSize(sig)) {
log(" found stub wire: %s\n", RTLIL::id2cstr(wire->name));
} else {
if (!report_bits)
@@ -126,3 +127,4 @@ struct StubnetsPass : public Pass {
}
} StubnetsPass;
+PRIVATE_NAMESPACE_END