pcisim.lib.utils
index
../../src/pcisim/lib/utils.py

Provides helper functions and global constants.

 
Modules
       
os
sys

 
Functions
       
get_bin(value, bits)
Get binary representatio string.
 
@PARAMS
    (int) value : value to represent
    (int) bits : number of bits for the value
 
@RETURN
    (str) binary representation.
get_hex(value, bits)
Get hexadecimal representatio string.
 
@PARAMS
    (int) value : value to represent
    (int) bits : number of bits for the value
 
@RETURN
    (str) hexadecimal representation.
humansize(bytesize)
Get an abbreviated string representation for a byte size.
resource_path(resname, respath)
Get a resource path.
 
@PARAMS
    resname : name of the resource file
    respath : relative path of the resource
 
@RETURN
    (str) composed path.

 
Data
        B = 1
BINARY_SUFFIXES = ('B', 'KB', 'MB', 'GB')
GB = 1073741824
KB = 1024
MB = 1048576