Commit 9256e0a0 authored by David Cussans's avatar David Cussans

Changing script for new firmware version (has PulseT0 register replaced by setRunActiveRW

parent ee6e8d43
# TLU Software # TLU Software
The repository contains Python scripts used to test the hardware (the firm(gate)ware is contained in the fmc-mtlu-gw repositor. These scripts rely on a few libraries contained in the "packages" folder as well as on uHAL. This repository contains software for AIDA-2020 TLU. I can be used with all variants: V1C (T-shaped pcb) , V1E and V1F (rectangular PCBs; the one most likely to be used outside the UoB lab).
The repository contains Python scripts used to test the hardware (the firm(gate)ware is contained in the fmc-mtlu-gw repository). These scripts rely on a few libraries contained in the "packages" folder as well as on uHAL.
Ensure your python environmental variable is set to include the packages folder and that uHAL is installed on the machine. Ensure your python environmental variable is set to include the packages folder and that uHAL is installed on the machine.
uHAL can be installed from here: uHAL can be installed from here:
~https://svnweb.cern.ch/trac/cactus/wiki/uhalQuickTutorial~
http://ipbus.web.cern.ch/ipbus/doc/user/html/software/index.html http://ipbus.web.cern.ch/ipbus/doc/user/html/software/index.html
## Controlling AIDA TLU with Python Script ## Controlling AIDA TLU with Python Script
```startTLU_v1e.py``` ```
cd TLU_v1e/scripts
python2 ./startTLU_v1e.py
```
Connects to TLU. Allows interactive control. Connects to TLU. Allows interactive control.
...@@ -19,10 +22,10 @@ Reads initialization (start up) parameters from `localIni.ini` ( default clock ...@@ -19,10 +22,10 @@ Reads initialization (start up) parameters from `localIni.ini` ( default clock
Reads configuration parameters from `localConf.conf` Reads configuration parameters from `localConf.conf`
Initialization and configuration files are in EUDAQ format. Initialization and configuration files are in EUDAQ2 format.
# EUDAQ2 # EUDAQ2
The best way to operate on the TLU is by using the EUDAQ2 tools. The best way to control and read out data from the TLU is by using the EUDAQ2 tools.
Refer to the official EUDAQ2 page for instructions on how to install it. Refer to the official EUDAQ2 page for instructions on how to install them.
https://github.com/eudaq/eudaq https://github.com/eudaq/eudaq
...@@ -460,11 +460,23 @@ class TLU: ...@@ -460,11 +460,23 @@ class TLU:
print "\tIgnoreShutterVeto read back as:" , IgnoreShutterVeto print "\tIgnoreShutterVeto read back as:" , IgnoreShutterVeto
return IgnoreShutterVeto return IgnoreShutterVeto
def pulseT0(self): # def pulseT0(self):
# cmd = int("0x1",16)
# self.hw.getNode("Shutter.PulseT0").write(cmd)
# self.hw.dispatch()
# print "\tPulsing T0"
def setRunActive(self):
cmd = int("0x1",16) cmd = int("0x1",16)
self.hw.getNode("Shutter.PulseT0").write(cmd) self.hw.getNode("Shutter.RunActiveRW").write(cmd)
self.hw.dispatch() self.hw.dispatch()
print "\tPulsing T0" print "\tSet run active (pulses T0)"
def setRunInactive(self):
cmd = int("0x0",16)
self.hw.getNode("Shutter.RunActiveRW").write(cmd)
self.hw.dispatch()
print "\tSet run inactive"
def readEEPROM(self, startadd, bytes): def readEEPROM(self, startadd, bytes):
mystop= 1 mystop= 1
...@@ -934,7 +946,9 @@ class TLU: ...@@ -934,7 +946,9 @@ class TLU:
self.setRecordDataStatus(False) self.setRecordDataStatus(False)
# Pulse T0 # Pulse T0
self.pulseT0() #self.pulseT0()
# Set run active
self.setRunActive()
print " Turning off software trigger veto" print " Turning off software trigger veto"
self.setTriggerVetoStatus( int("0x0",16) ) self.setTriggerVetoStatus( int("0x0",16) )
...@@ -957,6 +971,9 @@ class TLU: ...@@ -957,6 +971,9 @@ class TLU:
print " Turning on software trigger veto" print " Turning on software trigger veto"
self.setTriggerVetoStatus( int("0x1",16) ) self.setTriggerVetoStatus( int("0x1",16) )
print "Turning off shutter (setting run inactive)"
self.setRunInactive()
nFifoWords= int(eventFifoFillLevel) nFifoWords= int(eventFifoFillLevel)
fifoData= self.getFifoData(nFifoWords) fifoData= self.getFifoData(nFifoWords)
......
...@@ -3,25 +3,31 @@ ...@@ -3,25 +3,31 @@
<node id="TLU"> <node id="TLU">
<!-- Registers for the DUTs. These should be correct --> <!-- Registers for the DUTs. These should be correct -->
<node id="DUTInterfaces" address="0x1000" description="DUT Interfaces control registers"> <node id="DUTInterfaces" address="0x1000" description="DUT Interfaces control registers" fwinfo="endpoint;width=4">
<node id="DutMaskW" address="0x0" permission="w" description="" /> <node id="DUTMaskW" address="0x0" permission="w" description="" />
<node id="IgnoreDUTBusyW" address="0x1" permission="w" description="" /> <node id="IgnoreDUTBusyW" address="0x1" permission="w" description="" />
<node id="IgnoreShutterVetoW" address="0x2" permission="w" description="" /> <node id="IgnoreShutterVetoW" address="0x2" permission="w" description="" />
<node id="DUTInterfaceModeW" address="0x3" permission="w" description="" /> <node id="DUTInterfaceModeW" address="0x3" permission="w" description="" />
<node id="DUTInterfaceModeModifierW" address="0x4" permission="w" description="" /> <node id="DUTInterfaceModeModifierW" address="0x4" permission="w" description="" />
<node id="DUTInterfaceModeR" address="0xB" permission="r" description="" /> <node id="DUTMaskR" address="0x8" permission="r" description="" />
<node id="DUTInterfaceModeModifierR" address="0xC" permission="r" description="" />
<node id="DutMaskR" address="0x8" permission="r" description="" />
<node id="IgnoreDUTBusyR" address="0x9" permission="r" description="" /> <node id="IgnoreDUTBusyR" address="0x9" permission="r" description="" />
<node id="IgnoreShutterVetoR" address="0xA" permission="r" description="" /> <node id="IgnoreShutterVetoR" address="0xA" permission="r" description="" />
<node id="DUTInterfaceModeR" address="0xB" permission="r" description="" />
<node id="DUTInterfaceModeModifierR" address="0xC" permission="r" description="" />
</node> </node>
<node id="Shutter" address="0x2000" description="Shutter/T0 control"> <node id="Shutter" address="0x2000" description="Shutter/T0 control" fwinfo="endpoint;width=4">
<node id="ShutterStateW" address="0x0" permission="w" description=""/> <node id="ControlRW" address="0x0" permission="rw" description="Bit-0 controls if shutter pulses are active. 1 = active"/>
<node id="PulseT0" address="0x1" permission="w" description=""/> <node id="ShutterSelectRW" address="0x1" permission="rw" description="Selects which input is used to trigger shutter"/>
<node id="InternalShutterPeriodRW" address="0x2" permission="rw" description="Internal trig generator period ( units = number of strobe pulses)"/>
<node id="ShutterOnTimeRW" address="0x3" permission="rw" description="Time between input trigger being received and shutter asserted(T1) ( units = number of strobe pulses)"/>
<node id="ShutterVetoOffTimeRW" address="0x4" permission="rw" description="time between input trigger and veto being de-asserted(T2) ( units = number of strobe pulses)"/>
<node id="ShutterOffTimeRW" address="0x5" permission="rw" description="time between input trigger and time at which shutter de-asserted and veto reasserted(T3) ( units = number of strobe pulses)"/>
<node id="RunActiveRW" address="0x6" permission="rw" description="Writing '1' to Bit-0 of this register raises the run_active line and causes sync line to pulse for one strobe-pulse interval"/>
</node> </node>
<!-- I2C registers. Tested ok.--> <!-- I2C registers. Tested ok.-->
<node id="i2c_master" address="0x3000" description="I2C Master interface"> <node id="i2c_master" address="0x3000" description="I2C Master interface" fwinfo="endpoint;width=3">
<node id="i2c_pre_lo" address="0x0" mask="0x000000ff" permission="rw" description="" /> <node id="i2c_pre_lo" address="0x0" mask="0x000000ff" permission="rw" description="" />
<node id="i2c_pre_hi" address="0x1" mask="0x000000ff" permission="rw" description="" /> <node id="i2c_pre_hi" address="0x1" mask="0x000000ff" permission="rw" description="" />
<node id="i2c_ctrl" address="0x2" mask="0x000000ff" permission="rw" description="" /> <node id="i2c_ctrl" address="0x2" mask="0x000000ff" permission="rw" description="" />
...@@ -29,22 +35,23 @@ ...@@ -29,22 +35,23 @@
<node id="i2c_cmdstatus" address="0x4" mask="0x000000ff" permission="rw" description="" /> <node id="i2c_cmdstatus" address="0x4" mask="0x000000ff" permission="rw" description="" />
</node> </node>
<!-- Not sure about the FillLevelFlags register --> <!-- Not sure about the FillLevelFlags register -->
<node id="eventBuffer" address="0x4000" description="Event buffer"> <node id="eventBuffer" address="0x4000" description="Event buffer" fwinfo="endpoint;width=2">
<node id="EventFifoData" address="0x0" mode="non-incremental" size="32000" permission="r" description="" /> <node id="EventFifoData" address="0x0" mode="non-incremental" size="32000" permission="r" description="" />
<node id="EventFifoFillLevel" address="0x1" permission="r" description="" /> <node id="EventFifoFillLevel" address="0x1" permission="r" description="" />
<node id="EventFifoCSR" address="0x2" permission="rw" description="" /> <node id="EventFifoCSR" address="0x2" permission="rw" description="" />
<node id="EventFifoFillLevelFlags" address="0x3" permission="r" description="" /> <node id="EventFifoFillLevelFlags" address="0x3" permission="r" description="" />
</node> </node>
<!-- Event formatter registers. Should be ok --> <!-- Event formatter registers. Should be ok -->
<node id="Event_Formatter" address="0x5000" description="Event formatter configuration"> <node id="Event_Formatter" address="0x5000" description="Event formatter configuration" fwinfo="endpoint;width=3">
<node id="Enable_Record_Data" address="0x0" permission="rw" description="" /> <node id="Enable_Record_Data" address="0x0" permission="rw" description="" />
<node id="ResetTimestampW" address="0x1" permission="w" description="" /> <node id="ResetTimestampW" address="0x1" permission="w" description="" />
<node id="CurrentTimestampLR" address="0x2" permission="r" description="" /> <node id="CurrentTimestampLR" address="0x2" permission="r" description="" />
<node id="CurrentTimestampHR" address="0x3" permission="r" description="" /> <node id="CurrentTimestampHR" address="0x3" permission="r" description="" />
</node> </node>
<!-- This needs checking. The counters work, not sure about the reset --> <!-- This needs checking. The counters work, not sure about the reset -->
<node id="triggerInputs" address="0x6000" description="Inputs configuration"> <node id="triggerInputs" address="0x6000" description="Inputs configuration" fwinfo="endpoint;width=4">
<node id="SerdesRstW" address="0x0" permission="w" description="" /> <node id="SerdesRstW" address="0x0" permission="w" description="" />
<node id="InvertEdgeW" address="0x1" permission="w" description="Set bit high to invert sense of leading edge" />
<node id="SerdesRstR" address="0x8" permission="r" description="" /> <node id="SerdesRstR" address="0x8" permission="r" description="" />
<node id="ThrCount0R" address="0x9" permission="r" description="" /> <node id="ThrCount0R" address="0x9" permission="r" description="" />
<node id="ThrCount1R" address="0xa" permission="r" description="" /> <node id="ThrCount1R" address="0xa" permission="r" description="" />
...@@ -54,7 +61,7 @@ ...@@ -54,7 +61,7 @@
<node id="ThrCount5R" address="0xe" permission="r" description="" /> <node id="ThrCount5R" address="0xe" permission="r" description="" />
</node> </node>
<!-- Checked. Seems ok now, except for the TriggerVeto that do nothing.--> <!-- Checked. Seems ok now, except for the TriggerVeto that do nothing.-->
<node id="triggerLogic" address="0x7000" description="Trigger logic configuration"> <node id="triggerLogic" address="0x7000" description="Trigger logic configuration" fwinfo="endpoint;width=4">
<node id="PostVetoTriggersR" address="0x10" permission="r" description="" /> <node id="PostVetoTriggersR" address="0x10" permission="r" description="" />
<node id="PreVetoTriggersR" address="0x11" permission="r" description="" /> <node id="PreVetoTriggersR" address="0x11" permission="r" description="" />
<node id="InternalTriggerIntervalW" address="0x2" permission="w" description="" /> <node id="InternalTriggerIntervalW" address="0x2" permission="w" description="" />
...@@ -89,12 +96,12 @@ ...@@ -89,12 +96,12 @@
--> -->
</node> </node>
<node id="logic_clocks" address="0x8000" description="Clocks configuration"> <node id="logic_clocks" address="0x8000" description="Clocks configuration" fwinfo="endpoint;width=2">
<node id="LogicClocksCSR" address="0x0" permission="rw" description="" /> <node id="LogicClocksCSR" address="0x0" permission="rw" description="" />
<node id="LogicRst" address="0x1" permission="w" description="" /> <node id="LogicRst" address="0x1" permission="w" description="" />
</node> </node>
<node id="version" address="0x1" description="firmware version" permission="r"> <node id="version" address="0x1" description="firmware version" permission="r" fwinfo="endpoint;width=0">
</node> </node>
<!-- <!--
......
...@@ -49,7 +49,7 @@ class MyPrompt(cmd.Cmd): ...@@ -49,7 +49,7 @@ class MyPrompt(cmd.Cmd):
"""Processes the CONF file and writes its values to the TLU. To use a specific file type:\n """Processes the CONF file and writes its values to the TLU. To use a specific file type:\n
parseIni path/to/filename.conf\n parseIni path/to/filename.conf\n
(without quotation marks)""" (without quotation marks)"""
print "==== COMMAND RECEIVED: PARSE CONFIG" print "==== COMMAND RECEIVED: PARSE CONFIG"
#self.testme() #self.testme()
parsed_cfg= self.open_cfg_file(args, "./localConf.conf") parsed_cfg= self.open_cfg_file(args, "./localConf.conf")
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment