fvutils / pyvsc

Python packages providing a library for Verification Stimulus and Coverage
https://fvutils.github.io/pyvsc
Apache License 2.0
113 stars 26 forks source link

Small issue with partial selection #41

Closed hodjat91 closed 4 years ago

hodjat91 commented 4 years ago

Hi Matthew,

I believe there is a small bug with respect to PyVSC partial selection (please let me know if I'm missing something here): it looks like the part select in PyVSC isn't inclusive in both ends, please look at the below example:

import vsc
imm = vsc.rand_bit_t(4)
imm.set_val(2)
print("imm val is: {}\n".format(imm[1:0]))

This prints 0 instead of 2 (apparently it only prints imm[0]).

Cheers, Hodjat

mballance commented 4 years ago

Hi Hodjat, You're absolutely right: there is an issue with the slice operator used in procedural code (constraints should be fine). I've checked in a fix, which will be available as release 0.2.3 of the library. I'll leave this open until you're able to confirm that the issue is resolved.

Best Regards, Matthew

hodjat91 commented 4 years ago

Hi Matthew,

Thanks for the quick fix. It's solved now.