|
unsigned(value,
size)
Make a value unsigned based on it's size. |
source code
|
|
|
signed(value,
size)
Make a value signed based on it's size. |
source code
|
|
|
|
|
sign_extend(value,
cursize,
newsize)
Take a value and extend it's size filling in the space with the value
of the high order bit. |
source code
|
|
|
|
|
is_parity_byte(bval)
An "optimized" parity checker that looks up the index. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
parsebytes(bytes,
offset,
size,
sign=False,
bigend=False)
Mostly for pulling immediates out of strings... |
source code
|
|
|
slowparsebytes(bytes,
offset,
size,
sign=False,
bigend=False) |
source code
|
|
|
|
|
|
|
|
|
|
|
binrepr(intval,
bitwidth=None)
Return a string of one's and zero's for the given value. |
source code
|
|
|
binary(binstr)
Decode a binary string of 1/0's into a python number |
source code
|
|
|
binbytes(binstr)
Decode a binary string of 1/0's into a python binary string. |
source code
|
|
|
parsebits(bytes,
offset,
bitoff,
bitsize)
Parse bitsize bits from the bit offset bitoff beginning at offset
bytes. |
source code
|
|
|
MAX_WORD = 8
|
|
u_maxes = [ 0, 255, 65535, 16777215, 4294967295, 1099511627775, ...
|
|
sign_bits = [ 0, 128, 32768, 8388608, 2147483648, 549755813888, ...
|
|
s_maxes = [ 0, 127, 32767, 8388607, 2147483647, 549755813887, 1...
|
|
b_masks = [ 0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, ...
|
|
parity_table = [ True, False, False, True, False, True, True, F...
|
|
le_fmt_chars = ( None, ' B ' , ' <H ' , None, ' <L ' , None, None, None, ...
|
|
be_fmt_chars = ( None, ' B ' , ' >H ' , None, ' >L ' , None, None, None, ...
|
|
hex_fmt = { 1: ' 0x%.2x ' , 2: ' 0x%.4x ' , 4: ' 0x%.8x ' , 8: ' 0x%.16x ' }
|
|
__package__ = ' envi '
|
|
i = 255
|