These instructions assume you have successfully installed and tested your software. See AMC13CppGettingStarted for instructions if you haven't

Actions
Update Firmware
Fake Data Readout
Connect Multiple AMC13s
Setup one 10Gb link to cms1 FEROL

For some instructions specific for Building 28 (at CERN), please go here:

Building 28 Instructions

Update Firmware using AMC13Tool2

Make sure that you have the latest firmware files for both the Spartan and Kintex chips by downloading the latest '.mcs' files from here. To be safe, download all of the MCS files for the latest versions (the tool will pick the correct file where there is more than one choice). Put the firmware files in your current directory.

Use the pk command to program the T1 (Kintex) and ps to program the T2 (Spartan). Then use reconfigureFPGAs to force a reload from flash.

Here is an example session where we program the Kintex and Spartan and then reload:

[ehazen@cms1 amc13_mcs]$ ../tools/bin/AMC13Tool2.exe -c ../amc13/etc/amc13/connectionSN43.xml 
Using AMC13 software ver:30757

>fv      # check current firmware versions
Connected AMC13s
*0: SN:  43 T1v: 0209 T2v: 0021 cf: ../amc13/etc/amc13/connectionSN43.xml

>pk    # program the Kintex
chip_type not specified, using default from serial number...
Searching for files with T1 and 7K325T...

1. AMC13T1v0x020d_7k325t.mcs
Connect Multiple AMC13s
Enter number for MCS file to select (0 to exit): 1
Programming against file: AMC13T1v0x020d_7k325t.mcs...
Programming AMC13T1v0x020d_7k325t.mcs to flash address 0x400000...
Erasing flash sector at address 0x400000
Erasing flash sector at address 0x440000
...
programming flash at address 0xee9e00
programming flash at address 0xe2e700	 % done = 6
programming flash at address 0xd72f00	 % done = 13
...
programming flash at address 0x564700	 % done = 87
programming flash at address 0x4a8f00	 % done = 94

>ps    # program the Spartan
chip_type not specified, using default from serial number...
Searching for files with T2, and 6SLX25T...

1. AMC13T2v0x0021_6slx25t.mcs

Enter number for MCS file to select (0 to exit): 1
Programming against file: AMC13T2v0x0021_6slx25t.mcs...
Programming AMC13T2v0x0021_6slx25t.mcs to flash address 0x200000...
Erasing flash sector at address 0x200000
Erasing flash sector at address 0x240000
...
programming flash at address 0x2c3b00
programming flash at address 0x208400	 % done = 97

NOTE: The most recent versions of these program commands should automatically verify the relevant flash sector against the chosen firmware file, but if it does not, use 'vk' and 'vs' respectively for verifying the T1 and T2 (upon using the command select the new firmware file to check against what is programmed in flash). Be sure to verify flash sector prior to reconfiguring or power cycling.

>reconfigureFPGAs     # force reload from flash
Best exit/restart tool after 10s or so

>q
[ehazen@cms1 amc13_mcs]$ ../tools/bin/AMC13Tool2.exe -c ../amc13/etc/amc13/connectionSN43.xml 
Using AMC13 software ver:30757
>fv   # check versions again
Connected AMC13s
*0: SN:  43 T1v: 020d T2v: 0021 cf: ../amc13/etc/amc13/connectionSN43.xml
>

Fake Data Readout

This recipe tells you how to generate fake events in the AMC13 and read them out over IPBus. Required equipment:

  • AMC13XG module installed in upper "MCH2" site in center of crate
  • SFP transceiver installed in TTC (bottom) site in AMC13XG
  • Loop-back optical fiber connected between Tx and Rx of TTC SFP

Here's the recipe (example below is for SN 86, make sure use the IP address or connection files that correspond to your board):

1. Connect to the AMC13 either by connection file or by spartan (T2) IP address (assuming T1 IP address is 1 higher than the T2 address).

[hazen@cms4 scripts]$ AMC13Tool2.exe -c connectionSN86.xml
OR
$ AMC13Tool2.exe -c 192.168.1.82
Address table path "/home/hazen/work/amc13/amc13/etc/amc13" set from AMC13_ADDRESS_TABLE_PATH
Using AMC13 software ver:32678

2. Reset AMC13 (general and counter).

> rg
> rc

3. Enable link with fake events ('f') and TTC loopback ('t') options and start run (part of enable command by default).

NOTE: If we are building fake events, these are generated internally, so in this case, the actual numbers denoted are unimportant. But when building events from actual AMCs, you would denote the slot numbers corresponding to the modules you will be reading event data from.

http://cms1.bu.edu:33001/urn:xdaq-application:lid=12
>en 1-4 f t
parsed list "1-4" as mask 0xf
Enabling fake data
Enabling TTS as TTC for loop-back
AMC13 out of run mode
AMC13 is back in run mode and ready
4. Set up local triggers. There are various options how you would like triggers to be sent (number of triggers per bunch, rate, etc.), for help use 'h localL1A'. In this example we will just send 1 trigger per orbit.
>localL1A o 1 1
Configure LocalL1A enabled mode=0 burst=1 rate=1 rules=0
5. Send Triggers
>lt 5
detected number after 'lt'
Sending 5 local triggers
Trigger: 4 left
Trigger: 3 left
Trigger: 2 left
Trigger: 1 left
Trigger: 0 left
6. Use status command to check to see that L1As were sent+received and that events were built.
>st
            Board| SERIALNO| T1_VER| T2_REV| T2_SERNO|
               --|---------|-------|-------|---------|
             INFO|     0x56| 0x400A|   0x21|     0x56|

          Control| DAQ| FAKE| LTRIG| RUN| TTCLOOP|
               --|----|-----|------|----|--------|
            REG_1| 0x0|  0x1|   0x1| 0x1|     0x1|

        AMC_Links| AMC01| AMC02| AMC03| AMC04|
               --|------|------|------|------|
   AMC_LINK_READY|   0x0|   0x0|   0x0|   0x0|
     LOSS_OF_SYNC|   0x1|   0x1|   0x1|   0x1|

    Event_Builder| COUNT|
               --|------|
              L1A|   0x5|

   Monitor_Buffer| COUNT|
               --|------|
       UNREAD_EVT|   0x5|

     State_Timers|       COUNT|
               --|------------|
             BUSY| 0x000000001|
 OVERFLOW_WARNING| 0x000000001|
            READY| 0x1B8E4CA11|
              RUN| 0x1B8E4CA0F|

           TTC_Rx| ENC| RAW|
               --|----|----|
            STATE| RDY| RDY|
7. Read out events.
>re
calling readEvent...AOK
Read 16400 words
   0: 510000011f400008
   1: 104401000060d780
   2: 0f00100200010000
   3: 0f00100200020000
   4: 0f00100200030000
   5: 0f00100200040000
   6: 010000011f401002
   7: 000700060d780000
   8: 000b000a00090008
   9: 000f000e000d000c
 ...
16395: 3fff3ffe3ffd3ffc
16396: 4003400240014000
16397: 7122902601001002
16398: 0f2fe8ab000011f4
16399: a0004010fc520000
>

-- EricHazen - 18 Nov 2014

Connect Multiple AMC13s

This recipe tells you how to connect multiple AMC13s and how to send fake payloads from AMC13s in slots 1-12 to an AMC13 in the MCH slot. The AMC13s in slots 1-12 act as uHTRs. Required equipment:

  • AMC13XG module installed in upper "MCH2" site in center of crate
  • At least one AMC13XG installed in a slot 1-12
  • SFP transceiver installed in TTC (bottom) site in all AMC13XGs*
  • Loop-back optical fiber connected between Tx and Rx of TTC SFP in all AMC13XGs*
*The Loop-back for the AMC13XGs in slots 1-12 is for the TTS state to be sent to the backplane

There are two ways to connect to multiple AMC13s. One is on the command line with AMC13Tool2, the other is inside AMC13Tool2:

First way

When starting the tool:
[cjjacob@cms4 amc] ./tools/bin/AMC13Tool2.exe -c 161 -c 303
use_ch false
Created URI from IP address:
  T2: ipbusudp-2.0://192.168.2.188:50001
  T1: ipbusudp-2.0://192.168.2.189:50001
Using AMC13 software ver:41103
use_ch false
Created URI from IP address:
  T2: ipbusudp-2.0://192.168.3.160:50001
  T1: ipbusudp-2.0://192.168.3.161:50001
Using AMC13 software ver:41103
>

Second Way

Inside the tool, use the command connect:
[cjjacob@cms4 amc] ./tools/bin/AMC13Tool2.exe -c 161
Address table path "/home/cjjacob/amc13/amc13/etc/amc13" set from AMC13_ADDRESS_TABLE_PATH
use_ch true
Created URI from IP address:
  T2: chtcp-2.0://localhost:10203?target=192.168.2.188:50001
  T1: chtcp-2.0://localhost:10203?target=192.168.2.189:50001
Using AMC13 software ver:41103
>connect 303
use_ch false
Created URI from IP address:
  T2: ipbusudp-2.0://192.168.3.160:50001
  T1: ipbusudp-2.0://192.168.3.161:50001
Using AMC13 software ver:41103
>

You can see which AMC13s are connected by using the list (fv) command. This also lists their firmware versions and serial numbers. You can select the active AMC13 (the one that will execute your commands) with the selectAMC13 (sel) command.

>fv
Connected AMC13s
*0: SN: 161 T1v: 0244 T2v: 002e cf: 161
 1: SN: 303 T1v: 100b T2v: 002a cf: 303
>sel 1
Setting default AMC13 to 1

The AMC13s you want to send fake payloads should have 0x1000 series T1 firmware and should be in slots 1-12 (not the MCH slot), which you can find in this list of firmware. Check the Update Firmware recipe if you're not sure how to change the AMC13 firmware.

If the AMC13 has the 0x1000 series firmware, you can control the fake payloads by setting a lower bound at register 0x18 and an upper bound at register 0x19, then performing a general reset. Example:

>wv 0x18 0x400
Write to address 0X18
>wv 0x19 0x1200
Write to address 0X19
>wv 0 1
Write to address 0

if you are using HCAL firmware also write

wv 0x17 0x80000000

will send fake payloads between 0x400 and 0x1200 64-bit words in size.

After you've set all the fake payload sizes, return to the AMC13 in the MCH slot with the sel command. You must now enable the AMC13s that will send fake triggers with the en command using their slot number. In this example AMC13 SN 303 is in slot 2 of the crate.

>en 2 t
parsed list "2" as mask 0x2
Enabling TTS as TTC for loop-back
AMC13 out of run mode
AMC13 is back in run mode and ready

Now, you can use the lt command to send local triggers.

>lt 2
detected number after 'lt'
Sending 2 local triggers
Trigger: 0 left

There are now unread events in the monitor buffer.

Connect AMC13 and a single 10Gb FEROL

Make two connections to cms1 as the daq user, and then in both terminals, cd to the local FEROL directory.

First, setup the AMC13 by using the following commands in AMC13Tool2.exe

rg
rc
en 1-12 f t
daq 1
fed 0 100
localL1A o 1 1

Or you can just run "AMC13Tool2.exe -c 285/c -X amc13_script.txt" in the FEROL directory and it will run all of them for you.

Then switch to the other terminal and type "./fedKit.py" into the terminal. It will ask you several questions, but the default values should be fine. Here is an example:

[daq@cms1 FEROL]$ ./fedKit.py 
Welcome to the optical FEDkit
=============================
Please select the data source to be used:
  1 - AMC13 data source over 6Gb        (L6G_SOURCE)
  2 - Generator core of AMC13 over 6Gb  (L6G_CORE_GENERATOR_SOURCE)
  3 - Loopback at the FEROL             (L6G_LOOPBACK_GENERATOR_SOURCE)
  4 - AMC13 data source over 10Gb       (L10G_SOURCE)
  5 - Generator core of AMC13 over 10Gb (L10G_CORE_GENERATOR_SOURCE)
  6 - SLINK data source                 (SLINK_SOURCE)
=> [4] 
Please enter the FED id you want to read out [100]: 
Do you want to write the data to disk? [No]:
Starting run...

The program will hang here for up to a minute, but then show the following command prompt:

Running. Point your browser to http://cms1.bu.edu:33001

m   display this Menu
f#  dump the next # FED fragments incl DAQ headers (default 1)
e#  dump the next # Events with FED data only (default 1)
q   stop the run and Quit
            
=> 

At this point you can go back to the AMC13 screen and type "lt 1" to send a trigger or two.

You can monitor the status of the link in the AMC13Tool2.exe by typing "status" and looking at the SlinkExpress table.

You can also monitor the FEROL by going to: http://cms1.bu.edu:33000/urn:xdaq-application:lid=11 and you can see if events are being built by going to: http://cms1.bu.edu:33001/urn:xdaq-application:lid=12

-- ColinJacob - 10 Dec 2015

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r11 - 20 Apr 2016 - DanielGastler
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback