readme - asiaa/BURSTT GitHub Wiki
- Kill any running instances of TBS
ps aux | grep borph
note the PID of the running tcpborphserver
kill -9 <PID>
- Install librfdc.so.8.1
In the CASPER RFSoC4x2 Linux image, either replace librfdc.so.1.1
at
/opt/local/lib
with this library, or copy librfdc.so.8.1
to /opt/local/lib
and update the librfdc.so.1
symbolic link to point to this new library.
mv librfdc.so.8.1 /opt/local/lib/librfdc.so.1.1
or
mv librfdc.so.8.1 /opt/local/lib/
cd /opt/local/lib
rm librfdc.so.1
ln -s librfdc.so.8.1 librfdc.so.1
- Install the new tcpborphserver,
tcpborphserver_v8.1
Replace the existing one at /home/casper/bin/
renaming tcpborphserver_v8.1
to tcpborphserver
e.g.,
mv tcpborphserver_v8.1 /home/casper/bin/tcpborphserver3
make sure that tbs has the proper permissions to execute
chmod +x /home/casper/bin/tcpborphserver3
-
Reboot the board
-
Start a telnet or netcat session with the platform
-
check the version of the library using the
?rfdc-driver-ver
command
Version 8.1 is expected to be returned
?rfdc-driver-ver
#rfdc-driver-ver version:\_8.100000
!rfdc-driver-ver ok
# get the rfdc object
In [6]: rfdc = r.adcs.rfdc
## set calibration freeze
# get the calibration freeze status for ADC 00
nblk=0, ntile=0
rfdc.get_cal_freeze(nblk, ntile)
{'CalFreeze': 0, 'DisableCalPin': 0, 'CalibrationFreeze': 0}
# freeze the calibration for ADC 00
rfdc.set_cal_freeze(nblk, ntile, rfdc.CAL_FREEZE)
{'CalFreeze': 1, 'DisableCalPin': 0, 'CalibrationFreeze': 1}
# unfreeze the calibration for ADC 00
rfdc.set_cal_freeze(nblk, ntile, rfdc.CAL_UNFREEZE)
{'CalFreeze': 0, 'DisableCalPin': 0, 'CalibrationFreeze': 0}
## calibration mode
# get calibration mode
nblk=0, ntile=0
rfdc.get_cal_mode(0,0)
2 # indicates mode 2 is the current mode
# set calibration mode
rfdc.set_cal_mode(0,0, rfdc.CAL_MODE1)
1 # indicates mode 1 has been applied
## calibration coeffs
nblk=0, ntile=0
# get calibration coefficients for background calibration blocks OCB1/2
rfdc.get_cal_coeffs(nblk, ntile, rfdc.CAL_BLOCK_OCB1) # or CAL_BLOCK_OCB2
{'Coeff0': '4293263342',
'Coeff1': '4293001175',
'Coeff2': '4294770722',
'Coeff3': '393233',
'Coeff4': '0',
'Coeff5': '0',
'Coeff6': '0',
'Coeff7': '0'}
# get calibration coefficients for background gain calibration block (GCB)
rfdc.get_cal_coeffs(nblk, ntile, rfdc.CAL_BLOCK_OCB1)
{'Coeff0': '2162688',
'Coeff1': '659380',
'Coeff2': '261688808',
'Coeff3': '1114162',
'Coeff4': '0',
'Coeff5': '0',
'Coeff6': '0',
'Coeff7': '0'}
# get calibration coefficients for background time skew block (TSCB)
rfdc.get_cal_coeffs(nblk, ntile, rfdc.CAL_BLOCK_TSCB)
{'Coeff0': '33489407',
'Coeff1': '33489407',
'Coeff2': '33489407',
'Coeff3': '33489407',
'Coeff4': '33489407',
'Coeff5': '33489407',
'Coeff6': '33489407',
'Coeff7': '197119'}
Note that coeff{4-7} only apply to the TSCB and are active when chopping is
active in the calibration scheme.
# set calibration coeffs for any of the calibration blocks. Values here are
# similar to the example shown in RFDC product guide PG269. After setting the
# coefficient values the driver readsback and returns the applied coefficients
coeffs = [136, 255, 255, 137, 255, 225, 255, 136]
rfdc.set_cal_coeffs(nblk, ntile, rfdc.CAL_BLOCK_TSCB, coeffs)
{'Coeff0': '136',
'Coeff1': '255',
'Coeff2': '255',
'Coeff3': '137',
'Coeff4': '255',
'Coeff5': '225',
'Coeff6': '255',
'Coeff7': '136'}
# disabling user provided coefficients and revert to automatic background
# calibration
rfdc.disable_user_coeffs(0,0,rfdc.CAL_BLOCK_TSCB)
# must make a call to `get_cal_coeffs()` to confirm they have been reverted.
rfdc.get_cal_coeffs(0,0,rfdc.CAL_BLOCK_TSCB)
{'Coeff0': '33489407',
'Coeff1': '33489407',
'Coeff2': '33489407',
'Coeff3': '6029823',
'Coeff4': '33489407',
'Coeff5': '33489407',
'Coeff6': '33489407',
'Coeff7': '197119'}
## using the digital step attenuator
# get_dsa(tile-idx, blk-idx), a dictionary of the dsa value is returned
In [7]: rfdc.get_dsa(0, 0)
Out[7]: {'dsa': '10'}
In [8]: rfdc.get_dsa(1, 0)
Out[8]: {'dsa': '0'}
# set_dsa(tile-idx, blk-idx)
In [9]: rfdc.set_dsa(1, 0, 20)
Out[9]: {'dsa': '20'}
# get_output_current(tile-idx, blk-idx)
In [10]: rfdc.get_output_current(0, 0)
Out[10]: {'current': '19993'}
In [11]: rfdc.get_output_current(1, 0)
Out[11]: {'current': '19993'}
# set_vop(tile-idx, blk-idx, curr_uA)
In [12]: rfdc.set_vop(0, 0, 34500)
Out[12]: {'current': '34475'}
# an empty dictionary is returned if targeting a tile/block pair that is
disabled or not available in all DSA/Current commands
In [13]: rfdc.set_dsa(0, 1, 10)
Out[13]: {}
In [14]: rfdc.get_output_current(0, 1)
Out[14]: {}
Get DSA ?rfdc-get-dsa tile-idx blk-idx
Valid ranges for both tile-idx and blk-idx are (0-3). TBS handles range and bound checking. For a disabled tile, block, or unavaiable converter, "(disabled)" is returned.
Example:
?rfdc-get-dsa 0 0
#rfdc-get-dsa dsa\_0
!rfdc-get-dsa ok
?rfdc-get-dsa 0 1
#rfdc-get-dsa (disabled)
!rfdc-get-dsa ok
?rfdc-get-dsa 1 0
#rfdc-get-dsa dsa\_0
!rfdc-get-dsa ok
?Rfdc-get-dsa 1 1
#rfdc-get-dsa (disabled)
!rfdc-get-dsa ok
Set DSA ?rfdc-set-dsa tile-idx blk-idx atten-dB
Valid ranges for both tile-idx and blk-idx are (0-3). TBS handles range and bound checking. The attenuation is read after set and the read value is returned to confirm the correct setting. For a disabled tile, block, or unavaiable converter, "(disabled)" is returned.
Example:
?rfdc-set-dsa 3 0 15
#log info 1620626524.220 raw
request\_set\_adc\_dsa\_tile:\_3,\_blk:\_0\_to\_15.0\_dB
#rfdc-set-dsa dsa\_15
!rfdc-set-dsa ok
?rfdc-set-dsa 3 0 25
#log info 1620626546.242 raw
request\_set\_adc\_dsa\_tile:\_3,\_blk:\_0\_to\_25.0\_dB
#rfdc-set-dsa dsa\_25
!rfdc-set-dsa ok
Get output DAC current ?rfdc-get-output-current tile-idx blk-idx
Example:
?rfdc-get-output-current 2 0
#rfdc-get-output-current current\_19993
!rfdc-get-output-current ok
Valid ranges for both tile-idx and blk-idx are (0-3). TBS handles range and bound checking. For a disabled tile, block, or unavaiable converter, "(disabled)" is returned.
Set VOP current ?rfdc-set-vop tile-idx blk-idx current-uA
Example:
?rfdc-set-vop 2 0 25000
#log info 1620626491.564 raw
request\_set\_dac\_tile:\_2,\_blk:\_0,\_vop:\_25000\_uA
#rfdc-set-vop current\_24981
!rfdc-set-vop ok
Valid ranges for both tile-idx and blk-idx are (0-3). TBS handles range and bound checking on current settings. The current is read after set and the read value is returned to confirm the actual output current. For a disabled tile, block, or unavaiable converter, "(disabled)" is returned.