From fc3b3c4ec3955b165166d9f44965fac0e1879505 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Fri, 7 Feb 2014 17:44:57 +0100 Subject: Added $slice and $concat cell types --- passes/techmap/simplemap.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'passes/techmap/simplemap.cc') diff --git a/passes/techmap/simplemap.cc b/passes/techmap/simplemap.cc index e06a80bbd..e67b1e055 100644 --- a/passes/techmap/simplemap.cc +++ b/passes/techmap/simplemap.cc @@ -312,6 +312,22 @@ static void simplemap_mux(RTLIL::Module *module, RTLIL::Cell *cell) } } +static void simplemap_slice(RTLIL::Module *module, RTLIL::Cell *cell) +{ + int offset = cell->parameters.at("\\OFFSET").as_int(); + RTLIL::SigSpec sig_a = cell->connections.at("\\A"); + RTLIL::SigSpec sig_y = cell->connections.at("\\Y"); + module->connections.push_back(RTLIL::SigSig(sig_y, sig_a.extract(offset, sig_y.width))); +} + +static void simplemap_concat(RTLIL::Module *module, RTLIL::Cell *cell) +{ + RTLIL::SigSpec sig_ab = cell->connections.at("\\A"); + sig_ab.append(cell->connections.at("\\B")); + RTLIL::SigSpec sig_y = cell->connections.at("\\Y"); + module->connections.push_back(RTLIL::SigSig(sig_y, sig_ab)); +} + static void simplemap_sr(RTLIL::Module *module, RTLIL::Cell *cell) { int width = cell->parameters.at("\\WIDTH").as_int(); @@ -480,6 +496,8 @@ void simplemap_get_mappers(std::map