aboutsummaryrefslogtreecommitdiffstats
path: root/passes/opt/opt_lut.cc
diff options
context:
space:
mode:
authorEddie Hung <eddie@fpgeh.com>2019-08-08 07:58:33 -0700
committerGitHub <noreply@github.com>2019-08-08 07:58:33 -0700
commitac2fc3a144fe1094bedcc6b3fda8a498ad43ae76 (patch)
tree9ae14fabe60d01f2f13a87e905f41adbec7512c7 /passes/opt/opt_lut.cc
parent61d7f1997ba7e3098acc25694accdd0ff25b8ab1 (diff)
parentf69410daaf68cd3cef5e365df9b27c623ce589a7 (diff)
downloadyosys-ac2fc3a144fe1094bedcc6b3fda8a498ad43ae76.tar.gz
yosys-ac2fc3a144fe1094bedcc6b3fda8a498ad43ae76.tar.bz2
yosys-ac2fc3a144fe1094bedcc6b3fda8a498ad43ae76.zip
Merge pull request #1264 from YosysHQ/eddie/fix_1254
opt_lut to ignore LUT cells, or those that drive bits, with (* keep *)
Diffstat (limited to 'passes/opt/opt_lut.cc')
-rw-r--r--passes/opt/opt_lut.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/passes/opt/opt_lut.cc b/passes/opt/opt_lut.cc
index 587ef878a..4c199ba72 100644
--- a/passes/opt/opt_lut.cc
+++ b/passes/opt/opt_lut.cc
@@ -101,6 +101,12 @@ struct OptLutWorker
{
if (cell->type == "$lut")
{
+ if (cell->has_keep_attr())
+ continue;
+ SigBit lut_output = cell->getPort("\\Y");
+ if (lut_output.wire->get_bool_attribute("\\keep"))
+ continue;
+
int lut_width = cell->getParam("\\WIDTH").as_int();
SigSpec lut_input = cell->getPort("\\A");
int lut_arity = 0;