API Documentation
Utility functions¶
-
group
utility
Utility functions.
Functions
-
unsigned int
extract_bits
(uint32_t x, uint32_t msb, uint32_t lsb)¶ extract bits between MSB and LSB (including)
return x[MSB:LSB];
- Return
extracted value (aligned to lsb=0)
- Parameters
x
: Value to extract frommsb
: MSB of extractionlsb
: LSB of extraction
-
void
set_bits
(uint32_t *x, uint32_t v, uint32_t msb, uint32_t lsb)¶ Set bits in variable between MSB and LSB (including)
x[MSB:LSB] = v;
- Parameters
x
: Pointer to value where to setv
: Value to setmsb
: MSB of part to setlsb
: LSB of part to set
-
uint32_t
optimsoc_get_seed
(void)¶ Get a random seed for randomization
This function is used to obtain a random seed from the simulation environment for randomization tests. It has no function when executing in hardware.
It is only random when the actual simulation is seeded with a non-static value.
- Return
(random) seed
-
unsigned int