3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 09:05:32 +00:00

Added support for initialized brams

This commit is contained in:
Clifford Wolf 2015-04-06 17:06:15 +02:00
parent d19866615b
commit 169d1c4711
2 changed files with 45 additions and 9 deletions

View file

@ -474,7 +474,16 @@ struct RTLIL::Const
std::string decode_string() const;
inline int size() const { return bits.size(); }
inline RTLIL::State operator[](int index) { return bits.at(index); }
inline RTLIL::State &operator[](int index) { return bits.at(index); }
inline const RTLIL::State &operator[](int index) const { return bits.at(index); };
inline RTLIL::Const extract(int offset, int len = 1, RTLIL::State padding = RTLIL::State::S0) const {
RTLIL::Const ret;
ret.bits.reserve(len);
for (int i = offset; i < offset + len; i++)
ret.bits.push_back(i < GetSize(bits) ? bits[i] : padding);
return ret;
}
inline unsigned int hash() const {
unsigned int h = mkhash_init;