CODA 3.0 VTP/FADC streaming readout with automatic pedestal generation and dynamic configuration file management.
This system automatically generates FADC pedestals and creates runtime configuration files during the CODA download transition. It separates user-defined configuration parameters from runtime-generated configurations, ensuring proper ordering and parameter propagation.
User Config (input)
↓
Parse ALL parameters (VME + VTP)
↓
Validate required parameters
↓
Generate pedestals (fadc250peds)
↓
Generate runtime configs:
- vme_<rocname>.cnf (VME/FADC settings + pedestals)
- vtp_<rocname>.cnf (VTP streaming settings + dynamic payload enable)
↓
Use generated configs for runtime configuration
Two runtime configuration files are created during the download transition.
Their names are built from <rocname>, which is the short hostname of the
ROC (e.g. test2).
| File | Pattern | Example |
|---|---|---|
| VME / FADC config | vme_<rocname>.cnf |
vme_test2.cnf |
| VTP config | vtp_<rocname>.cnf |
vtp_test2.cnf |
Both files are written into the directory given by $CODA_CONFIG.
How <rocname> is determined — producer vs consumer:
-
Producer (
fadc_master_stream_vg.c): reads<rocname>from the first line of the pedestals file ($CODA_DATA/<hostname>_peds.txt). That line has the formatFADC250_CRATE <rocname>, where<rocname>is the short hostname written byfadc250peds. -
Consumer (
vtp_stream3_1udp_vg.c): derives the same value independently at runtime by callinggethostname()and then (1) stripping any trailing whitespace/newlines, (2) removing the domain suffix (everything from the first.onward), and (3) replacing any remaining non-alphanumeric characters (other than_and-) with_.
The two sides must agree. As long as the short hostname reported by the
kernel matches the FADC250_CRATE value in the pedestals file, the consumer
will find the file the producer created.
1. Parse Before Generate
- User config is parsed FIRST to extract all VME and VTP parameters
- All required parameters are validated before any file generation
- Ensures consistency and catches configuration errors early
2. Single Source of Truth
- All configuration parameters defined in user config file (
config/userConfig.txt) - No hardcoded values in runtime configuration generation
- Changes to user config automatically propagate to generated files
3. Generated Files for Runtime
- FADC configured using generated
$CODA_CONFIG/vme_<rocname>.cnf - VTP configured using generated
$CODA_CONFIG/vtp_<rocname>.cnf - User config is input only; runtime uses generated files
4. Dynamic Payload Configuration
- VTP payload ports configured based on
VTP_PAYLOAD_ENfrom config VTP_PAYLOAD_ENdynamically generated from active FADC slots in pedestals- Slot-to-payload translation ensures correct mapping
5. Correct ppmask Accumulation
- Payload mask (
ppmask) accumulated across ALL active payloads using|=operator - Ensures streaming event builder receives data from all configured payloads
- Critical for proper event synchronization
config/userConfig.txt- User-defined configuration (VME + VTP parameters)$CODA_CONFIG/vme_<rocname>.cnf- Generated FADC config (runtime)$CODA_CONFIG/vtp_<rocname>.cnf- Generated VTP config (runtime)$CODA_DATA/<hostname>_peds.txt- Generated pedestals
vme_rol/fadc_master_stream_vg.c- FADC master ROL with config generationrol/vtp_stream3_1udp_vg.c- VTP streaming ROL with dynamic payload config
vtp/vtpLib.{h,c}- VTP hardware interfacevtp/vtpConfig.{h,c}- VTP configuration parsing with streaming parametersfadc250/fadc250Config.{h,c}- FADC configuration parsing
export CODA=/path/to/coda
export CODA_DATA=/path/to/data
export CODA_CONFIG=/path/to/configCreate user config based on config/userConfig.txt template:
# VME/FADC parameters
FADC250_MODE 1
FADC250_W_OFFSET 1200
FADC250_DAC 3270
...
# VTP parameters
VTP_STREAMING_ROCID 0
VTP_STREAMING_DESTIP 129.57.177.25
VTP_STREAMING_MAC 0xCE 0xBA 0xF0 0x03 0x00 0x9d
...
cd vme_rol && make fadc_master_stream_vg.so
cd ../rol && make vtp_stream3_1udp_vg.soPoint CODA run control to your user config file. During download transition:
- System parses user config and validates parameters
- Executes
fadc250pedsto generate pedestals - Creates
vme_<rocname>.cnfandvtp_<rocname>.cnfin$CODA_CONFIG - FADC and VTP configured using generated files
- Automatic pedestal generation during download transition
- Dynamic payload configuration based on active FADC slots
- Parameter validation catches missing/invalid config early
- Comprehensive logging shows which files are used at each phase
- Fallback support for VTP if generated config missing
- ROC name discovery from pedestal file format
- CODA 3.0 framework
fadc250pedstool in$CODA/linuxvme/fadc-peds/- VTP firmware: streamingv3 with EJFAT support
- FADC250 modules in VME crate
VTP v3.10.2 with streaming configuration system