From 30db70b1baaad1f299234b419ac2dc581eee1e14 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Thu, 13 Jun 2013 19:51:13 +0200 Subject: Added consteval testing to xsthammer and fixed bugs --- kernel/celltypes.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kernel/celltypes.h') diff --git a/kernel/celltypes.h b/kernel/celltypes.h index cc84251c..cd72192a 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) -- cgit v1.2.3