diff options
author | Joe Gross <joseph.gross@amd.com> | 2015-11-13 17:30:56 -0500 |
---|---|---|
committer | Joe Gross <joseph.gross@amd.com> | 2015-11-13 17:30:56 -0500 |
commit | 5143d480f381b6f27316646f8129bc452c11c9f8 (patch) | |
tree | e2b0829cf4134d0f3f7bafb455af8d7e2bcb8920 /src/mem/ruby/slicc_interface | |
parent | aef8d851bde80f0148ad234d3b216461d364dba3 (diff) | |
download | gem5-5143d480f381b6f27316646f8129bc452c11c9f8.tar.xz |
ruby: add BoolVec
The BoolVec typedef and insertion operator overload function simplify usage of
vectors of type bool
Diffstat (limited to 'src/mem/ruby/slicc_interface')
-rw-r--r-- | src/mem/ruby/slicc_interface/RubySlicc_Util.hh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh index 61813bb30..4a48d3efe 100644 --- a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh +++ b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh @@ -38,6 +38,7 @@ #include "debug/RubySlicc.hh" #include "mem/packet.hh" #include "mem/ruby/common/Address.hh" +#include "mem/ruby/common/BoolVec.hh" #include "mem/ruby/common/DataBlock.hh" #include "mem/ruby/common/TypeDefines.hh" @@ -125,4 +126,16 @@ testAndWrite(Addr addr, DataBlock& blk, Packet *pkt) return false; } +inline int +countBoolVec(BoolVec bVec) +{ + int count = 0; + for (const auto &it: bVec) { + if (it) { + count++; + } + } + return count; +} + #endif // __MEM_RUBY_SLICC_INTERFACE_RUBYSLICCUTIL_HH__ |