API Documentation

Utility functions

group utility

Utility functions


static unsigned int extract_bits(uint32_t x, uint32_t msb, uint32_t lsb)

extract bits between MSB and LSB (including)

return x[MSB:LSB];

extracted value (aligned to lsb=0)
  • x: Value to extract from
  • msb: MSB of extraction
  • lsb: LSB of extraction

static 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;

  • x: Pointer to value where to set
  • v: Value to set
  • msb: MSB of part to set
  • lsb: 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.

(random) seed