mirror of
https://github.com/YosysHQ/yosys
synced 2026-03-02 03:36:56 +00:00
Add work_pool_size, IntRange, item_range_for_worker, and ThreadIndex
We'll use these later in this PR.
This commit is contained in:
parent
ae569486a0
commit
61482d30e5
3 changed files with 66 additions and 0 deletions
|
|
@ -299,6 +299,21 @@ auto reversed(const T& container) {
|
|||
return reverse_view{container};
|
||||
}
|
||||
|
||||
// A range of integers [start_, end_) that can be iterated over with a
|
||||
// C++ range-based for loop.
|
||||
struct IntRange {
|
||||
int start_;
|
||||
int end_;
|
||||
struct Int {
|
||||
int v;
|
||||
int operator*() const { return v; }
|
||||
Int &operator++() { ++v; return *this; }
|
||||
bool operator!=(const Int &other) const { return v != other.v; }
|
||||
};
|
||||
Int begin() const { return {start_}; }
|
||||
Int end() const { return {end_}; }
|
||||
};
|
||||
|
||||
YOSYS_NAMESPACE_END
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue