Add readout and frontend link functionalities and link-tests.
AIM
- Formalise method to define readout and front-end links to the L1T system boards in the config file.
- Create new unit tests, update associated unit tests and preserve functionality for existing link tests.
- Currently masks the functionality of these links inferring their nature from the terminus associations.
USAGE
The new readout and front-end links can be added in a system config yaml file using the following syntax rules.
- In the
system
section, introduce two new sub-sectionsdaq_boards
andfrontends
.-
daq_boards
will be linked with readout links and modules defined infrontends
will be linked for data input from the detector. - Define at least
inputs
oroutputs
or both with the format<proc_name>:<ports_string_regex>
where<proc_name>
is the config name for the processor or module and<ports_string_regex>
is a comma separated list of ascending ordered port indices without whitespace characters where long ranges can be defined using the "-" character. This requirement applies to bothdaq_boards
andfrontends
. - Boards and modules defined in both sub-sections are internally handled by the
DAQBoards
class with categories defined to be 'RO' for readout and 'FE' for frontend.
-
- In the
system
section, in thelinks
sub-section, add the new readout or front-end links from the boards defined in thedaq_boards
andfrontends
subsection respectively.- The new links will be contextually inferred to be readout or front-end link if either the input or output is a board defined in the
daq_boards
list. - The other link terminus has to be in the
boards
sub-section which lists the core boards in L1T system.
- The new links will be contextually inferred to be readout or front-end link if either the input or output is a board defined in the
Example usage:
system:
...
daq_boards:
RO_dummyboardX:
inputs:
dummyinputprocX: '1-11,21'
frontends:
feX:
outputs:
femproc1: '101-111,121'
...
links:
dummyreadoutlink[1-5]:
from: [boardL1T_1, x0, '101-105']
to: [RO_dummyboardX, dummyinputprocX, '1-5']
...
CHANGES
- In
src/swatch/config.py
- Inparse_system_file()
- Read the new config file definitions, check the input for syntax, parse the ports and create new board and link stubs in the system. - In
src/swatch/console/utilities.py
- Mask the readout and front-end links inferring their nature from the terminus association, until more functionality is known or implemented. - In
src/swatch/config/link-test/dummy.yml
- An example use case with a dummy link-test config file. - In
src/swatch/stubs.py
- Add new stub and stub model for readout and frontend boards. The newDAQBoardStub
class added along with the correspondingDAQBoardStubModel
followed by an update to theSystemStubModel
. - In
src/swatch/system.py
- CreateDAQBoard
class to readDAQBoardStub
and be part of system definition inSystem
class. - Associated updates to unit-tests in files -
tests/config/conftest.py
,tests/config/references/td7_parse_system_file_init.yml
,tests/config/references/td7_parse_system_file_init_link_settings.yml
,tests/config/references/td8_parse_system_file_skeleton_init.yml
,tests/config/test__parse_link_operating_mode__.py
,tests/config/test__parse_link_port_selector__.py
,tests/config/test__parse_link_settings_section__.py
,tests/config/test__parse_multiple_system_files__.py
,tests/config/test_parse_parameter_file__.py
,tests/config/test_parse_system_file__.py
,tests/conftest.py
,tests/stubs/test_stubs_classes.py
andtests/testutils.py
.
ASSOCIATED CHANGES
- Begin adding unit tests for
stubs.py
intests/stubs/
for the base stub classes. Unit tests for onlyDAQBoardStub
added for now. - Unit tests for the pydantic model classes will be skipped due to redundancy with unit tests in
tests/config
. - Add unit tests to
tests/config/test_parse_system_file__.py
for the addeddth_boards
,links
andlink_settings
.
OTHER MINOR CHANGES
Split the unit tests file for parse_system_file()
based on internal functions. In the directory the test/config
the unit tests in test_parse_system_file__.py
are now split with the addition of test__parse_link_operating_mode__.py
, test__parse_link_port_selector__.py
, test__parse_link_settings_section__.py
and test__parse_multiple_system_files__.py
.
This results in some associated changes with
- creation of
tests/testutils.py
- The functions for temporary path are in a utility function and not the pytest inherentconftest.py
. - changes to
tests/conftest.py
- Removal of the functions that were moved to the file above. - creation of
tests/config/conftest.py
- For fixtures shared between the unit tests. - changes to
tests/config/test_parse_parameter_file__.py
- The import statements need to be changed due to the shuffling of globally defined functions between files.
This was necessary to reduce the file size of tests/config/test_parse_system_file__.py
.
Edited by Abanti Ranadhir Sahasransu