mirror of
https://github.com/verilator/verilator.git
synced 2026-09-01 10:27:04 +02:00
Support queue[$-1] selects.
This commit is contained in:
@@ -413,6 +413,10 @@ public:
|
||||
return m_deque[index];
|
||||
}
|
||||
}
|
||||
// Access with an index counted from end (e.g. q[$])
|
||||
T_Value& atBack(int32_t index) { return at(m_deque.size() - 1 - index); }
|
||||
const T_Value& atBack(int32_t index) const { return at(m_deque.size() - 1 - index); }
|
||||
|
||||
// function void q.insert(index, value);
|
||||
void insert(int32_t index, const T_Value& value) {
|
||||
if (VL_UNLIKELY(index < 0 || index >= m_deque.size())) return;
|
||||
@@ -428,6 +432,12 @@ public:
|
||||
for (int32_t i = lsb; i <= msb; ++i) out.push_back(m_deque[i]);
|
||||
return out;
|
||||
}
|
||||
VlQueue sliceFrontBack(int32_t lsb, int32_t msb) const {
|
||||
return slice(lsb, m_deque.size() - 1 - msb);
|
||||
}
|
||||
VlQueue sliceBackBack(int32_t lsb, int32_t msb) const {
|
||||
return slice(m_deque.size() - 1 - lsb, m_deque.size() - 1 - msb);
|
||||
}
|
||||
|
||||
// For save/restore
|
||||
const_iterator begin() const { return m_deque.begin(); }
|
||||
|
||||
Reference in New Issue
Block a user