5. Code Docs

5.1. Generator-Module

5.2. Constants-Module

riscv_ctg.constants.gen_sign_dataset(bit_width)[source]

Function to generate the signed data set

riscv_ctg.constants.gen_sp_dataset(bit_width, sign=True)[source]
Function generates a special dataset of interesting values:
  • alternating ones

  • alternating zeros

  • sqrt (bit_width<<1)

  • +/-1 variants of the above

param bit_width

integer defining the size of the input

return

a list of integers

riscv_ctg.constants.gen_usign_dataset(bit_width)[source]

Function to generate the unsigned dataset

riscv_ctg.constants.twos(val, bits)[source]

A function to generate the two’s complement of a number which is of arbitrary width

Parameters
  • val (Union[int, str]) – the input which can be either a hexadecimal string or integer

  • bits (int) – size of the input in terms of bits.