101 std::map<RTLIL::SigBit, dff_map_bit_info_t> bit_info;
104 for (
auto &it : module->
cells_)
106 if (!design->
selected(module, it.second))
116 info.
cell = it.second;
121 std::vector<RTLIL::SigBit> sig_d = sigmap(info.
cell->
getPort(
"\\D")).to_sigbit_vector();
122 std::vector<RTLIL::SigBit> sig_q = sigmap(info.
cell->
getPort(
"\\Q")).to_sigbit_vector();
123 for (
size_t i = 0; i < sig_d.size(); i++) {
124 info.
bit_d = sig_d.at(i);
125 bit_info[sig_q.at(i)] = info;
135 std::vector<RTLIL::SigBit> sig_d = sigmap(info.
cell->
getPort(
"\\D")).to_sigbit_vector();
136 std::vector<RTLIL::SigBit> sig_q = sigmap(info.
cell->
getPort(
"\\Q")).to_sigbit_vector();
137 std::vector<RTLIL::State> arst_value = info.
cell->
parameters.at(
"\\ARST_VALUE").bits;
138 for (
size_t i = 0; i < sig_d.size(); i++) {
139 info.
bit_d = sig_d.at(i);
141 bit_info[sig_q.at(i)] = info;
150 bit_info[sigmap(info.
cell->
getPort(
"\\Q")).to_single_sigbit()] = info;
161 bit_info[sigmap(info.
cell->
getPort(
"\\Q")).to_single_sigbit()] = info;
166 std::map<RTLIL::IdString, dff_map_info_t> empty_dq_map;
167 for (
auto &it : module->
wires_)
172 std::vector<RTLIL::SigBit> bits_q = sigmap(it.second).to_sigbit_vector();
173 std::vector<RTLIL::SigBit> bits_d;
174 std::vector<RTLIL::State> arst_value;
175 std::set<RTLIL::Cell*> cells;
177 if (bits_q.empty() || !bit_info.count(bits_q.front()))
181 for (
auto &bit : bits_q) {
182 if (!bit_info.count(bit))
193 bits_d.push_back(info.
bit_d);
195 cells.insert(info.
cell);
198 if (bits_d.size() != bits_q.size())
208 for (
auto it : cells)
209 info.
cells.push_back(it->name);
210 map[it.first] = info;
bool selected(T1 *module) const
std::map< RTLIL::IdString, RTLIL::Wire * > wires_
std::map< RTLIL::IdString, RTLIL::Const > parameters
bool consider_wire(RTLIL::Wire *wire, std::map< RTLIL::IdString, dff_map_info_t > &dff_dq_map)
const RTLIL::SigSpec & getPort(RTLIL::IdString portname) const
std::string substr(size_t pos=0, size_t len=std::string::npos) const
std::map< RTLIL::IdString, RTLIL::Cell * > cells_
std::vector< RTLIL::IdString > cells