summaryrefslogtreecommitdiffstats
path: root/utils/regtools/include/soc_desc.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/regtools/include/soc_desc.hpp')
-rw-r--r--utils/regtools/include/soc_desc.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/regtools/include/soc_desc.hpp b/utils/regtools/include/soc_desc.hpp
index 99f8706789..b8d16b423e 100644
--- a/utils/regtools/include/soc_desc.hpp
+++ b/utils/regtools/include/soc_desc.hpp
@@ -127,6 +127,16 @@ struct field_t
return ((1 << width) - 1) << pos;
}
+ /** Returns the unshifted bit mask of the field */
+ soc_word_t unshifted_bitmask() const
+ {
+ // WARNING beware of the case where width is 32
+ if(width == 32)
+ return 0xffffffff;
+ else
+ return (1 << width) - 1;
+ }
+
/** Extract field value from register value */
soc_word_t extract(soc_word_t reg_val) const
{