summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-07-21 12:35:06 +0200
committerClifford Wolf <clifford@clifford.at>2014-07-21 12:35:06 +0200
commit1d88f1cf9f2088de7825f5292db5b40d4f73d036 (patch)
treeef1eeba2dcddbe957dabb8147b2b81cdc0d2ecd3 /kernel
parent3cb61d03f8722fddfa14877accae1b3ca51e3926 (diff)
Removed deprecated module->new_wire()
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtlil.cc21
-rw-r--r--kernel/rtlil.h10
2 files changed, 11 insertions, 20 deletions
diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc
index b16b62ca..d3d830d6 100644
--- a/kernel/rtlil.cc
+++ b/kernel/rtlil.cc
@@ -819,15 +819,6 @@ RTLIL::Module *RTLIL::Module::clone() const
return new_mod;
}
-RTLIL::Wire *RTLIL::Module::new_wire(int width, RTLIL::IdString name)
-{
- RTLIL::Wire *wire = new RTLIL::Wire;
- wire->width = width;
- wire->name = name;
- add(wire);
- return wire;
-}
-
void RTLIL::Module::add(RTLIL::Wire *wire)
{
assert(!wire->name.empty());
@@ -908,7 +899,7 @@ RTLIL::Cell *RTLIL::Module::addCell(RTLIL::IdString name, RTLIL::IdString type)
return cell; \
} \
RTLIL::SigSpec RTLIL::Module::_func(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed) { \
- RTLIL::SigSpec sig_y = new_wire(_y_size, NEW_ID); \
+ RTLIL::SigSpec sig_y = addWire(NEW_ID, _y_size); \
add ## _func(name, sig_a, sig_y, is_signed); \
return sig_y; \
}
@@ -941,7 +932,7 @@ DEF_METHOD(LogicNot, 1, "$logic_not")
return cell; \
} \
RTLIL::SigSpec RTLIL::Module::_func(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, bool is_signed) { \
- RTLIL::SigSpec sig_y = new_wire(_y_size, NEW_ID); \
+ RTLIL::SigSpec sig_y = addWire(NEW_ID, _y_size); \
add ## _func(name, sig_a, sig_b, sig_y, is_signed); \
return sig_y; \
}
@@ -986,7 +977,7 @@ DEF_METHOD(LogicOr, 1, "$logic_or")
return cell; \
} \
RTLIL::SigSpec RTLIL::Module::_func(RTLIL::IdString name, RTLIL::SigSpec sig_a, RTLIL::SigSpec sig_b, RTLIL::SigSpec sig_s) { \
- RTLIL::SigSpec sig_y = new_wire(sig_a.width, NEW_ID); \
+ RTLIL::SigSpec sig_y = addWire(NEW_ID, sig_a.width); \
add ## _func(name, sig_a, sig_b, sig_s, sig_y); \
return sig_y; \
}
@@ -1006,7 +997,7 @@ DEF_METHOD(SafePmux, "$safe_pmux", 1)
return cell; \
} \
RTLIL::SigSpec RTLIL::Module::_func(RTLIL::IdString name, RTLIL::SigSpec sig1) { \
- RTLIL::SigSpec sig2 = new_wire(1, NEW_ID); \
+ RTLIL::SigSpec sig2 = addWire(NEW_ID); \
add ## _func(name, sig1, sig2); \
return sig2; \
}
@@ -1022,7 +1013,7 @@ DEF_METHOD(SafePmux, "$safe_pmux", 1)
return cell; \
} \
RTLIL::SigSpec RTLIL::Module::_func(RTLIL::IdString name, RTLIL::SigSpec sig1, RTLIL::SigSpec sig2) { \
- RTLIL::SigSpec sig3 = new_wire(1, NEW_ID); \
+ RTLIL::SigSpec sig3 = addWire(NEW_ID); \
add ## _func(name, sig1, sig2, sig3); \
return sig3; \
}
@@ -1039,7 +1030,7 @@ DEF_METHOD(SafePmux, "$safe_pmux", 1)
return cell; \
} \
RTLIL::SigSpec RTLIL::Module::_func(RTLIL::IdString name, RTLIL::SigSpec sig1, RTLIL::SigSpec sig2, RTLIL::SigSpec sig3) { \
- RTLIL::SigSpec sig4 = new_wire(1, NEW_ID); \
+ RTLIL::SigSpec sig4 = addWire(NEW_ID); \
add ## _func(name, sig1, sig2, sig3, sig4); \
return sig4; \
}
diff --git a/kernel/rtlil.h b/kernel/rtlil.h
index 19666481..3c6c9724 100644
--- a/kernel/rtlil.h
+++ b/kernel/rtlil.h
@@ -142,7 +142,7 @@ namespace RTLIL
RTLIL::new_id(__FILE__, __LINE__, __FUNCTION__)
#define NEW_WIRE(_mod, _width) \
- (_mod)->new_wire(_width, NEW_ID)
+ (_mod)->addWire(NEW_ID, _width)
template <typename T> struct sort_by_name {
bool operator()(T *a, T *b) const {
@@ -287,16 +287,16 @@ struct RTLIL::Module {
virtual size_t count_id(RTLIL::IdString id);
virtual void check();
virtual void optimize();
- RTLIL::Wire *new_wire(int width, RTLIL::IdString name);
- void add(RTLIL::Wire *wire);
- void add(RTLIL::Cell *cell);
- void remove(RTLIL::Cell *cell);
void fixup_ports();
template<typename T> void rewrite_sigspecs(T functor);
void cloneInto(RTLIL::Module *new_mod) const;
virtual RTLIL::Module *clone() const;
+ void add(RTLIL::Wire *wire);
+ void add(RTLIL::Cell *cell);
+ void remove(RTLIL::Cell *cell);
+
RTLIL::Wire *addWire(RTLIL::IdString name, int width = 1);
RTLIL::Cell *addCell(RTLIL::IdString name, RTLIL::IdString type);