tdb-alcorn / chisel-formal

Other
23 stars 3 forks source link

Cover statements for elsewhen, otherwise, and switch #8

Open danielkasza opened 4 years ago

danielkasza commented 4 years ago

Cover statements are automatically added for when, but not for elsewhen, otherwise, and switch.

I can see two ways around this:

  1. Add cover statements for all of these.
  2. Do not automatically add cover statements for when either.

I am actually leaning toward 2 because I do not like that chisel-formal provides its own version of when.

Another option I am exploring is to use a FIRRTL transform to inject these cover statements instead.

tdb-alcorn commented 4 years ago

Good point. I'll wait to see how you handle this with FIRRTL transforms, IMO that's ultimately the right approach.

danielkasza commented 4 years ago

FIRRTL transform approach seems to work well: https://github.com/danielkasza/dank-formal/blob/main/src/main/scala/transforms.scala