diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-06-13 19:51:13 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-06-13 19:51:13 +0200 |
commit | 30db70b1baaad1f299234b419ac2dc581eee1e14 (patch) | |
tree | eaa40205b162ec41f9fa2fbc37f1bcdb024341b4 /kernel | |
parent | 7f6c83a853e1d127365169e018f44faaac405326 (diff) | |
download | yosys-30db70b1baaad1f299234b419ac2dc581eee1e14.tar.gz yosys-30db70b1baaad1f299234b419ac2dc581eee1e14.tar.bz2 yosys-30db70b1baaad1f299234b419ac2dc581eee1e14.zip |
Added consteval testing to xsthammer and fixed bugs
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/celltypes.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/celltypes.h b/kernel/celltypes.h index cc84251c3..cd72192af 100644 --- a/kernel/celltypes.h +++ b/kernel/celltypes.h @@ -185,6 +185,14 @@ struct CellTypes static RTLIL::Const eval(std::string type, const RTLIL::Const &arg1, const RTLIL::Const &arg2, bool signed1, bool signed2, int result_len) { + if (type == "$sshr" && !signed1) + type = "$shr"; + if (type == "$sshl" && !signed1) + type = "$shl"; + + if (!signed1 || !signed2) + signed1 = false, signed2 = false; + #define HANDLE_CELL_TYPE(_t) if (type == "$" #_t) return const_ ## _t(arg1, arg2, signed1, signed2, result_len); HANDLE_CELL_TYPE(not) HANDLE_CELL_TYPE(and) |