Skip to content

System testing with ETROCs

The tamalero software can be used to run basic tests of ETROC2 based modules together with the Readout Board v1/v2 and Power Board vX.

Software emulator

A software emulator with limited functionality can be used by just calling

ipython3 -i test_ETROC.py

Testing with ETROC2

A basic suit of tests can be run with the following command:

ipython3 -i test_ETROC.py -- --kcu IPADDRESS --module MODULENO --test_chip --configuration modulev0b --moduleid 11

--test_chip triggers testing of a physical ETROC2, --configuration selects which board setup to use, --moduleid ID has to be provided to make sure we keep track of which modules we're testing and corresponds to the number on the module PCB.

The default tests consist of the following:

  • Find all connected modules and get them into default configuration. Select the module specified in --module for testing
  • Set the ETROC in the correct data readout mode depending on --mode, default is dual port mode.
  • Apply a pixel mask for known bad pixels according to the provided map --pixel_mask PIXEL_MASK.
  • Show the peripheral configuration and status registers. Green indicates values that are in agreement with the default given in the ETROC2 manual. Keep in mind that some register values have been deliberately changed, so this output just serves as some sanity check.
  • Run a pixel sanity check: Compare the value of that pixel row, col status register PixelID and compare it with the expected value of (col << 4) | row = col*16 + row.
  • Run a check on a random set of pixels, writing to the PixelSanityConfig register that is mirrored in the PixelSanityStat register, therefore the value read from PixelSanityStat should match the one written to PixelSanityConfig.
  • Checking pixel broadcast: write to a pixel configuration register using the broadcast functionality, compare if values that are being read back agree.

After these basic checks, the test setup is further configured as follows:

  • ETROC readout is disabled for all elinks but the ones associated with the module under test. This is known to cause issues and is under investigation If any of the elinks show a high error rate we don't expect the following tests to work.

We proceed to run some data readout tests

  • Set the workMode of the chip to 1 to use internally generated test data. This is not data from noise, Qinj etc.
  • Get internal test data, using the ETROC internal L1A generator, onChipL1AConf. This test is independent of the fast communication path. The resulting occupancy plot will be saved as results/MODULEID/TIMESTAMP/hit_matrix_internal_test_pattern.png.
  • Get internal test data, turning off onChipL1AConf and relying on L1A coming from the KCU board. The resulting occupancy plot will be saved as results/MODULEID/TIMESTAMP/hit_matrix_external_L1A.png.

Aferwards, workMode is set back to 0, using broadcast. This concludes the very basic tests of the ETROC2 modules.

To run charge injection tests, use the following command:

python test_ETROC.py --configuration <Configuration> --kcu <KCU Address> --moduleid <Moduleid> --test_chip --qinj_vth_scan --charges <space-separated list of charges to sweep> --vth_axis <min dac, max dac, \[no. of points\]> --row <pixel row> --col <pixel col> --nl1a <number of pulses to send>

Data from this run will be output to a folder at outputs/<Moduleid>/<timestamp>. The timestamp is provided in the terminal at the beginning of the run.

The following options are available

optional arguments:
  -h, --help            show this help message and exit
  --test_readwrite      Test simple read/write functionality?
  --test_chip           Test simple read/write functionality for real chip?
  --config_chip         Configure chip?
  --configuration {modulev0,modulev0b,multimodule}
                        Board configuration to be loaded
  --vth                 Parse Vth scan plots?
  --rerun               Rerun Vth scan and overwrite data?
  --fitplots            Create individual vth fit plots for all pixels?
  --kcu KCU             IP Address of KCU105 board
  --module {1,2,3}      Module to test
  --host HOST           Hostname for control hub
  --partial             Only read data from corners and edges
  --qinj_scan           Run the phase scan for Qinj
  --qinj                Run some charge injection tests
  --qinj_vth_scan       Run some charge injection tests
  --charge CHARGE       Charge to be injected
  --hard_reset          Hard reset of selected ETROC2 chip
  --skip_sanity_checks  Don't run sanity checks of ETROC2 chip
  --pixelscan {none,full,simple,internal}
                        Which threshold scan to run with ETROC2
  --mode {dual,single}  Port mode for ETROC2
  --threshold THRESHOLD
                        Use thresholds from manual or automatic scan?
  --internal_data       Set up internal data generation
  --enable_power_board  Enable Power Board (all modules). Jumpers must still be set as well.
  --timing_scan         Perform L1Adelay timing scan
  --row ROW             Pixel row to be tested
  --col COL             Pixel column to be tested
  --pixel_mask PIXEL_MASK
                        Pixel mask to apply
  --moduleid MODULEID
  --charges [CHARGES [CHARGES ...]]
                        Charges to inject
  --vth_axis [VTH_AXIS [VTH_AXIS ...]]
                        Threshold DAC values to scan over
  --nl1a NL1A           Number of Qinj/L1A pulses to send
  --multi               Run multiple modules at once (for data taking only!)

Detailed explanation of all options

No options chosen

Runs a very simple check where a default threshold is set for all the pixels and ten L1As are sent.

--moduleid Module identification number used to pair module and collected data. Output data files will be stored in results/<moduleid>/<timestamp>/ and plots will be stored in results/<moduleid>/<timestamp>/. This number is usually on the module, written on a sticker. If no id exists for the module, then a new one may need to be assigned. Necessary for --test_chip or --config_chip

--kcu Chose test stand to use

--configuration ETROC configuration to pass to the Readout Board

--module Choose module slot to use on the Readout Board

--host Hostname for control hub

--enable_power_board Option to be passed to Module class when Power Board is attached to Module and jumpers are correctly attached.

--test_readwrite Test ability to read from and write to pixel registers. This specifically tests broadcasting to the CLSel, DAC pixel registers, and verifies an error is thrown when writing an invaled value to DAC.

--config_chip Checks how long it takes to initalize and configure KCU, RB, and Module (and implicitly if all successfully configure correctly).

--multi An experimental check to see if the KCU can connect to and send fast commands to multiple connected ETROCs. Once connected, sends two L1As to all boards and prints results.

--vth Performs a noise threshold scan if none already exists, otherwise pulls existing data. Plots and saves the results. NOTE: Currently, this does not save to the same location as the rest of the script. Instead, it saves everything to results/. Though setting is not often used, it should be changed to reflect the --moduleid update.

--rerun Rerun --vth data collection, even if there

--fitplots Generate and plot fits for --vth data.

--test_chip Tag used to run ETROC tests. When unmodefied by other script options, checks the following: - How many connected modules (will default to module 0 if multiple are connected and none specified with --module) - Sanity Checks (Output can be skipped, but checks cannot) - ELink Connections - workMode test signal detection (can use --partial to check multiple pixels here)

--mode Options: single, dual

Choose ETROC port mode

--pixel_mask Provide a mask to shut down known problematic pixels. Masks can be created using daq.py (I think)

--threshold Options: manual, auto, FILE

The default is to run an automatic, ETROC2 internal threshold scan, and store the time-stamped values for the provided MODULEID number of the chip in a directory results/MODULEID/TIMESTAMP/. Thresholds from a previously run scan can be applied by running --threshold A/B/MYTHRESHOLDS.yaml.

The manual threshold scan relies on the full data readout (including the FIFO memory), but should yield similar results to the automatic threshold scan. Results are stored in the same directory as above.

--pixelscan Options: simple, internal

It can be useful to run threshold scans with alternative methods to ones provided above. The simple scan runs a threshold scan that does not rely on the FIFO, but working fast communication. The internal scan provides results that are independent of fast communication and only relies on the ETROC internal accumulator register.

--hard_reset Reset the ETROC, using the reset pins on the ETROC2.

--partial Run the basic tests, but only sets the corners and the center to workMode 1 as opposed to the whole chip or a single pixel

--internal_data Turns on workMode for all pixels. Note this happens after the primary tests but before all of the qinj tests, so if will interfere with charge injection results used with any charge injection related option

--qinj Use charge injection for a predecined pattern of pixels.

--charge Charge value to use with --qinj charge injection

--qinj_scan Sweep charge injection delay

--timing_scan Sweep L1A delay, though internal data must be turned on using --internal_data to send data to pixels during operation.

--qinj_vth_scan Sweep Threshold DAC values and send some number of L1As (per DAC value). Hits, TOA, TOT, and CAL data are saved to a yaml file and S-Curve plot is made and saved.

--nl1a Number of pulses to use with --qinj_vth_scan.NOTE: This does not affect operations of --qinj and --qinj_scan.

--vth_axis Options: [VTH_AXIS [VTH_AXIS ...]] Passes either one, two or three integers to define range of Threshold DAC sweep using --qinj_vth_scan. With two integers, defines lower and upper bounds of scan (i.e. --vth_axis MIN MAX). When only one value is used, value is assumed to be max value and min value is assumed to be 0. With three values, defines lower and uppoer bounds, and number of points between (i.e. --vth_axis MIN MAX NVAL). NOTE: This does not affect operations of --qinj and --qinj_scan.

--charges Options: [CHARGES [CHARGES ...]] List of charge values of indeterminant length to be used with --qinj_vth_scan. Accepts integers between 1 and 32, inclusive. NOTE: This does not affect operations of --qinj and --qinj_scan.