GSI TRB3: Difference between revisions

From DaqWiki
Jump to navigation Jump to search
 
(27 intermediate revisions by 2 users not shown)
Line 3: Line 3:
== Documentation ==  
== Documentation ==  


[http://trb.gsi.de/ Main TRB webpage]
* [http://trb.gsi.de/ Main TRB3 webpage]
 
* [http://jspc29.x-matter.uni-frankfurt.de/docu/trb3docu.pdf Main TRB3 Manual]
[http://jspc29.x-matter.uni-frankfurt.de/docu/trb3docu.pdf TRB Manual]
* [[Media:Trb3docu-2018aug10.pdf]] local copy of the manual
 
* [[Media:Trb3docu.pdf]] local copy of the manual
* [[Media:trb3.pdf]] local copy of the schematics
* [[Media:4conn.pdf]] schematics 4 LVDS connector add-on board (GSI-AD ADDON_4CONN2)
* [[Media:trbdist1-SCM.pdf]] [[Media:trbdist2.pdf]] [[Media:trbdist3-SCM.pdf]] schematics for external trigger and clock interface boards


== Hardware Information ==
== Hardware Information ==
Line 27: Line 30:


Trigger:
Trigger:
* The trigger timing signal (or as we call it "reference time") is expected on pin 1&2 of the connector "RJ-45-Trigger". No need to enable anything. This is true for all slave TRB3.
* If you have a CTS (or a single TRB3 setup) the trigger is generated in the CTS, from external tigger sources. This you can see in Table 27 in the TRB3-manual (currently page 75). For instance, one of the external trigger signals is on pair 2 of the trigger RJ45 connector
* If you have a CTS (or a single TRB3 setup) the trigger is generated in the CTS, from external tigger sources. This you can see in Table 27 in the TRB3-manual (currently page 75).
* So, for the CTS, there are 4 different inputs available on the two RJ45 connectors, which all can be used at the same time. If you need more, you can add a CTS-AddOn on the backside of the TRB3 and then you have many more trigger inputs. Each input will generate a certain "trigger type" data word in the data stream to distinguish between the trigger inputs.
* So, for the CTS, there are 4 different inputs available on the two RJ45 connectors, which all can be used at the same time. If you need more, you can add a CTS-AddOn on the backside of the TRB3 and then you have many more trigger inputs. Each input will generate a certain "trigger type" data word in the data stream to distinguish between the trigger inputs.
== TDC calibration ==
The concept of the FPGA-TDC calibration is described here:
http://dabc.gsi.de/doc/dabc2/hadaq_tdc_calibr.html
One important summary from that document: we require ~1e5 random hits for every channel in order to build up an individual fine counter calibration for each channel.


== Computer and Software Setup Instructions ==  
== Computer and Software Setup Instructions ==  
Line 40: Line 50:


3) A MIDAS-based readout on a Centos-7 machine. See [[TRB3 Centos-7 instructions]].
3) A MIDAS-based readout on a Centos-7 machine. See [[TRB3 Centos-7 instructions]].
an Opensuse machine. 


On this page we provide information that is generic to each setup. The links provide instructions for the parts of the operation that are unique to each setup:
On this page we provide information that is generic to each setup. The links provide instructions for the parts of the operation that are unique to each setup:
Line 47: Line 55:
We setup TRB3 on a private network.  So need machine with second ethernet port.
We setup TRB3 on a private network.  So need machine with second ethernet port.


Currently the work is being done with user trb3_user on computer daq14.  This is a local user on that computer; not part of DAQ cluster.
== Useful TRB3 commands ==


Full instructions to be written
a) Get IDs for TRB3 FPGAs (1 central FPGA and 4 FPGAs for TDCs):
 
<pre>
trb3_user@linux-klyr:~/lindner> trbcmd i 0xffff
0xc001  0xe1000006e937ac28  0x05
0x0100  0x9c000006e937a028  0x00
0x0101  0x91000006e95e8328  0x01
0x0102  0x75000006e9383128  0x02
0x0103  0xe6000006e96e5228  0x03
</pre>


==  Start-up Instructions ==
The four FPGAs that actually make TDCs are numbered 0x100, 0x101, 0x102, 0x103.


These are the basic instructions to initialize and take data from TRB3, using the GSI DAQ tools.
b) Print out raw TDCs for the events that are coming in through event builder


1) Start the trb3 program and initialize the TRB3
<pre>
<pre>
cd /home/tbr3_user/trbsoft/daqtools/users/triumf_trb171
hldprint localhost:6789 -onlytdc 0x0100 -num 0
source startup.sh
</pre>
</pre>


2) Start event builder: In new terminal, do
c) Print out raw TDCs for events in file


<pre>
<pre>
cd trbsoft/daqtools/users/triumf_trb171/
hldprint //data/trb3_data/pulser17342114715.hld -onlytdc 0x0100 -num 0
dabc_exe TdcEventBuilder.xml
</pre>
</pre>


3) ) Start webbrowser: In new terminal, do
d) Print out raw data stream from EB


<pre>
<pre>
cd /home/tbr3_user/trbsoft/daqtools/web/
hldprint localhost:6789 -raw
./cts_gui --noopenxterm --port=1234 --endpoint=0xc001
</pre>
</pre>


open webbrowser and go to
e) Check the status of the clock


http://daq14.triumf.ca:1234/
Check bit 8 of register 0xd300.


4) Enable the readout of the channels we want.
This indicates that an external clock is being used
<pre>
[agtdc@daq16 triumf_trb171]$ trbcmd r 0xc001 0xd300
0xc001  0x00000101
</pre>


i) Go to webpage
This indicates that an internal clock is being used
 
<pre>
http://daq14.triumf.ca:1234/tdc/tdc.htm
[agtdc@daq16 triumf_trb171]$ trbcmd r 0xc001 0xd300
 
0xc001 0x00000001
ii) Under 'board' set it to 0100.
</pre>
 
iii) Then click 'enable' radio button
 
iv) Then, under 0100 set all the channel groups to on. Should then start
seeing triggers for different channels (if we have signals going into
channels).


v) Finally, disable the trigger window on the same page.  On the section c801
click off and make sure it says 'disabled'.  If trigger window is disabled
then all triggers are accepted...


== TDC calibration ==
f)  "Ping of death" somehow ping board to reboot it:
 
The concept of the FPGA-TDC calibration is described here:
 
http://dabc.gsi.de/doc/dabc2/hadaq_tdc_calibr.html
 
One important summary from that document: we require ~1e5 random hits for every channel in order to build up an individual fine counter calibration for each channel.
 
== Doing TDC analysis ==
 
This is how we do the TDC analysis using the GSI tools:
 
A) Setup the analyzer


<pre>
<pre>
source ~/trbsoft/trb3/trb3login
ping  -pc001 trb171
</pre>
</pre>


(This needs to be run in any terminal where you want to run the go4analysis
== Updating TRB3 firmware ==


Based on instructions from Michael


B) Create the set of calibration constants for the TDC
General points:
 
<pre>
cd /home/tbr3_user/trbsoft/daqtools/users/triumf_trb171
rm cal*.cal  (remove old calibration files)
export CALTRIG=1; export CALMODE=-1;
go4analysis -number 100000 -user /data/trb3_data/saved/pulser17342114715.hld
</pre>


(need to change this to use the hld file that you want to use)
* Take care that you have a stable setup with the power-supply stable and cooling ok, as if you turn off the board while reprogramming you need a programming cable to recover the FPGA.


The resulting calibration files are called something like cal_010X.cal. CALTRIG=1 means using trigger type 1 to do calibration.  You can set this to different trigger type number, if required.
* List of available firmware files are here:
https://jspc29.x-matter.uni-frankfurt.de/trbweb/?action=page&url=design-files




C) Now analyze more events, using those calibration files
Steps to flash


<pre>
1) Get firmware.  Ie:
rm *root
<pre> wget http://jspc29.x-matter.uni-frankfurt.de/bitfiles/trb3_periph_padiwa_tdc_32_stretch_triggerlogic28-4_20181024.bit </pre>
export CALTRIG=1; export CALMODE=0;
go4analysis -number 1000000 -user /data/trb3_data/saved/pulser17342114715.hld
</pre>


now open the resulting root file
2) reflashing is done via:


<pre>
<pre> trbflash program 0x<TRB-address-of-FPGA> ./trb3_periph_padiwa_tdc_32_stretch_triggerlogic28-4_20181024.bit
root -l Go4AutoSave.root
</pre>
</pre>


and use TBrowser() to look at the difference histogram.  In particular, right now we look at the histogram TDC_0100/Ch3/TDC_0100_Ch3_RisingRef which shows the difference between the two synchronized input channels.  This distribution should show a timing resolution between the hits of ~18ps if all the TDC calibration is working fine...


== TRB3 MIDAS implementation ==
<pre>
trbflash program 0x0102 ./trb3_periph_padiwa_tdc_32_stretch_triggerlogic28-4_20181024.bit
trbflash program 0x0103 ./trb3_periph_padiwa_tdc_32_stretch_triggerlogic28-4_20181024.bit </pre>


We have a working MIDAS readout of the TRB3 TDC data.  Currently this readout uses a lot of the original GSI tools for setting up the TRB3 before the readout can start.  At this time you need to do steps 1 and 2 described in "Start up instructions"  in order to setup the TRB3 before starting the MIDAS frontend. Eventually we will try to remove as many as possible of the original GSI tools.
3) after a successful flash and verify (automatic):


MIDAS frontend code is available here:
<pre> trbcmd reload 0x<TRB-address-of-FPGA> </pre>


https://bitbucket.org/ttriumfdaq/trb3_frontend
4) But do it one FPGA after the other, if you do it the first time.
You can also reprogramm all of them at once with a broadcast address.


The MIDAS frontend is setup to read events from the DABC event builder, which makes the events available on port 6789.  You can see a running MIDAS TRB3 frontend here:
== Konstantin's notes ==


https://daq14.triumf.ca:8443
=== TRB3 grounding ===


(midas/midas) I added simple decoder and histograming classes to rootana. Currently I have only implemented the crude TDC calibration into the TRB3 bank decoders. In the long run we may want to integrate the fine TDC calibration directly into the frontend. You can see the TDC difference between a pulser split into two channels here
to avoid damage to the DC-coupled trigger input, TRB3 PCB should be grounded to the same
ground as the device driving this input (VME-CDM in this case). On the TRB3 side, we attach
the ground wire to one of the PCB mounting holes (confirmed ground). On the other end, it should
be attached to the VME crate ground.


http://daq14.triumf.ca:8088
the clock input is AC coupled and probably no affected by grounding problems.


Look for the histogram TRB3_diff_0_3.
the esata splitter should also be grounded, see below.


== TRB3 MIDAS implementation on Centos-7 ==  
=== esata spliter in use by ALPHA-g ===


We break out the TRB3 MIDAS setup on Centos-7 into seperate [[TRB3 Centos-7 instructions]].
CDM --- minisas --- 4-esata-flail --- esata --- ALPHA-T splitter --- 2x cat6 --- 2xRJ45


== Useful TRB3 commands ==
ALPHA-T esata splitter:


a) Get IDs for TRB3 FPGAs (1 central FPGA and 4 FPGAs for TDCs):
* use 7ft cat6 patch cable, 568B wiring (568A will work, but color coding is not the same)
* cat6 RJ45 green pair solder to splitter clock side
* cat6 RJ45 green pair solder to splitter trigger side
* ground wire of same length solder to esata ground, other end attach to TRB3 PCB mounting hole or other good ground.


<pre>
=== second trigger input ===
trb3_user@linux-klyr:~/lindner> trbcmd i 0xffff
0xc001  0xe1000006e937ac28  0x05
0x0100  0x9c000006e937a028  0x00
0x0101  0x91000006e95e8328  0x01
0x0102  0x75000006e9383128  0x02
0x0103  0xe6000006e96e5228  0x03
</pre>


b) Print out raw TDCs for the events that are coming in through event builder
According to schematics and documentation, RJ45 "trigger" connector has 2 trigger inputs,
normal input via the "green pair" and second input via the "orange pair".


<pre>
Switching between these inputs is done by "TRIGGER_SELECT" FPGA output acting on the "IN_SEL" pin of the CDCLVD1216 LVDS mux ([[Media:Cdclvd1216.pdf]] datasheet).
hldprint localhost:6789 -onlytdc 0x0100 -num 0
</pre>


c) Print out raw TDCs for events in file
This "TRIGGER_SELECT" signal is not listed in the documentation, but I confirm with voltmeter at J28 test point that it's output is same as bit 0 of register 0xd300. writing "1" sets voltage to 2.5V, writing "0" sets it to 0V.


<pre>
However, in either state, it has no effect on the trigger input. One would expect that the normal trigger will stop if the lvds mux is switched to the second input. Actually regardless of "TRIGGER_SELECT" state, the normal trigger input is always active (oscillates if connected to unterminated/ungrounded RJ45 cable), the second trigger input never produces any trigger counts.
hldprint //data/trb3_data/pulser17342114715.hld -onlytdc 0x0100 -num 0
</pre>


d) Print out raw data stream from EB
this is a mystery.


<pre>
== ZZZ ==
hldprint localhost:6789 -raw
</pre>


e) "Ping of death" somehow ping board to reboot it:
ZZZ
 
<pre>
ping  -pc001 trb171
</pre>

Latest revision as of 15:25, 31 May 2021

TRB3 is an FPGA-TDC board made and sold by GSI. It can achieve ~20ps timing resolution

Documentation

Hardware Information

Power

The TRB3 runs off 50V DC power. The TRB3 needs a fan in order to operate. Between the fan and the TRB3 they draw ~0.5A on 50V.

Clock and Trigger

Michael Traxler provided the following picture of clock and trigger circuitry:

Trb clockdistribution.png

Michael also provides following details

Clock:

  • system clock frequency of 200MHz can be taken either from the internal oscillator, or via the second LVDS pair (pin 3 and 6) of the connector "RJ-45-Clock". They are distributed to all 5 FPGAs to the primary-clock-input.
  • In all "modern" FPGA designs (since several years) you don't have to do anything in registers to use the external clock. The scheme is simple: When an external clock is available and stable and the PLL locks to it at power up, the external clock is used. If not, the internal clock is used.

Trigger:

  • If you have a CTS (or a single TRB3 setup) the trigger is generated in the CTS, from external tigger sources. This you can see in Table 27 in the TRB3-manual (currently page 75). For instance, one of the external trigger signals is on pair 2 of the trigger RJ45 connector
  • So, for the CTS, there are 4 different inputs available on the two RJ45 connectors, which all can be used at the same time. If you need more, you can add a CTS-AddOn on the backside of the TRB3 and then you have many more trigger inputs. Each input will generate a certain "trigger type" data word in the data stream to distinguish between the trigger inputs.

TDC calibration

The concept of the FPGA-TDC calibration is described here:

http://dabc.gsi.de/doc/dabc2/hadaq_tdc_calibr.html

One important summary from that document: we require ~1e5 random hits for every channel in order to build up an individual fine counter calibration for each channel.

Computer and Software Setup Instructions

Currently have gotten the TRB3 working on three different configurations. On this page we provide information that is generic to each setup. The links provide instructions for the parts of the operation that are unique to each setup:

1) A GSI-provided readout package (and analysis package) which runs on OpenSuse. See TRB3 GSI Opensuse instructions.

2) A MIDAS-based readout on an Opensuse machine. No instructions.

3) A MIDAS-based readout on a Centos-7 machine. See TRB3 Centos-7 instructions.

On this page we provide information that is generic to each setup. The links provide instructions for the parts of the operation that are unique to each setup:

We setup TRB3 on a private network. So need machine with second ethernet port.

Useful TRB3 commands

a) Get IDs for TRB3 FPGAs (1 central FPGA and 4 FPGAs for TDCs):

trb3_user@linux-klyr:~/lindner> trbcmd i 0xffff
0xc001  0xe1000006e937ac28  0x05
0x0100  0x9c000006e937a028  0x00
0x0101  0x91000006e95e8328  0x01
0x0102  0x75000006e9383128  0x02
0x0103  0xe6000006e96e5228  0x03

The four FPGAs that actually make TDCs are numbered 0x100, 0x101, 0x102, 0x103.

b) Print out raw TDCs for the events that are coming in through event builder

hldprint localhost:6789 -onlytdc 0x0100 -num 0 

c) Print out raw TDCs for events in file

hldprint //data/trb3_data/pulser17342114715.hld -onlytdc 0x0100 -num 0 

d) Print out raw data stream from EB

hldprint localhost:6789 -raw

e) Check the status of the clock

Check bit 8 of register 0xd300.

This indicates that an external clock is being used

[agtdc@daq16 triumf_trb171]$ trbcmd r 0xc001 0xd300
0xc001  0x00000101

This indicates that an internal clock is being used

[agtdc@daq16 triumf_trb171]$ trbcmd r 0xc001 0xd300
0xc001  0x00000001


f) "Ping of death" somehow ping board to reboot it:

ping  -pc001 trb171

Updating TRB3 firmware

Based on instructions from Michael

General points:

  • Take care that you have a stable setup with the power-supply stable and cooling ok, as if you turn off the board while reprogramming you need a programming cable to recover the FPGA.
  • List of available firmware files are here:

https://jspc29.x-matter.uni-frankfurt.de/trbweb/?action=page&url=design-files


Steps to flash

1) Get firmware. Ie:

 wget http://jspc29.x-matter.uni-frankfurt.de/bitfiles/trb3_periph_padiwa_tdc_32_stretch_triggerlogic28-4_20181024.bit 

2) reflashing is done via:

 trbflash program 0x<TRB-address-of-FPGA> ./trb3_periph_padiwa_tdc_32_stretch_triggerlogic28-4_20181024.bit


 
trbflash program 0x0102 ./trb3_periph_padiwa_tdc_32_stretch_triggerlogic28-4_20181024.bit
trbflash program 0x0103 ./trb3_periph_padiwa_tdc_32_stretch_triggerlogic28-4_20181024.bit 

3) after a successful flash and verify (automatic):

 trbcmd reload 0x<TRB-address-of-FPGA> 

4) But do it one FPGA after the other, if you do it the first time. You can also reprogramm all of them at once with a broadcast address.

Konstantin's notes

TRB3 grounding

to avoid damage to the DC-coupled trigger input, TRB3 PCB should be grounded to the same ground as the device driving this input (VME-CDM in this case). On the TRB3 side, we attach the ground wire to one of the PCB mounting holes (confirmed ground). On the other end, it should be attached to the VME crate ground.

the clock input is AC coupled and probably no affected by grounding problems.

the esata splitter should also be grounded, see below.

esata spliter in use by ALPHA-g

CDM --- minisas --- 4-esata-flail --- esata --- ALPHA-T splitter --- 2x cat6 --- 2xRJ45

ALPHA-T esata splitter:

  • use 7ft cat6 patch cable, 568B wiring (568A will work, but color coding is not the same)
  • cat6 RJ45 green pair solder to splitter clock side
  • cat6 RJ45 green pair solder to splitter trigger side
  • ground wire of same length solder to esata ground, other end attach to TRB3 PCB mounting hole or other good ground.

second trigger input

According to schematics and documentation, RJ45 "trigger" connector has 2 trigger inputs, normal input via the "green pair" and second input via the "orange pair".

Switching between these inputs is done by "TRIGGER_SELECT" FPGA output acting on the "IN_SEL" pin of the CDCLVD1216 LVDS mux (Media:Cdclvd1216.pdf datasheet).

This "TRIGGER_SELECT" signal is not listed in the documentation, but I confirm with voltmeter at J28 test point that it's output is same as bit 0 of register 0xd300. writing "1" sets voltage to 2.5V, writing "0" sets it to 0V.

However, in either state, it has no effect on the trigger input. One would expect that the normal trigger will stop if the lvds mux is switched to the second input. Actually regardless of "TRIGGER_SELECT" state, the normal trigger input is always active (oscillates if connected to unterminated/ungrounded RJ45 cable), the second trigger input never produces any trigger counts.

this is a mystery.

ZZZ

ZZZ