Skip to content

Checkpoints

Daniel Stanley edited this page Oct 2, 2023 · 2 revisions

The functionality of Fixture is broken into steps called checkpoints. For most checkpoints, the outputs are saved in checkpoint_folder so that they the tool can pick up where it left off if there is an issue, and so that individual steps can be debugged more easily. Not every step here corresponds exactly to one in the checkpoint_folder, but reading this should give you a better idea of how the tool operates.

Config Parse

config_parse.py

  • Read in the config file
  • Instantiate the Template
  • Instantiate the magma circuit

Random Sampling

sampler.py

  • Choose input sample points to build a testbench
  • Use Test.input_domain to determine what the space of inputs for the test is
  • Use Test.signals.random (here) to determine space of optional inputs
  • TODO in addition to random points, do individual sweeps of optional inputs?
  • Sample points saved in checkpoint_folder/Test/input_vectors.txt

Create testbench

create_testbench.py

  • Create the fault testbench using Test.testbench
  • Note that this step is necessary in order to read the testbench results later, even if we don't re-run the sim

Run simulation

simulator.py

  • Handled by fault library, TODO how to run an ac sim?
  • Even if we don't run the sim, we might still call compile_and_run with no_run=True to tell fault to parse results
  • Format of the results depend on the simulator, but typically it uses checkpoint_folder/Test/ as the working/output directory

Results analysis

Code to analyze one datapoint is in Test.analysis, and those results are collected here

  • Go from the raw testbench output to a useful datapoint. This could be as simple as reading the output voltage at the correct time, or as complicated as extracting poles and zeros from a measured step response
  • Extracted results go in checkpoint_folder/Test/extracted_data_unprocessed.csv

Results post-processing

Test.post_process

  • Any further processing of result that requires looking at multiple datapoints at once
  • I don't think any Templates currently use this; it used to be used for the phase blender to look at all the collected phases and figure out where in the [0, 2pi] interval to insert the break
  • Results go in checkpoint_folder/Test/extracted_data.csv

Regression

regression.py

  • Fit coefficients to the model in test.parameter_algebra_vectored
  • Results go in checkpoint_folder/Test/regression_results.yaml

Plotting

plot_helper.py

  • TODO this is currently not controlled by the checkpoint_controller
  • Create plots useful for debugging. There are 2 types; as an example, consider the parameter_algebra out = gain*in+offset
    1. Directly from the equation, so [out] vs [in, optional inputs]
    1. Using parameters, so [gain, offset] vs [optional inputs]. Generally this is comparing the predicted value for gain vs. the "measured" value, which is noisy because it's derived from an equation like gain = (out - offset) / in, and sometimes in is nearly 0, and sometimes the predicted value for other parameters is also bad and messes this up
  • Right now, it basically plots every A vs. B it can within these types (and every C vs. A and B using a contour plot) and it's up to the user to look at the useful ones
  • Results go in plots/

TODO mGenero

mgenero_interface.py This no longer functions now that Fixture is able to produce nonlinear models.

  • mGenero is the library for inserting derived parameters into a Verilog model. This step is when we create the collateral needed for mGenero to run
  • Configuration info for this step is put into a file typically named like mycircuit_mgenero.yaml
  • Output folder for this step is typically used as the mGenero working directory, and it's specified in the configuration yaml file

Clone this wiki locally