3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 09:05:32 +00:00

Removed deprecated module->new_wire()

This commit is contained in:
Clifford Wolf 2014-07-21 12:35:06 +02:00
parent 3cb61d03f8
commit 1d88f1cf9f
11 changed files with 47 additions and 56 deletions

View file

@ -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; \
}

View file

@ -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);