6-Dec-2000 To modify the master clock code you must first log onto d0ol02 as trgmgr. You can't telnet to it. Currently you can ssh to it, but it's possible that in the future it may require kerberos or cryptocard access. On d0ol02 ---------- 0) rm -r onl_clock if necessary you can check if anything has changed since the last time it was checked out: cvs -n -update -A if nothing has been modified (M), then it's not strictly necessary to remove onl_clock and check it out again note that there are some directories like bin and doc that are created when you do gmake config so that cvs doesn't know about them, hence the ? preceeding them in the update report 1) cvs checkout onl_clock 2) setup -q build:mv162 onl_clock 3) cd onl_clock 4) gmake config 5) edit src/ioc/clkSetup.c if the cvs version is clkSetup.c is current, this is sufficient if another version of clkSetup.c is to be used (e.g. one from ~trgmgr/master_clock/config_files), then first copy it to ~trgmgr/onl_clock/src/ioc/clkSetup.c 6) gmake rebuild recently there have been occassional messages about a clock skew error; you can usually find a time when there is no clock skew if you try gmake rebuild another one or two times If you want to put your new clkSetup.c into cvs, it is strongly recommended that you talk to Fritz Bartlett first. The following procedure whould work, but we haven't been committing things to cvs on our own so it isn't very well tested. 7) cvs -n update -A to check that only clkSetup.c has changed 8) cvs commit src/ioc/clkSetup.c 9) type in a comment to describe the changes 10) tell Fritz that there is a new version to be released Regardless of whether or not clkSetup.c has been committed to cvs, we want to keep track of the versions on our own: 11) cp bin/Vx-mv162/clkSetup ~trgmgr/master_clock/config_files/clkSetup.vX and add a description of this version to the master list of clock files on the web also copy src/ioc/clkSetup.c to ~trgmgr/master_clock/config_files/clkSetup_code.vX if desired It's also necessary to move the new executable to the boot directory if you want to use it! 12) cd /online/ioc/m68k/mv162/d0olct106 (for the trgmgr account, there is an alias: cdboot) 13) mv clkSetup clkSetup.old or some more descriptive name 14) cp ~trgmgr/master_clock/config_files/clkSetup.vX ./clkSetup In terms of playing with the sequencer and the PCC, there are some files in onl_clock/src/ioc that list the available functions: clkPcc.c and clkSeq.c. Note, however, that you then need to include clkPcc.h and clkSeq.h as appropriate (see ~trgmgr/master_clock/config_files/clkSetup_code.v33 for example). What we have primarily been playing with are clkSeqModeFreerunSet(seq)/clkSeqModeSyncSet(seq) and clkPccModeFreerunSet(pcc)/clkPccModeNormalSet(pcc). The code is reasonably easy to follow, and adding a second sequencer looks straight forward if you imitate what has been done for the first sequencer. The base address of the sequencer needs to be specified and then the sequencer is "initialized." This seems to do some software initialization as well as some real hardware initialization. The function returns a pointer to a variable of the type ClkSeqId_t. In the case of the first sequencer, the variable is called seq and is declared right after the function clkSetup begins. Something similar needs to be provided for the second sequencer. It is this variable which is used to talk to the sequencer in the future. Loading the timelines and then releasing the second sequencer should proceed as for the first sequencer. In ~trgmgr/master_clock/config_files, the file clkSetup_code_2nd_sequencer.c attempts to show what needs to be done in order to incorporate the second sequencer. Note that the base address for the second sequencer needs to be set to something sensible and that the timelines need to be programmed.