From 556b5c5488e01652ac52ac76337da9533ec6a169 Mon Sep 17 00:00:00 2001 From: Lisa Hsu Date: Thu, 17 Mar 2011 17:01:41 -0700 Subject: Ruby: expose a simple mod function in slicc interface. --- src/mem/protocol/RubySlicc_Util.sm | 2 +- src/mem/ruby/slicc_interface/RubySlicc_Util.hh | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mem') diff --git a/src/mem/protocol/RubySlicc_Util.sm b/src/mem/protocol/RubySlicc_Util.sm index d69be1f5f..92f3f14e8 100644 --- a/src/mem/protocol/RubySlicc_Util.sm +++ b/src/mem/protocol/RubySlicc_Util.sm @@ -55,4 +55,4 @@ bool distributedPersistentEnabled(); Address setOffset(Address addr, int offset); Address makeLineAddress(Address addr); int addressOffset(Address addr); - +int mod(int val, int mod); diff --git a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh index 7fff1525b..81de8e468 100644 --- a/src/mem/ruby/slicc_interface/RubySlicc_Util.hh +++ b/src/mem/ruby/slicc_interface/RubySlicc_Util.hh @@ -182,4 +182,10 @@ addressOffset(Address addr) return addr.getOffset(); } +inline int +mod(int val, int mod) +{ + return val % mod; +} + #endif // __MEM_RUBY_SLICC_INTERFACE_RUBYSLICCUTIL_HH__ -- cgit v1.2.3