#include <cstdint>
#include "base/compiler.hh"
Go to the source code of this file.
◆ __SINIC_REG32
#define __SINIC_REG32 |
( |
| NAME, |
|
|
| VAL ) static const uint32_t NAME = (VAL); |
◆ __SINIC_REG64
#define __SINIC_REG64 |
( |
| NAME, |
|
|
| VAL ) static const uint64_t NAME = (VAL); |
◆ __SINIC_VAL32
#define __SINIC_VAL32 |
( |
| NAME, |
|
|
| OFFSET, |
|
|
| WIDTH ) |
Value: static const uint32_t NAME##_width =
WIDTH; \
static const uint32_t NAME##_offset = OFFSET; \
static const uint32_t NAME##_mask = (1 <<
WIDTH) - 1; \
static const uint32_t NAME = ((1 <<
WIDTH) - 1) << OFFSET; \
static inline uint32_t get_##NAME(uint32_t reg) \
{ return (reg & NAME) >> OFFSET; } \
static inline uint32_t set_##NAME(uint32_t reg, uint32_t val) \
{ return (reg & ~NAME) | ((val << OFFSET) & NAME); }
Definition at line 39 of file sinicreg.hh.
◆ __SINIC_VAL64
#define __SINIC_VAL64 |
( |
| NAME, |
|
|
| OFFSET, |
|
|
| WIDTH ) |
Value: static const uint64_t NAME##_width =
WIDTH; \
static const uint64_t NAME##_offset = OFFSET; \
static const uint64_t NAME##_mask = (1ULL <<
WIDTH) - 1; \
static const uint64_t NAME = ((1ULL <<
WIDTH) - 1) << OFFSET; \
static inline uint64_t get_##NAME(uint64_t reg) \
{ return (reg & NAME) >> OFFSET; } \
static inline uint64_t set_##NAME(uint64_t reg, uint64_t val) \
{ return (reg & ~NAME) | ((val << OFFSET) & NAME); }
Definition at line 49 of file sinicreg.hh.