aboutsummaryrefslogtreecommitdiffstats
path: root/passes/opt/opt_expr.cc
Commit message (Collapse)AuthorAgeFilesLines
* Fix handling of z_digit "?" and fix optimization of cmp with "z"Clifford Wolf2019-09-131-0/+4
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Copy-paste typoEddie Hung2019-08-221-1/+1
|
* Respect opt_expr -keepdc as per @cliffordwolfEddie Hung2019-08-221-1/+1
|
* Handle $shift and Y_WIDTH > 1 as per @cliffordwolfEddie Hung2019-08-221-4/+8
|
* Add cover()Eddie Hung2019-08-221-0/+1
|
* Canonical formEddie Hung2019-08-221-5/+5
|
* opt_expr to trim A port of $shiftx if Y_WIDTH == 1Eddie Hung2019-08-211-0/+17
|
* Merge pull request #1283 from YosysHQ/clifford/fix1255Clifford Wolf2019-08-171-1/+2
|\ | | | | Fix various NDEBUG compiler warnings
| * Merge branch 'master' into clifford/fix1255Clifford Wolf2019-08-151-356/+404
| |\
| * | Fix various NDEBUG compiler warnings, closes #1255Clifford Wolf2019-08-131-1/+2
| | | | | | | | | | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* | | Use ID::keep more liberally tooEddie Hung2019-08-151-1/+1
| | |
* | | Use more ID::{A,B,Y,blackbox,whitebox}Eddie Hung2019-08-151-159/+159
| | |
* | | FixEddie Hung2019-08-151-2/+2
| | |
* | | Convert a few more to IDEddie Hung2019-08-151-20/+20
| |/ |/|
* | Merge branch 'master' into clifford/idsClifford Wolf2019-08-151-1/+49
|\ \
| * | Merge remote-tracking branch 'origin/master' into eddie/fix_1262Eddie Hung2019-08-111-35/+30
| |\|
| * | Wrong way aroundEddie Hung2019-08-101-2/+2
| | |
| * | cover_list -> cover as per @cliffordwolfEddie Hung2019-08-101-2/+2
| | |
| * | GrammarEddie Hung2019-08-091-1/+1
| | |
| * | Separate $alu handlingEddie Hung2019-08-091-7/+50
| | |
| * | opt_expr -fine to trim LSBs of $alu tooEddie Hung2019-08-091-4/+9
| | |
* | | Use ID() macro in all of passes/opt/Clifford Wolf2019-08-111-360/+360
| |/ |/| | | | | | | | | | | | | | | | | This was obtained by running the following SED command in passes/opt/ and then using "meld foo.cc foo.cc.orig" to manually fix all resulting compiler errors. sed -i.orig -r 's/"\\\\([a-zA-Z0-9_]+)"/ID(\1)/g; s/"(\$[a-zA-Z0-9_]+)"/ID(\1)/g;' *.cc Signed-off-by: Clifford Wolf <clifford@clifford.at>
* | Merge remote-tracking branch 'origin/master' into eddie/cleanupEddie Hung2019-08-071-0/+25
|\|
| * Move LSB-trimming functionality from wreduce to opt_exprEddie Hung2019-08-061-0/+25
| |
* | Cleanup opt_expr.ccEddie Hung2019-08-061-35/+30
|/
* Improve opt_expr and opt_clean handling of (partially) undriven and/or ↵Clifford Wolf2019-05-031-4/+9
| | | | | | unused wires, fixes #981 Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Add handling of init attributes in "opt_expr -undriven"Clifford Wolf2019-04-301-2/+41
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Add log_debug() frameworkClifford Wolf2019-04-221-34/+45
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Improve handling of and-with-1 and or-with-0 in opt_expr, fixes #327Clifford Wolf2019-03-141-0/+7
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Merge pull request #770 from whitequark/opt_expr_cmpClifford Wolf2019-01-021-97/+134
|\ | | | | opt_expr: refactor and improve simplification of comparisons
| * opt_expr: improve simplification of comparisons with large constants.whitequark2019-01-021-70/+47
| | | | | | | | | | | | | | | | | | | | | | | | The idea behind this simplification is that a N-bit signal X being compared with an M-bit constant where M>N and the constant has Nth or higher bit set, it either always succeeds or always fails. However, the existing implementation only worked with one-hot signals for some reason. It also printed incorrect messages. This commit adjusts the simplification to have as much power as possible, and fixes other bugs.
| * opt_expr: refactor simplification of unsigned X<onehot and X>=onehot. NFCI.whitequark2019-01-021-31/+37
| |
| * opt_expr: refactor simplification of signed X>=0 and X<0. NFCI.whitequark2019-01-021-24/+26
| |
| * opt_expr: simplify any unsigned comparisons with all-0 and all-1.whitequark2019-01-021-17/+69
| | | | | | | | | | | | Before this commit, only unsigned comparisons with all-0 would be simplified. This commit also makes the code handling such comparisons to be more rigorous and not abort on unexpected input.
* | Fix typographical and grammatical errors and inconsistencies.whitequark2019-01-021-1/+1
|/ | | | | | | | | | | | The initial list of hits was generated with the codespell command below, and each hit was evaluated and fixed manually while taking context into consideration. DIRS="kernel/ frontends/ backends/ passes/ techlibs/" DIRS="${DIRS} libs/ezsat/ libs/subcircuit" codespell $DIRS -S *.o -L upto,iff,thru,synopsys,uint More hits were found by looking through comments and strings manually.
* Bugfix in opt_expr handling of a<0 and a>=0Clifford Wolf2018-12-061-1/+1
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Consistent use of 'override' for virtual methods in derived classes.Henner Zeller2018-07-201-2/+2
| | | | | | | | | o Not all derived methods were marked 'override', but it is a great feature of C++11 that we should make use of. o While at it: touched header files got a -*- c++ -*- for emacs to provide support for that language. o use YS_OVERRIDE for all override keywords (though we should probably use the plain keyword going forward now that C++11 is established)
* Add optimization of tristate buffer with constant control inputClifford Wolf2018-05-121-0/+17
| | | | Signed-off-by: Clifford Wolf <clifford@clifford.at>
* Don't track , ... contradictions through x/z-bitsClifford Wolf2017-08-251-1/+4
|
* Add removing of redundant pairs of bits in ==, ===, !=, and !== to opt_exprClifford Wolf2017-08-251-0/+72
|
* Add "opt_expr -fine" feature to remove neutral bits from reduce and logic ↵Clifford Wolf2017-07-261-0/+47
| | | | operators
* Fix and_or_buffer optimization in opt_expr for signed operatorsClifford Wolf2017-07-011-2/+2
|
* Squelch trailing whitespaceLarry Doolittle2017-04-121-3/+3
|
* Fixed some "used uninitialized" warnings in opt_exprClifford Wolf2017-02-111-1/+2
|
* Add optimization of (a && 1'b1) and (a || 1'b0)Clifford Wolf2017-02-111-7/+22
|
* Fix issue #306, "Bug in opt -full"C-Elegans2017-02-101-1/+19
| | | | | | Add check for whether the high bit in the constant expression is greater than the width of the variable, and optimizes that to a constant 1 or 0
* Fix indenting and log messages in code merged from opt_compare_prClifford Wolf2017-01-311-102/+120
|
* Refactor and generalize the comparision optimizationC-Elegans2017-01-301-22/+42
| | | | | | | | Generalizes the optimization to: a < C, a >= C, C > a, C <= a
* Do not use b.as_int() in calculation of bit setC-Elegans2017-01-211-8/+29
|
* Optimize compares to powers of 2C-Elegans2017-01-161-0/+61
| | | | | | | | | | | | | | | Remove opt_compare and put comparison pass in opt_expr assuming a [7:0] is unsigned a >= (1<<x) becomes |a[7:x] a < (1<<x) becomes !a[7:x] Additionally: a >= 0 becomes constant true, a < 0 becomes constant false delete opt_compare.cc revert opt.cc to commit b7cfb7dbd (remove opt_compare step)