Skip to content

Allow logging SEE-related messages to file

Stefan Biereigel requested to merge log_file into master

File logging for fault injection

Because simulations with SEE became a bit cumbersome to debug/set up (having to redirect log files etc), I introduced some file logging capabilities. These are the main changes:

  • Added 'log_file' argument to FaultInjector
  • If not provided, everything is logged to console (as usual)
  • If provided, all injection-related messages are stuffed into a log file instead of standard out
  • Status messages (Initialization, summary logs, ...) still always end up in console, but are also added to log file if provided
  • Log level of SEU/SET messages changed from DEBUG to INFO (which is also the default log level
  • DEBUG is now reserved for actual debugging (printing the hierarchy, yosys information etc)

Example use case:

        fi = fault_inj.HierarchyFaultInjector(
            root=self.dut.DUT.adpll_control,
            mttf_timer=fault_inj.BoundedRandomTimer(mttf_min=500000, mttf_max=1000000, units="ps"),
            transient_duration_timer=Timer(1, "ns"),
            injection_strategy=fault_inj.RandomInjectionStrategy(),
            injection_goal=fault_inj.InfiniteInjection(),
            leaf_module_info=tsmc65.see_info(),
            log_file='i2c_see.log')

Will cause in the main log only to appear:

  2100.00ns INFO     Netlist simulation - skipping Yosys sequential element recognition.
  2100.00ns INFO     Using force/release SET injection.
672100.00ns INFO     Starting SEE injection.
4153916.00ns INFO     Injected 4625 SEEs into 30857 nodes.
4154414.59ns INFO     Finished SEE injection.

While i2c_see.log contains:

  2100.00ns INFO     Netlist simulation - skipping Yosys sequential element recognition.
  2100.00ns INFO     Using force/release SET injection.
672100.00ns INFO     Starting SEE injection.
672600.82ns INFO     SEE ID 1: SET in adpll_wrapper.DUT.adpll_control.UNCONNECTED_HIER_Z1079[0].
672600.82ns WARNING  Skipped injection because signal (adpll_wrapper.DUT.adpll_control.UNCONNECTED_HIER_Z1079) is undefined.
673441.94ns INFO     SEE ID 2: SET in adpll_wrapper.DUT.adpll_control.I2C.n_170[0].
674126.24ns INFO     SEE ID 3: SET in adpll_wrapper.DUT.adpll_control.MB.\memgen[36]_MC .memVoterA.g1945.ZN[0].
...
4153916.00ns INFO     Injected 4625 SEEs into 30857 nodes.
4154414.59ns INFO     Finished SEE injection.

Merge request reports