void add(RTLIL::Cell *cell);
void fixup_ports();
- template<typename T> void rewrite_sigspecs(T functor) {
- for (auto &it : cells)
- it.second->rewrite_sigspecs(functor);
- for (auto &it : processes)
- it.second->rewrite_sigspecs(functor);
- for (auto &it : connections) {
- functor(it.first);
- functor(it.second);
- }
- }
+ template<typename T>
+ void rewrite_sigspecs(T functor);
};
struct RTLIL::Wire {
std::map<RTLIL::IdString, RTLIL::Const> parameters;
void optimize();
- template<typename T> void rewrite_sigspecs(T functor) {
- for (auto &it : connections)
- functor(it.second);
- }
+ template<typename T>
+ void rewrite_sigspecs(T functor);
};
struct RTLIL::SigChunk {
~CaseRule();
void optimize();
- template<typename T> void rewrite_sigspecs(T functor) {
- for (auto &it : compare)
- functor(it);
- for (auto &it : actions) {
- functor(it.first);
- functor(it.second);
- }
- for (auto it : switches)
- it->rewrite_sigspecs(functor);
- }
+ template<typename T>
+ void rewrite_sigspecs(T functor);
};
struct RTLIL::SwitchRule {
~SwitchRule();
void optimize();
- template<typename T> void rewrite_sigspecs(T functor) {
- functor(signal);
- for (auto it : cases)
- it->rewrite_sigspecs(functor);
- }
+ template<typename T>
+ void rewrite_sigspecs(T functor);
};
struct RTLIL::SyncRule {
std::vector<RTLIL::SigSig> actions;
void optimize();
- template<typename T> void rewrite_sigspecs(T functor) {
- functor(signal);
- for (auto &it : actions) {
- functor(it.first);
- functor(it.second);
- }
- }
+ template<typename T>
+ void rewrite_sigspecs(T functor);
};
struct RTLIL::Process {
~Process();
void optimize();
- template<typename T> void rewrite_sigspecs(T functor) {
- root_case.rewrite_sigspecs(functor);
- for (auto it : syncs)
- it->rewrite_sigspecs(functor);
- }
+ template<typename T>
+ void rewrite_sigspecs(T functor);
};
+template<typename T>
+void RTLIL::Module::rewrite_sigspecs(T functor)
+{
+ for (auto &it : cells)
+ it.second->rewrite_sigspecs(functor);
+ for (auto &it : processes)
+ it.second->rewrite_sigspecs(functor);
+ for (auto &it : connections) {
+ functor(it.first);
+ functor(it.second);
+ }
+}
+
+template<typename T>
+void RTLIL::Cell::rewrite_sigspecs(T functor) {
+ for (auto &it : connections)
+ functor(it.second);
+}
+
+template<typename T>
+void RTLIL::CaseRule::rewrite_sigspecs(T functor) {
+ for (auto &it : compare)
+ functor(it);
+ for (auto &it : actions) {
+ functor(it.first);
+ functor(it.second);
+ }
+ for (auto it : switches)
+ it->rewrite_sigspecs(functor);
+}
+
+template<typename T>
+void RTLIL::SwitchRule::rewrite_sigspecs(T functor)
+{
+ functor(signal);
+ for (auto it : cases)
+ it->rewrite_sigspecs(functor);
+}
+
+template<typename T>
+void RTLIL::SyncRule::rewrite_sigspecs(T functor)
+{
+ functor(signal);
+ for (auto &it : actions) {
+ functor(it.first);
+ functor(it.second);
+ }
+}
+
+template<typename T>
+void RTLIL::Process::rewrite_sigspecs(T functor)
+{
+ root_case.rewrite_sigspecs(functor);
+ for (auto it : syncs)
+ it->rewrite_sigspecs(functor);
+}
+
#endif