pyvsc icon indicating copy to clipboard operation
pyvsc copied to clipboard

Add more documentation for Enums

Open qzcx opened this issue 4 years ago • 1 comments

It would be nice to have more documentation around the enum type. The minimal example given doesn't have any constraints.

Questions I have:

  • What is the proper way to constraint enums using range or weighted constraints?
  • How to use enum to constrain other variables (implies, if_else, ect)
  • What is the purpose of enum_t?

A coworker played with enums for a while, but had trouble getting constraints to work properly so he switched to using rand_bit_t and constraining by enum value instead. I need to get a bug example from him to file, but would love some clarification in the documentation on the intended usage.

qzcx avatar Dec 30 '21 17:12 qzcx

It looks like my coworker was using enum_t instead of rand_enum_t.

The solve failure from doing this isn't clear at all even with solve_fail_debug set.

image

qzcx avatar Dec 30 '21 22:12 qzcx