Closed AndrewLevin closed 5 years ago
(use on the ctp7 requires commenting and uncommenting some of the import lines).
We will be moving to an rpm based installation on the CTP7's but this will require an updated linux image from the card makers. For this please drop the lines that need to be commented when pushing to the official repo.
Could you please add the help menu printout and some usage examples to the PR description.
@bdorney, I have made all of the requested updates, other than https://github.com/cms-gem-daq-project/reg_utils/pull/33#issuecomment-423893577. Regarding https://github.com/cms-gem-daq-project/reg_utils/pull/33#issuecomment-423893577, it seems the import statements for running on ctp7 and DAQ PC are mutually exclusive. Please clarify what you want.
@bdorney, I have made all of the requested updates, other than #33 (comment). Regarding #33 (comment), it seems the import statements for running on ctp7 and DAQ PC are mutually exclusive. Please clarify what you want.
This code generates an rpm that is installed on a machine. Right now these are installed on the DAQ machine. In the future the linux image of the CTP7 will be updated such that rpm's can be installed on each boot of the OS (if the card is rebooted or power cycled only things under /mnt/persistent/
persist through reboot...everything is reloaded from an image on the card.
So in this future linux image scenario, there will be no commenting/uncommenting import lines. The package is installed and it works out of the box. Please update to reflect this. For testing purposes now you needed the lines, but in the repo don't push them.
So, is it correct that these lines
from reg_utils.reg_interface.common.reg_xml_parser import getNode, parseXML
from reg_utils.reg_interface.common.print_utils import printRed
from reg_utils.reg_interface.common.jtag import initJtagRegAddrs
from reg_utils.reg_interface.common.reg_base_ops import *
will work on the ctp7 in the future, so these lines
#from rw_reg import *
#from mcs import *
can be removed?
That is correct.
OK, the commented import lines are removed now.
@jsturdy, I have addressed all of your comments now
@jsturdy, readAddress
returns an object of type str
representing a hexadecimal value
Side comment, are you casting these as 16 bit integers? Are you sure that's correct? The RPC framework only returns 32 bit integers; you can of course drop the higher bits but only in the case that the higher bits are not used.
The CTP7 registers are all 32 bits, sub registers may exist, e.g. in one 32 bit register you can have two 16 bit counters.
Do these counters that the value you're casting as 16 bit integers only use 16 bits? Or are they 32 bit counters?
@bdorney, the syntax int(XXX,16)
will create an integer with as many bits necessary:
[gemuser@gem904daq01 ~]$ python
Python 2.7.5 (default, Aug 4 2017, 00:39:18)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> int('0x1000',16)
4096
>>> int('0x10000',16)
65536
>>> int('0x1000000000000',16)
281474976710656
>>>
I misread your response, I understand. Thanks for the example. The 16 is the base.
@bdorney, I just created a pull request for sw_utils to add this to the v3 user's guide: https://github.com/AndrewLevin/sw_utils/pull/1
This script first issues a link reset, then reads a register, whose name is an input parameter, n times, where n is also an input parameter.
Description
This script takes three mandatory input parameters: the name of the register to read, the number of times to read the register, and the sleep delay between the reads. There is also an optional output filename parameter.
The script first issues a link reset, then performs the repeated reads, then reports the register values in the form of a python dictionary. Six slow control monitoring registers are also read at the beginning at the end, and their values, and the difference between their initial and final values, is reported in the form of a table.
Help output:
Example command:
Example output:
Types of changes
Motivation and Context
We are trying to investigate an issue of bit slip i.e. a register which should contain a constant does not have a constant value based on tests using gem_reg.py
How Has This Been Tested?
This script has been tested both on the GEM DAQ machines and on the ctp7.
Checklist: