So im using the value stored in an ValueInt object in python and the stored binary value which works correctly with dut interface always gets misinterpreted in Python world because python infers the given numbers as unsigend. I think having a $signed helper method in ValueInt class can be helpful to prevent such problems. I have currently implemented a $signed function in this way:
def signed(numb, width):
if (numb >> (width-1)):
return(-((2 ** width) - numb))
else:
return numb