-
Notifications
You must be signed in to change notification settings - Fork 10
Expert tools
reg_interface.py
is a python script providing expert level communication with the CTP7 board. It can run on the host PC as well as on the CTP7 card.
Dependendcies:
- rw_reg.py
- librpc_man.so for operations from the host PC
- ctp7 modules required by librpc_man.so
- librw_reg.so for operations from the host PC
Running: python $XHAL_ROOT/python/reg_interface/reg_interface.py
N.B.: reg_interface
uses an address table to access the hardware registers. The address table is supplied in xml
file(s). After the first launch of the program the xml
file will be parsed and a pickle
file will be created from it to speed up subsequent operations. One has to set an appropriate address table file and always make sure that the pickle
d file also corresponds to the desired xml
file. In case the pickle
d file does not correspond to the desired address table or you're not sure, please remove pickle
d file and it will be automatically recreated from the linked xml
.
- $GEM_PATH
- $XHAL_ROOT
The connect
method is required when running from the host PC.
Usage: In order to connect to a given CTP7 card run:
connect <hostname>
Returns the register value. Tab-completion is supported
Usage:
read <registerName>
Writes the value to the register. Tab-completion is supported
Usage:
write <registerName> <value>
Return reads of all the registers containing keyword is their names.
Usage:
kw <keyword>
Return details of the register
Usage:
doc <registerName>
Performs broadcast write or read of a given register to all the optohybrids specified in the mask. Register name parameter should start from the part after OHX in full register name.
Usage:
broadcastOH <OHmask> <command> <registerName>
Example (outdated register!):
broadcastOH 0-3,5 read STATUS.FW.DATE
expected output should look like this (in this system only link 0 has OH connected):
0x65030000 r GEM_AMC.OH.OH0.STATUS.FW.DATE 0x20170505
0x65070000 r GEM_AMC.OH.OH1.STATUS.FW.DATE Bus Error
0x650b0000 r GEM_AMC.OH.OH2.STATUS.FW.DATE Bus Error
0x650f0000 r GEM_AMC.OH.OH3.STATUS.FW.DATE Bus Error
0x65170000 r GEM_AMC.OH.OH5.STATUS.FW.DATE Bus Error
Every time the XML address table receives update, the LMDB address table should be updated as well. Given PR adds a methos update_lmdb
to the reg_interface.py
Usage: after connecting to a given CTP7 card from the host PC, run:
update_lmdb </full/path/on/CTP7/to/new/address_table.xml>