IBM / chiffre

A fault-injection framework using Chisel and FIRRTL
Apache License 2.0
34 stars 14 forks source link

Incorrect Bit Widths in Scan Chain with Multiple Faulty Regs #16

Closed aroelke closed 6 years ago

aroelke commented 6 years ago

If two Regs are annotated as being faulty with the same type of injector, they are reported in the scan chain to have the same width even if they don't in the Chisel code (it appears to be the minimum of the widths of the registers annotated). For example, if both reg_fflags and reg_frm in CSR.scala are annotated with StuckAt faults, scan-chain.json will report them to have widths of three even though fflags is five bits wide. This doesn't happen when the injectors are different.

I can't tell if this affects the final circuit, but it does affect the scan chain tool's ability to create a bitstream for LeChiffre.

seldridge commented 6 years ago

This sounds like a bug to me. It may take me some time to get to this this week, but I'll add it to the unit tests. That should uncover whatever is going on.

aroelke commented 6 years ago

I've started trying to fix this with PR #19, but I'm running into a problem with creating/loading the scan chain into LeChiffre. It works fine (i.e. passes my assembly test) if I only annotate one register as faulty, but if I annotate two or more the tests fail. How LeChiffre works and what it does to enable the injectors is hard for me to understand; do you know what might be going on?

aroelke commented 6 years ago

I believe I figured it out. The transform was creating modules for each of the new injectors, but was only instantiating one of them (the rest were all instances of the first one). The latest update to PR #19 should address this.