diff options
author | Clifford Wolf <clifford@clifford.at> | 2013-08-15 14:40:26 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2013-08-15 14:40:26 +0200 |
commit | 457dc09cdc3546d70eb347d35ad28ffca1621f7d (patch) | |
tree | 81129b260db30c397e908d994fc8b37dd503815f /libs | |
parent | 2f3da54f269fac5dab4b03eec80182c534f8c28f (diff) | |
download | yosys-457dc09cdc3546d70eb347d35ad28ffca1621f7d.tar.gz yosys-457dc09cdc3546d70eb347d35ad28ffca1621f7d.tar.bz2 yosys-457dc09cdc3546d70eb347d35ad28ffca1621f7d.zip |
Added ezsat api for creation of anonymous vectors
Diffstat (limited to 'libs')
-rw-r--r-- | libs/ezsat/ezsat.cc | 8 | ||||
-rw-r--r-- | libs/ezsat/ezsat.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libs/ezsat/ezsat.cc b/libs/ezsat/ezsat.cc index 4258fb6fe..27e74e010 100644 --- a/libs/ezsat/ezsat.cc +++ b/libs/ezsat/ezsat.cc @@ -667,6 +667,14 @@ std::vector<int> ezSAT::vec_const_unsigned(uint64_t value, int bits) return vec; } +std::vector<int> ezSAT::vec_var(int bits) +{ + std::vector<int> vec; + for (int i = 0; i < bits; i++) + vec.push_back(literal()); + return vec; +} + std::vector<int> ezSAT::vec_var(std::string name, int bits) { std::vector<int> vec; diff --git a/libs/ezsat/ezsat.h b/libs/ezsat/ezsat.h index 4a6a72785..3fb5fcaf6 100644 --- a/libs/ezsat/ezsat.h +++ b/libs/ezsat/ezsat.h @@ -208,6 +208,7 @@ public: std::vector<int> vec_const_signed(int64_t value, int bits); std::vector<int> vec_const_unsigned(uint64_t value, int bits); + std::vector<int> vec_var(int bits); std::vector<int> vec_var(std::string name, int bits); std::vector<int> vec_cast(const std::vector<int> &vec1, int toBits, bool signExtend = false); |