Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 2.47 KB

README.md

File metadata and controls

28 lines (19 loc) · 2.47 KB

Operational Scripts

These two scripts are cornerstones of the fault injection campaigns. One interacts with the other and are ment for internal use by the parental Makefile. All options for the scripts below are specified via the Makefile in the form of environment variables. See make help for example usage.

_compute_errors.py

This script is copied in every vlog compilation within the file where the logic simulator is invoked from. It expects the file __to_py.csv to be present, which corresponds to the results of a single the fault injection campaign. That is, the simulation of the whole dataset under the presense of a stuck-at fault on the CUT. The csv file is comprised of two columns. The csv header is the following:

golden_value,computed_value

The first column corresponds to the responses of the golden machine (fault-free) whereas the second corrseponds to the responses of the faulty machine, respectively. This csv file is generated by the testbench after all operands have been exhausted (i.e., the dataset has been fully simulated).

The goal of the _compute_errors.py script is to source the said csv file and compute three error metrics, namely:

  • the mean average error (MAE)
  • the mean squared error (MSE)
  • the mean relative error (MRE)

It is an interanal file and is invoked solely by the fault simulation TCL script.

fault_simulation.tcl

This script runs the fault injection campaigns. It operates on two modes:

  1. "fault injection" injects one stuck-at fault at a time, simulates the specified dataset under the pressence of the fault, invokes the aforementioned python3 script to compute the error metrics and logs them to a statistics csv file.
  2. "failure rate" injects one stuck-at fault at a time, simulates the dataset under the pressense of the fault and keeps the __to_py.csv files generated by each stuck-at fault by renaming them from __to_py.csv to [fault_site].csv where fault site corresponds to the hierarhical location in the CUT where the fault is injected by replacing / with -.

⚠️ Depending on the size of the CUT's fault list and size of input patterns dataset, mode "failure rate" may generate a huge volume of files since for each fault one csv file is generated and kept.

The default mode, specified by the parental Makefile is "fault injection".