Add ValueInt.from_bits() for signed/unsigned bit pattern conversion#249
Add ValueInt.from_bits() for signed/unsigned bit pattern conversion#249
Conversation
Co-authored-by: mballance <1340805+mballance@users.noreply.github.com>
Co-authored-by: mballance <1340805+mballance@users.noreply.github.com>
|
@copilot, let's revisit this issue. Can we get everything running? |
Co-authored-by: mballance <1340805+mballance@users.noreply.github.com> Agent-Logs-Url: https://github.com/fvutils/pyvsc/sessions/4ea07080-055e-46c7-9696-fbf160a4b395
Co-authored-by: mballance <1340805+mballance@users.noreply.github.com> Agent-Logs-Url: https://github.com/fvutils/pyvsc/sessions/4ea07080-055e-46c7-9696-fbf160a4b395
Two things were needed to get everything running (commit
The |
Hardware interface values stored in
ValueIntare misinterpreted in Python—bit patterns from DUT registers are always treated as unsigned, breaking signed value semantics.Changes
API Addition (
src/vsc/model/value_scalar.py)ValueInt.from_bits(value, width, signed=False)class methodsigned=Trueand MSB is setTests (
ve/unit/test_value_int.py)Documentation (
doc/source/data_types.rst)Usage
Addresses #248
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.