-
Notifications
You must be signed in to change notification settings - Fork 11
Test Parameter Sweeping
All tests may be run against the same set of AMI parameter choices, by using the -p option to run_tests.py. This is called "parameter sweeping" and is invoked using a command similar to the following:
./run_tests.py -m <AMI DLL file name> -p <parameter sweep file name, or directory containing several>
A typical parameter sweep definition file might look like this:
Sweep of Tx pre-emphasis filter tap weight values.
('-2_4_2', \
({'root_name' : 'testAMI', \
'ptap' : 2, \
'tap1' : 4, \
'tap2' : 2, \
'inv_ptap' : 1, \
'inv_tap2' : 0, \
'Vod' : 8, \
}, \
{'channel_response' : 'impulse_response_8ma.txt', \
'sample_interval' : 5.0e-12, \
} \
), \
'reference_waveform.txt' \
)
{Any number of additional blocks, like the one above, can follow,}
{but don't repeat the first, description line; only one per file is allowed.}
With the exception of the first line, a parameter sweep definition file is pure Python.
(Note: The first line was deliberately NOT made to be a quoted string, in order to prevent the execution of a parameter sweep definition file, as Python source code.)
Note the use of '' line continuation characters to make the file more readable. They are mandatory, if you split configuration blocks into several lines, as above.
Each configuration block (The example, above, contains exactly one configuration block.) is a tuple, containing the following elements:
- a string label
- a pair of dictionaries
- name of reference waveform file (optional)
and will correspond to one test run (i.e. - one entry in the Test Summary table), in the final output.
The two dictionaries define the Model Specific and Reserved AMI parameters, respectively, to be used for a particular test run.
The reference waveform file will be searched for in the <ref_dir>/<test_name> directory, where <ref_dir> is the directory passed in the --ref_dir option to run_tests.py ("refs/", by default). Note that there is no requirement that the time/frequency interval used to generate the reference waveform be the same as that used in the current test (or even that it be constant throughout the reference data file), as linear interpolation will be used, in order to reformat the reference waveform data for proper plotting. This means that you can, for instance, use the same reference to test model behavior at different values of sample_interval .
In addition to passing a single file name to the -p option of the run_tests.py command, one may, alternatively, pass a directory name. In this case, all files in the specified directory having a '.run' extension will be used for parameter sweeping, for each requested test. In this case, each possible combination of test and parameter sweep definition file will create an entry in the Test Summary table of the final report.