The following list sums up the source code files and configuration files involved -together with a short description of the changes/additions necessary- when adding a completely new -Digital Card based- component to the CALDAQ system.
The example below is based on the work necessary to include the BARREL PRESAMPLER (BPRES) in the readout.
======================================================== component/banks declaration stuff ================================= include/bankbitpattern.inc: - increase NO.COMPONENTS - define component id (bit number in bankbitpattern) - COMPONENT.BITPATT, BANKNAMES include/bankcontrol.inc: - add to BANK.CONTROL (here: BPRES banks): [ PBBA.BANK, BOREOR.BITPATT ], [ PBPM.BANK, BOREOR.BITPATT ], [ PBDC.BANK, EVDATA.BITPATT ], [ PBTE.BANK, EVDATA.BITPATT ], [ PBCO.BANK, EVDATA.BITPATT ], [ PB8S.BANK, EVDATA.BITPATT ], [ PB6S.BANK, EVDATA.BITPATT ], [ PBXO.BANK, EVDATA.BITPATT ], [ PBUM.BANK, EVDATA.BITPATT ], [ PBDM.BANK, EVDATA.BITPATT ], [ PBPQ.BANK, MSIG.BITPATT ], [ PBPP.BANK, MSIG.BITPATT ], [ PBPL.BANK, MSIG.BITPATT ], [ PBPD.BANK, MSIG.BITPATT ], [ PBDU.BANK, MSIG.BITPATT ], include/banks.inc: - adjust MAX.NO.BANKS - add "VAL INT XXxx.BANK IS ...." (with 'XX' the 2-letter id for the component; 'PB' for BPRESAMPLER) - add "VAL INT xxxx.NCOLS IS ..." if needed - add to BANK.NCOLS (here: BPRES banks): [ PBBA.BANK, xxBA.NCOLS ], [ PBPM.BANK, xxPM.NCOLS ], [ PBDC.BANK, PRSD.NCOLS ], [ PBTE.BANK, PRTE.NCOLS ], [ PBCO.BANK, xxCO.NCOLS ], [ PB8S.BANK, PRS8.NCOLS ], [ PB6S.BANK, PRS6.NCOLS ], [ PBXO.BANK, xxXO.NCOLS ], [ PBUM.BANK, xxUM.NCOLS ], [ PBDM.BANK, PRDM.NCOLS ], [ PBPQ.BANK, PRPQ.NCOLS ], [ PBPP.BANK, PRPP.NCOLS ], [ PBPL.BANK, PRPL.NCOLS ], [ PBPD.BANK, PRPD.NCOLS ], [ PBDU.BANK, xxDU.NCOLS ], include/banks_info.inc: - add entries to BANK.INFO - add entries to BANK.DESCR include/banks_maxsize.inc: - add entries to BANK.MAX.NROWS include/banksets.inc: - add bankset entries: ('xxxx' = component name; the actual numbers should be different). VAL INT xxxx.BOR.BANKSET IS 57 : VAL INT xxxx.EOR.BANKSET IS 58 : VAL INT xxxx.NORMAL.BANKSET IS 59 : VAL INT xxxx.ENV.BANKSET IS 60 : VAL INT xxxx.UNO.BANKSET IS 61 : VAL INT xxxx.MS.BANKSET IS 62 : - add banksets (or lists): ('xxxx' = component name). xxxx..BOR.BANKLIST xxxx..EOR.BANKLIST xxxx..NORMAL.BANKLIST xxxx..ENV.BANKLIST xxxx..UNO.BANKLIST xxxx..MS.BANKLIST - add banksets to BANKSET.BANKLIST (=list of banklists) - add banksets list to COMPONENT.BANKSET.LIST (=lists of bankset indices (index into BANKSET.BANKLIST) ordered per trigger type) include/zebra_decl.inc: - add entries for bank headers (2 'holleriths' per bank) include/zebra_init.inc: - add 1 entry per bank in ZEBRA.BANK.NR, ZEBRA.FCAL.BANK.ID, ZEBRA.BCAL.BANK.ID and ZEBRA.RCAL.BANK.ID include/rcparams.inc: - add new control commands for downloading the PM-numbers: ('xxxx' = component name; actual numbers should be different). VAL BYTE GET.xxxx.PM.NUMBERS.LKS IS #5D(BYTE) : VAL BYTE GET.xxxx.PM.NUMBERS.LKC IS #DD(BYTE) : include/dc.inc: - if necessary add DSP code dependent DC page data offsets and number of channels. Declaration/init stuff ====================== libs/decode_hwparams.occ: - add 'xxxx.from.dc, xxxx.for.dc' ('xxxx' = component name). libs/send_numbers.occ: - add 'send.pmnumbers()' call to 'send.numbers()' routine (if PM-numbers are to be downloaded). readout/hwparams_decode.occ: - add 'xxxx.from.dc, xxxx.for.dc' ('xxxx' = component name). readout/hwparams_init.occ: - inititialize 'xxxx.from.dc, xxxx.for.dc' ('xxxx' = component name). include/hwparams_mem.inc: - add 'xxxx.from.dc, xxxx.for.dc' ('xxxx' = component name). readout/caldata.opp: - add ('xxxx' = component name): INT xxxx.pm.numbers.from, xxxx.pm.numbers.for : - add ('xx' = component 2-letter id; 'pb' for BPRESAMPLER): []INT xxco.bank : INT xxco.bank.size : and INT no.xxdc.rows, no.xxte.rows, no.xxco.rows : INT no.xx6s.rows, no.xx8s.rows : INT xxdc.start, xxte.start, xxco.start, xx6s.start, xx8s.start : - add 'make.dummy.pm.numbers()' call - add entries for reception of PM-numbers: IF tag = GET.xxxx.PM.NUMBERS.LKS get.pm.numbers() tag = GET.xxxx.PM.NUMBERS.LKC get.pm.numbers() readout/ro_csb_intf.occ: readout/calib_csb_intf.occ: - add entries for reception of PM-numbers: tag = GET.xxxx.PM.NUMBERS.LKS ... tag = GET.xxxx.PM.NUMBERS.LKC ... readout/calcconst.opp: - add entry for reception of PM-numbers: tag = GET.xxxx.PM.NUMBERS.LKS ... readout/print_hwparams.occ: - add new component to print out Means&Sigma stuff ================= readout/caldata_msinit.occ: - add initialization to 'PROC init.meansigma.stuff()': IF (component.mask /\ BPRES.BITPATT) <> 0 init.meansigma.for.component( COMPONENT.BPRES, BPRES.from.dc, BPRES.for.dc, BPRES.pm.numbers.from, BPRES.pm.numbers.for ) TRUE SKIP readout/caldata_msmem.inc: - add MS-banks for the new component to MSIG.bank.list[][]: [ COMPONENT.BPRES, QINJ.TEST.TRIGGER, PBPQ.BANK ] , [ COMPONENT.BPRES, EMPTY.TEST.TRIGGER, PBPP.BANK ] , [ COMPONENT.BPRES, LED.TEST.TRIGGER, PBPD.BANK ] , [ COMPONENT.BPRES, LASER.TEST.TRIGGER, PBPL.BANK ] , [ COMPONENT.BPRES, UNO.TEST.TRIGGER, PBDU.BANK ] , readout/makemsdatabanks.occ: - add making of the MS-banks: xxPQ.BANK, xxPP.BANK, xxPD.BANK, xxPL.BANK, and xxDU DAQ stuff ========= readout/makeboreorbanks.occ: - add making of: xxPM.BANK xxBA.BANK readout/makedcdatabanks.occ: - add making of: xxDC.BANK xxTE.BANK xx6S.BANK (xx8S.BANK) xxUM.BANK xxDM.BANK readout/makenondcdatabanks.occ: - add making of: xxCO.BANK xxXO.BANK Test tools ========== test/check_readout.occ - add 'xxxx.from.dc, xxxx.for.dc' ('xxxx' = component name). - add 'component = COMPONENT.xxxx' to FUNCTION calc.crate.event.size(). - exclude xx6S and xx8S banks if event sizes without samples are requested. Notes: 1. Run the test tool ('run_check_readout') to get bank lists on a per crate basis and (maximum) event sizes; also run 'run_testtables' to check the consistency of the different bank tables in the include files. 2. When these tests do not detect any problems one can be reasonably confident there will be no runtime errors due to inconsistent bank info or buffers that are too small to contain all event data. 3. Compile the test tools, then run the tools, only then compile the actual CALDAQ stuff. Configuration ============= ~calec_rc/defaults/hwconf/hwconfig.dat: - add Digital Cards with proper component number in appropriate crate, and increase the total number of DCs for that crate. ~calec_rc/defaults/dcconf/dcconf_N.conf with 0<=N<=... - put appropriate numbers to boot a particular DSP code on the new Digital Card(s). ~calec_rc/defaults/*.dat: - set the bankbit for the new component in the bankbit pattern(s) for F, R and/or BCAL; e.g. for BPRESAMPLER with DCs in RCAL: you have to add 0x00004000 to the RCAL 'bankbitpattern' e.g. in ALLCAL_PHYSICS.DAT change line 70001FEE /* RCAL banks PRT=0x80,BPC=0x100,CAMAC=0x200,SRFLT=0x400, */ to 70005FEE /* RCAL banks PRT=0x80,BPC=0x100,CAMAC=0x200,SRFLT=0x400, */ - change the number of DCs in the lines stating the number of cards per crate according to the number of DCs added. PM-number file: - if required make a new PM-number zebra-file using the 'cable2zebra' tool in directory /zeus/transputer/tools/cable2zebra - copy the resulting zebra-file to /zeus/transputer/online/vXX.Y/bin/cablefiles and create a link to this file in /zeus/transputer/online/vXX.Y/bin/host (with XX.Y, the tp-code version number). ~calec_rc/bin/start... - the runcontrol program should point to the new transputer code version if a new version has been made