From ff50bc2ac304fcec5746939e155dcac2b01665df Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sun, 16 Aug 2015 12:54:52 +0200 Subject: Added $tribuf and $_TBUF_ cell types --- passes/techmap/simplemap.cc | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'passes/techmap') diff --git a/passes/techmap/simplemap.cc b/passes/techmap/simplemap.cc index 7511a55c7..0fb5b3741 100644 --- a/passes/techmap/simplemap.cc +++ b/passes/techmap/simplemap.cc @@ -283,6 +283,21 @@ void simplemap_mux(RTLIL::Module *module, RTLIL::Cell *cell) } } +void simplemap_tribuf(RTLIL::Module *module, RTLIL::Cell *cell) +{ + RTLIL::SigSpec sig_a = cell->getPort("\\A"); + RTLIL::SigSpec sig_e = cell->getPort("\\EN"); + RTLIL::SigSpec sig_y = cell->getPort("\\Y"); + + for (int i = 0; i < GetSize(sig_y); i++) { + RTLIL::Cell *gate = module->addCell(NEW_ID, "$_TBUF_"); + gate->add_strpool_attribute("\\src", cell->get_strpool_attribute("\\src")); + gate->setPort("\\A", sig_a[i]); + gate->setPort("\\E", sig_e[i]); + gate->setPort("\\Y", sig_y[i]); + } +} + void simplemap_lut(RTLIL::Module *module, RTLIL::Cell *cell) { SigSpec lut_ctrl = cell->getPort("\\A"); @@ -481,6 +496,7 @@ void simplemap_get_mappers(std::map