diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-02-27 18:00:01 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-02-27 18:00:01 +0100 |
commit | 1bbc2b34c8c23f0da2d72f08c5cfb9dffa7fa673 (patch) | |
tree | 4c8b37f45666204e062d70a450f025d619a2d969 | |
parent | da3d55a29c88de69ce7b51151544399e91ef23d8 (diff) | |
download | yosys-1bbc2b34c8c23f0da2d72f08c5cfb9dffa7fa673.tar.gz yosys-1bbc2b34c8c23f0da2d72f08c5cfb9dffa7fa673.tar.bz2 yosys-1bbc2b34c8c23f0da2d72f08c5cfb9dffa7fa673.zip |
Added support for simple gates with one constant input to opt_const
-rw-r--r-- | passes/opt/opt_const.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/passes/opt/opt_const.cc b/passes/opt/opt_const.cc index 9edea6709..84b525449 100644 --- a/passes/opt/opt_const.cc +++ b/passes/opt/opt_const.cc @@ -76,6 +76,8 @@ void replace_const_cells(RTLIL::Module *module) if (input.match("11")) ACTION_DO_Y(1); if (input.match(" *")) ACTION_DO_Y(x); if (input.match("* ")) ACTION_DO_Y(x); + if (input.match(" 1")) ACTION_DO("\\Y", input.extract(1, 1)); + if (input.match("1 ")) ACTION_DO("\\Y", input.extract(0, 1)); } if (cell->type == "$_OR_") { @@ -88,6 +90,8 @@ void replace_const_cells(RTLIL::Module *module) if (input.match("00")) ACTION_DO_Y(0); if (input.match(" *")) ACTION_DO_Y(x); if (input.match("* ")) ACTION_DO_Y(x); + if (input.match(" 0")) ACTION_DO("\\Y", input.extract(1, 1)); + if (input.match("0 ")) ACTION_DO("\\Y", input.extract(0, 1)); } if (cell->type == "$_XOR_") { @@ -101,6 +105,8 @@ void replace_const_cells(RTLIL::Module *module) if (input.match("11")) ACTION_DO_Y(0); if (input.match(" *")) ACTION_DO_Y(x); if (input.match("* ")) ACTION_DO_Y(x); + if (input.match(" 0")) ACTION_DO("\\Y", input.extract(1, 1)); + if (input.match("0 ")) ACTION_DO("\\Y", input.extract(0, 1)); } if (cell->type == "$_MUX_") { |