URL
https://opencores.org/ocsvn/or1k_old/or1k_old/trunk
Go to most recent revision |
Show entire file |
Details |
Blame |
View Log
Rev 253 |
Rev 559 |
Line 52... |
Line 52... |
#define FIELD_SHIFT(reg_name,field_name) (reg_name##_##field_name##_OFFSET)
|
#define FIELD_SHIFT(reg_name,field_name) (reg_name##_##field_name##_OFFSET)
|
#define FIELD_MASK(reg_name,field_name) ((~(~0LU << reg_name##_##field_name##_WIDTH)) << reg_name##_##field_name##_OFFSET)
|
#define FIELD_MASK(reg_name,field_name) ((~(~0LU << reg_name##_##field_name##_WIDTH)) << reg_name##_##field_name##_OFFSET)
|
|
|
#define GET_FIELD(reg_value,reg_name,field_name) (((reg_value) >> reg_name##_##field_name##_OFFSET) & (~(~0LU << reg_name##_##field_name##_WIDTH)))
|
#define GET_FIELD(reg_value,reg_name,field_name) (((reg_value) >> reg_name##_##field_name##_OFFSET) & (~(~0LU << reg_name##_##field_name##_WIDTH)))
|
#define SET_FIELD(reg_value,reg_name,field_name,field_value) { \
|
#define SET_FIELD(reg_value,reg_name,field_name,field_value) { \
|
(reg_value) &= ~((~(~0LU << reg_name##_##field_name##_WIDTH)) << reg_name##_##field_name##_OFFSET); \
|
(reg_value) = ((reg_value) & ~((~(~0LU << reg_name##_##field_name##_WIDTH)) << reg_name##_##field_name##_OFFSET)) | ((field_value) << reg_name##_##field_name##_OFFSET); }
|
(reg_value) |= (field_value) << reg_name##_##field_name##_OFFSET; }
|
|
|
|
|
|
|
|
#endif /* __FIELDS_H */
|
#endif /* __FIELDS_H */
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.