cms-gem-daq-project / reg_utils

0 stars 9 forks source link

add an option in gbt.py to set the phase #36

Closed AndrewLevin closed 5 years ago

AndrewLevin commented 6 years ago

Currently, gbt.py can run a phase scan, but cannot set a specific user-requested phase on the GBT.

Description

A set-phase <phase> command has been added to gbt.py and the command has been implemented in gbt_utils.py

Usage:

Usage: gbt.py <oh_num> <gbt_num> <command>
available commands:
  config <config_filename_txt>:   Configures the GBT with the given config file (must use the txt version of the config file, can be generated with the GBT programmer software)
  v3b-phase-scan <base_config_filename_txt>:   Configures the GBT with the given config file, and performs an elink phase scan while checking the VFAT communication for each phase
  set-phase <vfat> <phase>: Set the phase of the elink associated with a specific vfat

Example command:

gbt.py 0 2 set-phase 10 5

Example output:

Open pickled address table if available  /opt/cmsgemos/etc/maps/amc_address_table_top.pickle...

>>>>>>> HELLO, I'M YOUR GBT CONTROLLER :) <<<<<<<

Initial value to write: 2, register GEM_AMC.SLOW_CONTROL.IC.GBTX_LINK_SELECT

---- Setting the phase on the elink associated with OH0 GBT2 VFAT10 to 5 ---- 

bye now..

There is no

Types of changes

Motivation and Context

I found increasing SYNC_ERR_CNTs for one VFAT on the coffin detector, which indicates a phase issue. I have taken a phase scan and found a phase value for which no error occurs, and I would like to be able to set this value on the gbt.

How Has This Been Tested?

The slightly modified version of the script which uses rpc_connect was tested to set the phase on OH0 on eagle64.

Screenshots (if appropriate):

Checklist:

bdorney commented 6 years ago

In the PR can you show a usage example? i.e. how should this be used, what is expected output, etc...

Additionally can you document this change in the v3ElectronicsUserGuide.md under Programming GBTx section.

AndrewLevin commented 6 years ago

In the PR can you show a usage example? i.e. how should this be used, what is expected output, etc...

Additionally can you document this change in the v3ElectronicsUserGuide.md under Programming GBTx section.

I have added example usage and expected output now. I will document the script in the v3 electronics guide once the PR is merged.