summaryrefslogtreecommitdiff
path: root/src/mem/ruby/slicc_interface
diff options
context:
space:
mode:
authorJoe Gross <joseph.gross@amd.com>2015-11-13 17:30:56 -0500
committerJoe Gross <joseph.gross@amd.com>2015-11-13 17:30:56 -0500
commit5143d480f381b6f27316646f8129bc452c11c9f8 (patch)
treee2b0829cf4134d0f3f7bafb455af8d7e2bcb8920 /src/mem/ruby/slicc_interface
parentaef8d851bde80f0148ad234d3b216461d364dba3 (diff)
downloadgem5-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.hh13
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__