mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-22 16:45:32 +00:00
Added SAT support for $div and $mod cells
This commit is contained in:
parent
a5836af172
commit
ccf36cb7d8
3 changed files with 55 additions and 0 deletions
|
@ -852,6 +852,12 @@ std::vector<int> ezSAT::vec_sub(const std::vector<int> &vec1, const std::vector<
|
|||
return vec;
|
||||
}
|
||||
|
||||
std::vector<int> ezSAT::vec_neg(const std::vector<int> &vec)
|
||||
{
|
||||
std::vector<int> zero(vec.size(), FALSE);
|
||||
return vec_sub(zero, vec);
|
||||
}
|
||||
|
||||
void ezSAT::vec_cmp(const std::vector<int> &vec1, const std::vector<int> &vec2, int &carry, int &overflow, int &sign, int &zero)
|
||||
{
|
||||
assert(vec1.size() == vec2.size());
|
||||
|
|
|
@ -223,6 +223,7 @@ public:
|
|||
std::vector<int> vec_count(const std::vector<int> &vec, int bits, bool clip = true);
|
||||
std::vector<int> vec_add(const std::vector<int> &vec1, const std::vector<int> &vec2);
|
||||
std::vector<int> vec_sub(const std::vector<int> &vec1, const std::vector<int> &vec2);
|
||||
std::vector<int> vec_neg(const std::vector<int> &vec);
|
||||
|
||||
void vec_cmp(const std::vector<int> &vec1, const std::vector<int> &vec2, int &carry, int &overflow, int &sign, int &zero);
|
||||
|
||||
|
@ -305,6 +306,8 @@ struct ezSATvec
|
|||
ezSATvec(ezSAT &sat, const std::vector<int> &vec) : sat(sat), vec(vec) { }
|
||||
|
||||
ezSATvec operator ~() { return ezSATvec(sat, sat.vec_not(vec)); }
|
||||
ezSATvec operator -() { return ezSATvec(sat, sat.vec_neg(vec)); }
|
||||
|
||||
ezSATvec operator &(const ezSATvec &other) { return ezSATvec(sat, sat.vec_and(vec, other.vec)); }
|
||||
ezSATvec operator |(const ezSATvec &other) { return ezSATvec(sat, sat.vec_or(vec, other.vec)); }
|
||||
ezSATvec operator ^(const ezSATvec &other) { return ezSATvec(sat, sat.vec_xor(vec, other.vec)); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue