diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-08-30 18:59:05 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-08-30 18:59:05 +0200 |
commit | 4724d94fbce587b39cd7343dc8de3b859311f55c (patch) | |
tree | 6a1c2a9b82d48f73dbcaa3926003bbcf85b48a0f /kernel | |
parent | 88db09255baa92facbe2736937ef113dc1503e9b (diff) |
Added $alu cell type
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/celltypes.h | 2 | ||||
-rw-r--r-- | kernel/rtlil.cc | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/kernel/celltypes.h b/kernel/celltypes.h index 515da25c..c1bb1d03 100644 --- a/kernel/celltypes.h +++ b/kernel/celltypes.h @@ -108,6 +108,8 @@ struct CellTypes for (auto type : std::vector<RTLIL::IdString>({"$mux", "$pmux"})) setup_type(type, {"\\A", "\\B", "\\S"}, {"\\Y"}, true); + setup_type("$alu", {"\\A", "\\B", "\\CI", "\\BI"}, {"\\X", "\\Y", "\\CO"}, true); + setup_type("$assert", {"\\A", "\\EN"}, std::set<RTLIL::IdString>(), true); } diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 7ba6911a..96b651d8 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -557,6 +557,20 @@ namespace { return; } + if (cell->type == "$alu") { + param_bool("\\A_SIGNED"); + param_bool("\\B_SIGNED"); + port("\\A", param("\\A_WIDTH")); + port("\\B", param("\\B_WIDTH")); + port("\\CI", 1); + port("\\BI", 1); + port("\\X", param("\\Y_WIDTH")); + port("\\Y", param("\\Y_WIDTH")); + port("\\CO", param("\\Y_WIDTH")); + check_expected(); + return; + } + if (cell->type == "$logic_not") { param_bool("\\A_SIGNED"); port("\\A", param("\\A_WIDTH")); |