Reference files#
A reference file describes the permitted values for a collection of sensors.
File naming convention#
Naming convention for reference files is given in the table below.
Values between {} are mandatory while those between [] are optional.
grammar |
definition |
exemple |
|---|---|---|
{part_number}[_suite][_gateware][frequency]{version}.csv |
unique file name |
|
{part_number} |
part number of the board or devkit |
|
[_suite] |
the test suite |
|
[_gateware] |
the gateware loaded in the main FPGA |
|
[_frequency] |
running frequency of the FPGA logic in MHz |
|
{version} |
semantic versioning without dot |
|
CLI option to supersede reference file defined in scenario#
The path to the reference file is defined in the scenario file.
It can be supersed by using the CLI option
--prefReference file is located either in the invocation directory of the CLI or in the package
p400ref. The file is search in the invocation directory and then in the package. It can be abbreviated to the file name without extension, e.g.p400x101x_100.
Path to reference files in python code#
The path to the package
p400refis stored in the variablePATH_REFS:from p400ref import PATH_REFS pref = PATH_REFS.joinpath("p400x101x_100.csv") print(pref.exists())
Alternative (preferred one):
from p400uc import PATH_REFS pref = PATH_REFS.joinpath("p400x101x_100.csv") print(pref.exists())
Parameters defining a reference#
A reference is modeled by a CSV file with 6 columns:
sensor |
min |
max |
value |
list |
dict |
comment |
|---|---|---|---|---|---|---|
i_m13_out1_0v9 |
0 |
9 |
from datasheet |
|||
ping_m13 |
LTM4677 |
from datasheet |
||||
c_m13_status |
LTM4677 |
{“a: true, “b”: false} |
- sensor (str)
name of the sensor as defined in test suite
- min (float, int, None)
measured value has to be greater or equal to the minimum value
- max (float, int, None)
measured value has to be less or equal to the maximum value
- value (float, int, str, None)
measured value has to be equal to the value
- list (str)
list of values separated by
,. The measured value has to be equal to one of the element in the list- dict (str)
dictionary of values encoded as a JSON string. The unitary test returns a dictionary which has to be equal to the reference one. It is mainly used to handle status of a component
- comment (str)
message to explain the origin of the reference values