Update more stuff to use get_src_attribute() and set_src_attribute()

This commit is contained in:
Clifford Wolf 2017-09-01 12:26:55 +02:00
parent 8dc6083de7
commit 8a66bd30c6
2 changed files with 5 additions and 5 deletions

View File

@ -1643,7 +1643,7 @@ RTLIL::Cell *RTLIL::Module::addCell(RTLIL::IdString name, const RTLIL::Cell *oth
cell->parameters["\\Y_WIDTH"] = sig_y.size(); \ cell->parameters["\\Y_WIDTH"] = sig_y.size(); \
cell->setPort("\\A", sig_a); \ cell->setPort("\\A", sig_a); \
cell->setPort("\\Y", sig_y); \ cell->setPort("\\Y", sig_y); \
if (!src.empty()) cell->attributes["\\src"] = src; \ cell->set_src_attribute(src); \
return cell; \ return cell; \
} \ } \
RTLIL::SigSpec RTLIL::Module::_func(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed, std::string src) { \ RTLIL::SigSpec RTLIL::Module::_func(RTLIL::IdString name, RTLIL::SigSpec sig_a, bool is_signed, std::string src) { \

View File

@ -55,19 +55,19 @@ struct AlumaccWorker
RTLIL::SigSpec get_gt() { RTLIL::SigSpec get_gt() {
if (GetSize(cached_gt) == 0) if (GetSize(cached_gt) == 0)
cached_gt = alu_cell->module->Not(NEW_ID, alu_cell->module->Or(NEW_ID, get_lt(), get_eq()), false, alu_cell->attributes["\\src"].decode_string()); cached_gt = alu_cell->module->Not(NEW_ID, alu_cell->module->Or(NEW_ID, get_lt(), get_eq()), false, alu_cell->get_src_attribute());
return cached_gt; return cached_gt;
} }
RTLIL::SigSpec get_eq() { RTLIL::SigSpec get_eq() {
if (GetSize(cached_eq) == 0) if (GetSize(cached_eq) == 0)
cached_eq = alu_cell->module->ReduceAnd(NEW_ID, alu_cell->getPort("\\X"), false, alu_cell->attributes["\\src"].decode_string()); cached_eq = alu_cell->module->ReduceAnd(NEW_ID, alu_cell->getPort("\\X"), false, alu_cell->get_src_attribute());
return cached_eq; return cached_eq;
} }
RTLIL::SigSpec get_ne() { RTLIL::SigSpec get_ne() {
if (GetSize(cached_ne) == 0) if (GetSize(cached_ne) == 0)
cached_ne = alu_cell->module->Not(NEW_ID, get_eq(), false, alu_cell->attributes["\\src"].decode_string()); cached_ne = alu_cell->module->Not(NEW_ID, get_eq(), false, alu_cell->get_src_attribute());
return cached_ne; return cached_ne;
} }
@ -75,7 +75,7 @@ struct AlumaccWorker
if (GetSize(cached_cf) == 0) { if (GetSize(cached_cf) == 0) {
cached_cf = alu_cell->getPort("\\CO"); cached_cf = alu_cell->getPort("\\CO");
log_assert(GetSize(cached_cf) >= 1); log_assert(GetSize(cached_cf) >= 1);
cached_cf = alu_cell->module->Not(NEW_ID, cached_cf[GetSize(cached_cf)-1], false, alu_cell->attributes["\\src"].decode_string()); cached_cf = alu_cell->module->Not(NEW_ID, cached_cf[GetSize(cached_cf)-1], false, alu_cell->get_src_attribute());
} }
return cached_cf; return cached_cf;
} }