From 753adb38d5471d23315d1bcfc6a744d1c6e03975 Mon Sep 17 00:00:00 2001 From: Korey Sewell Date: Fri, 22 Jun 2007 19:03:42 -0400 Subject: mips import pt. 1 src/arch/mips/SConscript: "mips import pt.1". --HG-- extra : convert_revision : 2e393341938bebf32fb638a209262d074fad4cc1 --- src/base/bitfield.hh | 30 ++++++++++++++++++++++++++++++ src/base/traceflags.py | 1 + 2 files changed, 31 insertions(+) (limited to 'src/base') diff --git a/src/base/bitfield.hh b/src/base/bitfield.hh index 518bad6b8..70a46386e 100644 --- a/src/base/bitfield.hh +++ b/src/base/bitfield.hh @@ -58,6 +58,17 @@ bits(T val, int first, int last) return (val >> last) & mask(nbits); } +/** + * Extract the bit from this position from 'val' and right justify it. + */ +template +inline +T +bits(T val, int bit) +{ + return bits(val, bit, bit); +} + /** * Mask off the given bits in place like bits() but without shifting. * msb = 63, lsb = 0 @@ -101,6 +112,17 @@ insertBits(T val, int first, int last, B bit_val) return ((t_bit_val << last) & bmask) | (val & ~bmask); } +/** + * Overloaded for access to only one bit in value + */ +template +inline +T +insertBits(T val, int bit, B bit_val) +{ + return insertBits(val, bit, bit, bit_val); +} + /** * A convenience function to replace bits first to last of val with bit_val * in place. @@ -113,6 +135,14 @@ replaceBits(T& val, int first, int last, B bit_val) val = insertBits(val, first, last, bit_val); } +/** Overloaded function to allow to access only 1 bit*/ +template +inline +void +replaceBits(T& val, int bit, B bit_val) +{ + val = insertBits(val, bit, bit, bit_val); +} /** * Returns the bit position of the MSB that is set in the input */ diff --git a/src/base/traceflags.py b/src/base/traceflags.py index 6b241c410..fddb86328 100644 --- a/src/base/traceflags.py +++ b/src/base/traceflags.py @@ -128,6 +128,7 @@ baseFlags = [ 'Mbox', 'MemDepUnit', 'MemoryAccess', + 'MipsPRA', 'O3CPU', 'OzoneCPU', 'OzoneLSQ', -- cgit v1.2.3