diff options
Diffstat (limited to 'utils/regtools/include')
-rw-r--r-- | utils/regtools/include/soc_desc.hpp | 10 |
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 | |||
127 | return ((1 << width) - 1) << pos; | 127 | return ((1 << width) - 1) << pos; |
128 | } | 128 | } |
129 | 129 | ||
130 | /** Returns the unshifted bit mask of the field */ | ||
131 | soc_word_t unshifted_bitmask() const | ||
132 | { | ||
133 | // WARNING beware of the case where width is 32 | ||
134 | if(width == 32) | ||
135 | return 0xffffffff; | ||
136 | else | ||
137 | return (1 << width) - 1; | ||
138 | } | ||
139 | |||
130 | /** Extract field value from register value */ | 140 | /** Extract field value from register value */ |
131 | soc_word_t extract(soc_word_t reg_val) const | 141 | soc_word_t extract(soc_word_t reg_val) const |
132 | { | 142 | { |