TRG: Difference between revisions
Line 314: | Line 314: | ||
== conf_bsc_control bits == | == conf_bsc_control bits == | ||
{| cellpadding="10" cellspacing="0" border="1" | |||
! Bit || Quartus Name || FwRev || Description | |||
|- | |||
| 0 || conf_bsc_adc_a || NEXT || enable mapping of BSC ADCs to ADC links 0..7 | |||
|- | |||
| 1 || conf_bsc_adc_b || NEXT || enable mapping of BSC ADCs to ADC links 8..15 | |||
|- | |||
| 2 || conf_bsc64_bot_only || NEXT || bsc64 uses bottom channels only | |||
|- | |||
| 3 || conf_bsc64_top_only || NEXT || bsc64 uses top channels only | |||
|- | |||
| 4 || conf_bsc64_bot_top_or || NEXT || bsc64 uses "or" of top and bottom | |||
|- | |||
| 5 || conf_bsc64_bot_top_and || NEXT || bsc64 uses "and" of top and bottom | |||
|- | |||
| 6 || | |||
|- | |||
| 7 || | |||
|- | |||
| 15..8 || conf_bsc64_mult || NEXT || bsc trigger fires if bsc64 multiplicity is equal or more than this value | |||
|- | |||
| 31..16 || | |||
|- | |||
|} | |||
== conf_coinc_control bits == | |||
{| cellpadding="10" cellspacing="0" border="1" | {| cellpadding="10" cellspacing="0" border="1" |
Revision as of 10:56, 12 October 2018
ALPHAT, the trigger control board for the ALPHA-g detector
Links
- xxx
- https://bitbucket.org/teamalphag/alphat_firmware - firmware sources on bitbucket
General characteristics
Photos
Board schematics
Available hardware
ALPHA-T front panel connections
From top to bottom:
| | minisas-C - links 8-11 | minisas-D - links 12-15 | | ethernet sfp - use copper sfp only | minisas - not used, do not connect | esata - clock in, trigger out | | minisas-A - links 0-3 | minisas-B - links 4-7 | | LEDs |
MiniSAS and SATA flail cable connections:
P1 <--> link 3 P2 <--> link 2 P3 <--> link 1 P4 <--> link 0
LEDs:
--PCB-- (left) LED[0] - trigger out - ag_trig_out LED[1] - network packet received - sfp_rx_data_valid LED[2] - Xilinx FPGA boot ok - FMC1_CFG_DONE LED[3] - not used (right)
ALPHA-T onboard jumpers and switches
- rotary switches: select IP address: 00=192.168.1.50, 11=.51, 22=.52, 33=.53, 44=.54, otherwire=.251
Firmware update procedure
- use quartus to generate the grifc.pof file (use grifc.cof)
- open quartus programmer
- attach grifc.pof to the 1st CFI_512 flash
- mark program/configure for the same flash (3 marks: pof, page_0 and OPTION_BITS
- check that "initiate configuration after programming" is set in tools->options
- say "start"
- should take about 5 minutes
- grifc should reboot into the new firmware
If CFI_512 flash is not visible to the quartus programmer, load correct code into the MaxV CPLD:
- open quartus programmer,
- say "auto detect"
- change file for the 5M2210 device
- use .../boot/maxv_3xfmc_normal.pof from the firmware git repository
- say "program", it should finish in 10-15 seconds
- say "auto detect"
- CFI_512 flash should be visible now.
Firmware revisions
ALPHA-g trigger functions
Trigger modes:
- software trigger
- pulser trigger
- trigger on GRIF16 ADC NIM and ESATA inputs
- adc16 grand-or
- adc32 grand-or
- adc16 wire multiplicity
- trigger on coincidences of ADC links
software trigger
to programmatically fire the trigger, one should:
- set the conf_enable_sw_trigger bit in conf_trig_enable, this will permit the software trigger to fire the trigger
- write value 0x4 to register 0x2B, this will cause the trigger to fire
pulser trigger
To use the pulser trigger, one should program:
- pulser period (in clocks)
- pulser width (in clocks, use value 5, the pulser no longer goes outside of the trigger board, so changing the width does not do anything)
- set the run_pulser bit in conf_trig_enable, this will cause the pulser to run
- set the enable_pulser bit in conf_trig_enable, this will cause the pulser to fire the trigger
- set the output_pulser bit in conf_trig_enable, this will cause the pulser to be output from the alphag firmware block (the pulser no longer goes outside of the trigger board, so changing the bit does not do anything)
adc16 multiplicity trigger
This trigger is intended for use with the barrel scintillator signals connected to adc16 digitizers. It does not work well with TPC AW signals.
The 16 adc16 trigger bits (16x16=256) are added together to form the hit multiplicity value (adc16_mult, 16 bits, actual range 0 to 256).
Four threshold signals are computed: adc16_mult_1ormore = adc16_mult>=1, 2ormore, 3ormore, 4ormore.
There is a counter for each of these four signals.
Each of these four signals can fire the trigger, see conf_trig_enable bits.
Control registers
Register addresses
Note: all registers are 32 bits unless otherwise noted.
Note: RW means read-write register, RO means read-only, ROL means read-only, contents is latched by the "latch_out" bit
Address | Quartus Name | Access | FwRev | Description |
---|---|---|---|---|
0x08 | num_sample | RW | GRIF-C | magic register to control UDP packet size |
0x1F | compilation_time | RO | Firmware revision | |
0x20 | conf_trig_width <= par_value; | |||
0x21 | conf_busy_width <= par_value; | |||
0x22 | conf_pulser_width <= par_value; | |||
0x23 | conf_pulser_period <= par_value; | |||
0x24 | sw_trigger_counter <= 10; | |||
0x24 | - | 0x5b120c9f (01Jun18_20:18) | not used | |
0x25 | conf_trig_enable <= par_value; | |||
0x26 | conf_sas_trig_mask <= par_value; | obsolete | ||
0x27 | conf_sas_trig_mask_a <= par_value; | obsolete | ||
0x28 | conf_sas_trig_mask_b <= par_value; | obsolete | ||
0x29 | conf_nim_mask <= par_value; | |||
0x2A | conf_esata_mask <= par_value; | |||
0x2B | reset_out, latch_out, trigger_out | pulsed | 0x5b120c9f (01Jun18_20:18) | see reg 0x2B bits |
0x2C | conf_aw16_coinc_a | RW | ??? | configure AW coincidence trigger |
0x2D | conf_aw16_coinc_b | RW | ??? | |
0x2E | conf_aw16_coinc_c | RW | ??? | |
0x2F | conf_aw16_coinc_d | RW | ??? | |
0x30 | sas_sd[15:0] | ROL | 0x5b120c9f (01Jun18_20:18) | sas signal detect for each link |
0x31 | pll_625_status | ROL | 0x5b2057f5 (12Jun18_16:32) | 62.5MHz PLL status, bits: 31=locked, 30=active clock, 29=esata_clk_bad, 28=clk625_bad, 27:0 not used, to be lock counter |
0x32 | clk_counter | ROL | 0x5b2057f5 (12Jun18_16:32) | frequency counter of the system 125 MHz clock |
0x33 | clk_625_counter | ROL | 0x5b2057f5 (12Jun18_16:32) | frequency counter of the currently selected 62.5 MHz clock (my_clk_625) |
0x34 | conf_control | RW | 0x5b398983 (01Jul18_19:10) | see conf_control bits below |
0x35 | conf_drift_width | RW | 0x5b398983 (01Jul18_19:10) | width of drift time blank-out in 62.5MHz clocks |
0x36 | conf_scaledown | RW | 0x5b398983 (01Jul18_19:10) | trigger scaledown, 0=no scaledownaw trigger mlu control |
0x37 | conf_mlu | RW | 0x5b398983 (01Jul18_19:10) | aw trigger mlu control |
0x38 | conf_trig_delay | RW | 0x5baedfca (28Sep18_19:13) | delay the trigger pulse |
0x39 | esata_clk_counter | ROL | 0x5baedfca (28Sep18_19:13) | frequency counter of the system 125 MHz clock |
0x3A | esata_clk_esata_counter | ROL | 0x5baedfca (28Sep18_19:13) | requency counter of the external clock (eSATA clock) |
0x3B | conf_counter_adc_select | RW | 0x5bb7f6ae (05Oct18_16:41) | select which 16 ADCs are connected to the selected adc counters, 0..15 - connect the adc16 signals, 16..47 connect the adc32 signals |
0x3C | sysreset_ts | RO | 0x5bb7f6ae (05Oct18_16:41) | 125MHz counter of VME-SYSRESET active state |
0x3D | GRIF-C csr | RW | GRIF-C | <= csr & ~par_value; // Selective clear |
0x3E | GRIF-C csr | RW | GRIF-C | par_value; // Selective set |
0x3F | GRIF-C csr | RW | GRIF-C | <= par_value; // write |
0x40 | conf_bsc_control | RW | NEXT | Barrel Scintillator trigger control |
0x41 | conf_coinc_control | RW | NEXT | Coincidence trigger control |
0x100 | ts_625 | ROL | latched timestamp | |
0x101 | counter_trig_out | ROL | counter of issued triggers | |
0x102 | counter_trig_in | ROL | counter of triggers | |
0x103 | counter_pulser | ROL | counter of pulser | |
0x104 | counter_adc16_grand_or | ROL | ||
0x105 | counter_adc32_grand_or | ROL | ||
0x106 | counter_adc_grand_or | ROL | ||
0x107 | counter_esata_nim_grand_or | ROL | ||
0x108 | counter_adc16_mult_1ormore | ROL | ||
0x109 | counter_adc16_mult_2ormore | ROL | ||
0x10A | counter_adc16_mult_3ormore | ROL | ||
0x10B | counter_adc16_mult_4ormore | ROL | ||
0x10C | counter_aw16_coinc_a | ROL | ??? | counter of AW coincidence triggers |
0x10D | counter_aw16_coinc_b | ROL | ??? | |
0x10E | counter_aw16_coinc_c | ROL | ??? | |
0x10F | counter_aw16_coinc_d | ROL | ??? | |
0x110 | counter_drift | ROL | 0x5b398983 (01Jul18_19:10) | counter of triggers that passed the drift time blank-out |
0x111 | counter_scaledown | ROL | 0x5b398983 (01Jul18_19:10) | counter of triggers that passed the scaledown |
0x112 | counter_aw16_coinc | ROL | 0x5b398983 (01Jul18_19:10) | counter of AW coincidence triggers |
0x113 | counter_aw16_mlu | ROL | 0x5b398983 (01Jul18_19:10) | counter of AW MLU triggers |
0x114 | counter_aw16_mult_1ormore | ROL | 0x5bb7f6ae (05Oct18_16:41) | counter of AW 1ormore triggers |
0x115 | counter_aw16_mult_2ormore | ROL | 0x5bb7f6ae (05Oct18_16:41) | counter of AW 2ormore triggers |
0x116 | counter_aw16_mult_3ormore | ROL | 0x5bb7f6ae (05Oct18_16:41) | counter of AW 3ormore triggers |
0x117 | counter_aw16_mult_4ormore | ROL | 0x5bb7f6ae (05Oct18_16:41) | counter of AW 4ormore triggers |
0x118 | counter_bsc_grand_or | ROL | NEXT | counter of BSC grand-or triggers |
0x119 | counter_bsc_mult | ROL | NEXT | counter of BSC multiplicity triggers |
0x11A | counter_coinc_mult | ROL | NEXT | counter of coinidence triggers |
0x200..0x207 | conf_adc16_masks | RW | all | adc16 enable bits |
0x300..0x30F | conf_adc32_masks | RW | all | adc32 enable bits |
0x400..0x41F | sas_bits[15:0][63:0] | ROL | all | sas data bits for each link |
0x420..0x42F | sas_sd_counters[15:0] | ROL | 0x5b120c9f (01Jun18_20:18) | sas signal detect counter for each link |
0x430..0x43F | counters_adc16_or16[15:0] | ROL | 0x5b120c9f (01Jun18_20:18) | 16 counters of adc16 ORes |
0x440..0x45F | counters_adc32_or16[31:0] | ROL | 0x5b120c9f (01Jun18_20:18) | 32 counters of adc32 ORes |
0x460..0x46F | counters_adc_selected[15:0] | ROL | 0x5bb7f6ae (05Oct18_16:41) | 16 counters for selected group of adcs, see conf_counter_adc_select |
0x470..0x4AF | counters_bsc64[63:0] | ROL | NEXT | 64 counters for the BSC bars |
conf_control bits
Bit | Quartus Name | FwRev | Description |
---|---|---|---|
0 | conf_clock_select | 0x5b3aa19f (02Jul18_15:05) | select 0=internal 62.5 MHz clock or 1=esata 62.5 MHz clock |
1 | conf_enable_aw_adc16 | 0x5baedfca (28Sep18_19:13) | route AW trigger (aw16) from adc16 |
2 | conf_enable_aw_adc32a | 0x5baedfca (28Sep18_19:13) | route AW trigger (aw16) from adc32 15..0 |
3 | conf_enable_aw_adc32b | 0x5baedfca (28Sep18_19:13) | route AW trigger (aw16) from adc32 31..16 |
15..4 | |||
23..16 | conf_mlu_prompt | 0x5b3aa19f (02Jul18_15:05) | MLU trigger prompt window |
31..24 | conf_mlu_wait | 0x5b3aa19f (02Jul18_15:05) | MLU trigger wait window |
conf_mlu bits
Bit | Quartus Name | FwRev | Description |
---|---|---|---|
31 | mlu_reset | 0x5b3aa19f (02Jul18_15:05) | not used |
30 | mlu_write | 0x5b3aa19f (02Jul18_15:05) | 1=write data bit into given address |
16 | mlu_data | 0x5b3aa19f (02Jul18_15:05) | data bit for writing to MLU RAM |
15..0 | mlu_write_addr | 0x5b3aa19f (02Jul18_15:05) | MLU RAM write address for writing the data bit |
conf_bsc_control bits
Bit | Quartus Name | FwRev | Description |
---|---|---|---|
0 | conf_bsc_adc_a | NEXT | enable mapping of BSC ADCs to ADC links 0..7 |
1 | conf_bsc_adc_b | NEXT | enable mapping of BSC ADCs to ADC links 8..15 |
2 | conf_bsc64_bot_only | NEXT | bsc64 uses bottom channels only |
3 | conf_bsc64_top_only | NEXT | bsc64 uses top channels only |
4 | conf_bsc64_bot_top_or | NEXT | bsc64 uses "or" of top and bottom |
5 | conf_bsc64_bot_top_and | NEXT | bsc64 uses "and" of top and bottom |
6 | |||
7 | |||
15..8 | conf_bsc64_mult | NEXT | bsc trigger fires if bsc64 multiplicity is equal or more than this value |
31..16 |
conf_coinc_control bits
Bit | Quartus Name | FwRev | Description |
---|---|---|---|
0 | conf_bsc_adc_a | NEXT | enable mapping of BSC ADCs to ADC links 0..7 |
1 | conf_bsc_adc_b | NEXT | enable mapping of BSC ADCs to ADC links 8..15 |
2 | conf_bsc64_bot_only | NEXT | bsc64 uses bottom channels only |
3 | conf_bsc64_top_only | NEXT | bsc64 uses top channels only |
4 | conf_bsc64_bot_top_or | NEXT | bsc64 uses "or" of top and bottom |
5 | conf_bsc64_bot_top_and | NEXT | bsc64 uses "and" of top and bottom |
6 | |||
7 | |||
15..8 | conf_bsc64_mult | NEXT | bsc trigger fires if bsc64 multiplicity is equal or more than this value |
31..16 |
conf_trig_enable bits
Bit | Quartus Name | FwRev | Description |
---|---|---|---|
0 | conf_enable_sw_trigger | trigger on software trigger (how generated???) | |
1 | conf_enable_pulser | trigger on pulser | |
2 | conf_enable_sas_or | obsolete | |
2 | - | 0x5b120c9f (01Jun18_20:18) | not used |
3 | conf_run_pulser | let the pulser run (frequency has to be set beforehand) | |
4 | conf_output_pulser | enable external output of pulser signal | |
5 | conf_enable_esata_nim | trigger on ESATA and NIM grand-or (esata and nim masks should be set beforehand) | |
6 | conf_enable_adc16 | trigger on adc16 grand-or | |
7 | conf_enable_adc32 | trigger on adc32 grand-or | |
8 | conf_enable_adc16_1ormore | trigger on adc16 grand multiplicity "1 or more" | |
9 | conf_enable_adc16_2ormore | same, "2 or more" | |
10 | conf_enable_adc16_3ormore | same, "3 or more" | |
11 | conf_enable_adc16_4ormore | same, "4 or more" | |
12 | conf_enable_adc16_coinc | trigger on special coincidence of adc16 links | |
12 | - | 0x5b08938c (25May18_15:51) | not used |
13 | conf_enable_udp | 0x5a7a3fbd (06Feb18_15:52) | enable sending UDP packets |
14 | conf_enable_busy | 0x5a7a3fbd (06Feb18_15:52) | enable activation of busy counter |
15 | conf_enable_adc | 0x5b120c9f (01Jun18_20:18) | trigger on adc grand-or |
16 | conf_enable_aw16_coinc_a | ??? | enable AW coincidence trigger |
17 | conf_enable_aw16_coinc_b | ??? | |
18 | conf_enable_aw16_coinc_c | ??? | |
19 | conf_enable_aw16_coinc_d | ??? | |
20 | conf_clock_select | 0x5b2057f5 (12Jun18_16:32) | select 0=internal 62.5 MHz clock or 1=esata 62.5 MHz clock |
20 | not used | 0x5b3aa19f (02Jul18_15:05) | not used, clock select moved to the conf_control register |
21 | conf_enable_aw16_coinc | 0x5b3aa19f (02Jul18_15:05) | enable AW coincidence trigger |
22 | conf_enable_aw16_mlu | 0x5b3aa19f (02Jul18_15:05) | enable AW MLU trigger |
23 | |||
24 | conf_enable_aw16_1ormore | 0x5b3aa19f (02Jul18_15:05) | trigger on AW preamp multiplicity "1 or more" |
25 | conf_enable_aw16_2ormore | 0x5b3aa19f (02Jul18_15:05) | same, "2 or more" |
26 | conf_enable_aw16_3ormore | 0x5b3aa19f (02Jul18_15:05) | same, "3 or more" |
27 | conf_enable_aw16_4ormore | 0x5b3aa19f (02Jul18_15:05) | same, "4 or more" |
reg 0x2B bits
Bit | Quartus Name | FwRev | Description |
---|---|---|---|
0 | reset_out | 0x5b120c9f (01Jun18_20:18) | reset counters, etc |
1 | latch_out | 0x5b120c9f (01Jun18_20:18) | latch counters, sas bits, etc |
2 | trigger_out | 0x5b120c9f (01Jun18_20:18) | generate a trigger |
UDP data format
Offset | Name | Quartus name | FwRev | Description |
---|---|---|---|---|
0 | packet counter | none | all | UDP packet counter, counting from 0, reset by reboot. Automatically added by UDP transmitter code in the GRIFC base firmware |
1 | 0x8 packet header | all | 28 bits of counter_trig_out | |
2 | trigger timestamp | trig_ts | all | 62.5MHz trigger timestamp |
3 | accepted triggers | counter_trig_out | all | counter of accepted triggers |
4 | input triggers | counter_trig_in | all | counter of trigger input |
5 | pulser triggers | counter_pulser | all | counter of pulser triggers |
6 | trigger bitmap | udp_trig_bits | 0x5a48448d (30Dec17_17:59) | bitmap of trigger information, see below |
7 | nim bits | udp_nim_bits_masked | ??? | 32 bits of ADC NIM inputs (2 bits per ADC) |
8 | esata bits | udp_esata_bits_masked | ??? | 32 bits of ADC ESATA inputs (2 bits per ADC) |
9 | mlu bits | aw16_prompt | 0x5b398983 (01Jul18_19:10) | 16 bits of MLU input, 1 bit per preamp |
10 | drift-blank-off counter | udp_drift_counter | 0x5b3aa19f (02Jul18_15:05) | counter of triggers that passed the drift blank-off |
11 | scaledown counter | udp_scaledown_counter | 0x5b3aa19f (02Jul18_15:05) | counter of triggers that passed the scaledown |
X | ||||
12 | 0x9 packet footer | all | 28 bits of counter_trig_out |
trigger bitmap
udp_trig_bits[0] <= adc16_grand_or; udp_trig_bits[1] <= adc32_grand_or; udp_trig_bits[2] <= adc_grand_or; udp_trig_bits[3] <= esata_nim_grand_or; udp_trig_bits[4] <= adc16_coinc_top; udp_trig_bits[5] <= adc16_coinc_bot; udp_trig_bits[6] <= adc16_coinc; udp_trig_bits[7] <= 0; udp_trig_bits[23:8] <= adc16_coinc_dff[15:0]; udp_trig_bits[31:24] <= mult16[7:0];
Firmware 0x5b08938c (25May18_15:51)
udp_trig_bits[0] <= adc16_grand_or; udp_trig_bits[1] <= adc32_grand_or; udp_trig_bits[2] <= adc_grand_or; udp_trig_bits[3] <= esata_nim_grand_or; udp_trig_bits[4] <= 0; // not used udp_trig_bits[5] <= 0; // not used udp_trig_bits[6] <= 0; // not used udp_trig_bits[7] <= 0; udp_trig_bits[23:8] <= 0; // not used udp_trig_bits[31:24] <= mult16[7:0];
Firmware 0x5b217dc4 (13Jun18_13:25)
udp_trig_bits[0] <= adc16_grand_or; udp_trig_bits[1] <= adc32_grand_or; udp_trig_bits[2] <= adc_grand_or; udp_trig_bits[3] <= esata_nim_grand_or; udp_trig_bits[4] <= 0; // not used udp_trig_bits[5] <= 0; // not used udp_trig_bits[6] <= 0; // not used udp_trig_bits[7] <= 0; udp_trig_bits[23:8] <= xadc16_or16[15:0]; // 16x AW preamps hits udp_trig_bits[31:24] <= xadc16_or16_mult[7:0]; // 16x AW preamp multiplicity (sum of xadc16_or16 bits)
Firmware 0x5b3aa19f (02Jul18_15:05)
udp_trig_bits[0] <= adc16_grand_or; udp_trig_bits[1] <= adc32_grand_or; udp_trig_bits[2] <= adc_grand_or; udp_trig_bits[3] <= esata_nim_grand_or; udp_trig_bits[4] <= 0; // not used udp_trig_bits[5] <= 0; // not used udp_trig_bits[6] <= 0; // not used udp_trig_bits[7] <= udp_mlu_out; udp_trig_bits[23:8] <= xadc16_or16[15:0]; // 16x AW preamps hits udp_trig_bits[31:24] <= xadc16_or16_mult[7:0]; // 16x AW preamp multiplicity (sum of xadc16_or16 bits)
TODO
- add FwRev to the UDP data output
End
//KO