aboutsummaryrefslogtreecommitdiffstats
path: root/passes
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2016-07-13 16:56:17 +0200
committerClifford Wolf <clifford@clifford.at>2016-07-13 16:56:17 +0200
commit721f1f5ecfb6334904f6058d6d376d21b5efc438 (patch)
tree3573f744b6d7c33f55dd06a152d4ff199cf30b22 /passes
parentb3155af5f65333d272da339222e1e1962fb088b7 (diff)
downloadyosys-721f1f5ecfb6334904f6058d6d376d21b5efc438.tar.gz
yosys-721f1f5ecfb6334904f6058d6d376d21b5efc438.tar.bz2
yosys-721f1f5ecfb6334904f6058d6d376d21b5efc438.zip
Added basic support for $expect cells
Diffstat (limited to 'passes')
-rw-r--r--passes/hierarchy/hierarchy.cc2
-rw-r--r--passes/opt/opt_clean.cc2
-rw-r--r--passes/tests/test_cell.cc2
3 files changed, 4 insertions, 2 deletions
diff --git a/passes/hierarchy/hierarchy.cc b/passes/hierarchy/hierarchy.cc
index 94b93de5d..14d67884e 100644
--- a/passes/hierarchy/hierarchy.cc
+++ b/passes/hierarchy/hierarchy.cc
@@ -313,7 +313,7 @@ bool set_keep_assert(std::map<RTLIL::Module*, bool> &cache, RTLIL::Module *mod)
if (cache.count(mod) == 0)
for (auto c : mod->cells()) {
RTLIL::Module *m = mod->design->module(c->type);
- if ((m != nullptr && set_keep_assert(cache, m)) || c->type.in("$assert", "$assume"))
+ if ((m != nullptr && set_keep_assert(cache, m)) || c->type.in("$assert", "$assume", "$expect"))
return cache[mod] = true;
}
return cache[mod];
diff --git a/passes/opt/opt_clean.cc b/passes/opt/opt_clean.cc
index 6600ffa25..d905a30bf 100644
--- a/passes/opt/opt_clean.cc
+++ b/passes/opt/opt_clean.cc
@@ -64,7 +64,7 @@ struct keep_cache_t
bool query(Cell *cell)
{
- if (cell->type.in("$memwr", "$meminit", "$assert", "$assume"))
+ if (cell->type.in("$memwr", "$meminit", "$assert", "$assume", "$expect"))
return true;
if (cell->has_keep_attr())
diff --git a/passes/tests/test_cell.cc b/passes/tests/test_cell.cc
index 8b800d414..1bff02a21 100644
--- a/passes/tests/test_cell.cc
+++ b/passes/tests/test_cell.cc
@@ -730,6 +730,8 @@ struct TestCellPass : public Pass {
// cell_types["$slice"] = "A";
// cell_types["$concat"] = "A";
// cell_types["$assert"] = "A";
+ // cell_types["$assume"] = "A";
+ // cell_types["$expect"] = "A";
cell_types["$lut"] = "*";
cell_types["$sop"] = "*";