chisel-formal icon indicating copy to clipboard operation
chisel-formal copied to clipboard

Cover statements for elsewhen, otherwise, and switch

Open danielkasza opened this issue 5 years ago • 2 comments
trafficstars

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.

danielkasza avatar Oct 19 '20 23:10 danielkasza

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

tdb-alcorn avatar Oct 20 '20 17:10 tdb-alcorn

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

danielkasza avatar Nov 01 '20 17:11 danielkasza