Difference between revisions of "Testing Clock Cards"

From MCEWiki
Line 21: Line 21:
 
=== Programming via Front-panel JTAG connector===
 
=== Programming via Front-panel JTAG connector===
 
# Load FPGA firmware using Quartus. Firmware is located at http://e-mode.phas.ubc.ca/mce_firmware/. Run auto-detect and you should see list of devices. The part at the bottom of the list corresponts to Clock card FPGA and the part above it in the list is EPC16 or the "application configuration device". Right click on the row and choose a file to program. Load following firmware from the above directory: CC firmware 5.0.e, '''cc_v0500000e_15may2012.sof''' for FPGA and '''cc_v0500000e_15may2012.pof''' for EPC16. Then checkmark the program button for both devices and press start programming. The green LED should come up when programming is done.  
 
# Load FPGA firmware using Quartus. Firmware is located at http://e-mode.phas.ubc.ca/mce_firmware/. Run auto-detect and you should see list of devices. The part at the bottom of the list corresponts to Clock card FPGA and the part above it in the list is EPC16 or the "application configuration device". Right click on the row and choose a file to program. Load following firmware from the above directory: CC firmware 5.0.e, '''cc_v0500000e_15may2012.sof''' for FPGA and '''cc_v0500000e_15may2012.pof''' for EPC16. Then checkmark the program button for both devices and press start programming. The green LED should come up when programming is done.  
 
 
# If the tx/rx fibers are connected right, the red LED is off and the green LED is on. If the Sync Box fiber is connected and Sync Box is on, then the amber LED is also off.
 
# If the tx/rx fibers are connected right, the red LED is off and the green LED is on. If the Sync Box fiber is connected and Sync Box is on, then the amber LED is also off.
 
 
# Now make sure that the card communicates with the PC.  
 
# Now make sure that the card communicates with the PC.  
 
   mce_cmd -x rb cc fw_rev
 
   mce_cmd -x rb cc fw_rev
Line 30: Line 28:
 
   Line  0 : ok : 0x500000e
 
   Line  0 : ok : 0x500000e
  
So far, you confirmed that FPGA is programmed correctly.
+
So far, '''you confirmed that FPGA is programmed successfully and the fiber interface is working.'''
  
 
Now, proceed to programming the factory-configuration device.
 
Now, proceed to programming the factory-configuration device.
Line 39: Line 37:
 
# Power on the MCE.
 
# Power on the MCE.
 
# In Quartus, press on auto-detect and you should only see two devices listed. Choose the same pof file for EPC16.
 
# In Quartus, press on auto-detect and you should only see two devices listed. Choose the same pof file for EPC16.
'''cc_v0500000e_15may2012.sof'''
+
'''cc_v0500000e_15may2012.pof'''
 +
# Turn off the MCE, unplug the card and remove the JTAG cable. Then re-insert the card and power on the MCE.
 +
# The green LED should come on. Ths confirms that '''factory configuraiton is loaded successfully upon power up'''.
 +
 
 +
# Verify that the application configuration can be loaded successfuly:
 +
mce_cmd -x wb cc config_app 1
 +
The Green LED should momentarily go off, the red LED should momentarily turn on and then when firmware is loaded, green LED would be on and red is off.
 +
This shows that '''application configuration is loaded successfully'''.
  
 
== Testing General Features (card_all_test)==
 
== Testing General Features (card_all_test)==
We run a scrip on the mas PC to issue commands over the fibre to test the Readout Card unit under test. In this script, the following circuits are tested: LEDs, silicon ID chip, slot-id and pcb-revision identification pins, FPGA and board temperature sense circuitry, LVDS communication pairs.
+
The following script is used to test features that are common to all MCE cards: LED, silicon id, card_type, PCB revision, LEDs, dip switches, etc.
  
On mas PC, type: '''card_all_test'''
+
On mas PC, type:  
 +
card_all_test -c cc SCC-NNN
  
 
The output should look like:
 
The output should look like:
 
   ****** Check to make sure the LEDs on the target card switched status! ****
 
   ****** Check to make sure the LEDs on the target card switched status! ****
   Unit Under Test  :  rc1
+
   Unit Under Test  :  CC
   Serial Number    :  SRC-216
+
   Serial Number    :  SCC-069
   Firmware Revision:  -0xfffa
+
   Firmware Revision:  5.0.e
 
   card_id          :  0x20be502
 
   card_id          :  0x20be502
   slot_id          :  [4]
+
   slot_id          :  [1]
   card_type        :  [2]
+
   card_type        :  [1]
   card_rev        :  0
+
   card_rev        :  D
 
   fpga_temp        :  34 C pass
 
   fpga_temp        :  34 C pass
 
   card_temp        :  28 C pass
 
   card_temp        :  28 C pass
   results are in  :  /data/cryo/current_data/SRC-216_1285959943_all_test
+
   results are in  :  /data/cryo/current_data/SCC-069_1285959943_all_test
  
 
copy the results into the test logfile and record the card_id on [[MCE CARD Serial-Number Lookup]]
 
copy the results into the test logfile and record the card_id on [[MCE CARD Serial-Number Lookup]]
  
== Testing Serial Configuration device and FPGA reconfiguration ==
+
== Testing lvds rx/tx or command/reply lines==
Load firmware into the configuration device as oppose to the FPGA now. The parallel configuration device, EPC16, is programmed through the JTAG port on the Clock-Card front panel. Here are the steps:
+
 
* Run Quartus programmer and click on auto-detect. You should see 4 devices in the list.
+
run mce_status -s|grep fw_rev
* Select EPC16 device on top and click on change file to choose ''' cc_v05030001_12apr2012.pof''' (found in http://e-mode.phas.ubc.ca/mce_firmware/ )
+
and you should see all cards listed:
* Now select the device and click on program.
+
<RB cc fw_rev> 83886094
* When programming is done, turn off the power and turn it back on. If the Green Light is on, it means that you have successfully programmed the configuration device.
+
<RB rc1 fw_rev> 83951616
* on mas prompt, type:''' mce_cmd -x rb bc1 fw_rev''' and you should see the firmware revision of the firmware you loaded. This is usually noted in the filename of the file you chose.
+
<RB rc2 fw_rev> 83951616
 +
<RB bc1 fw_rev> 83886087
 +
<RB bc2 fw_rev> 83886087
 +
<RB bc3 fw_rev> 00000000
 +
<RB ac fw_rev> 83886084
  
 
Record the result in logfile.
 
Record the result in logfile.
 +
 +
== Testing Sync Box communication ==
 +
Check the amber LED and it should be on if the Sync input is not connected or if the Sync Box is off. Check to see the LED go off when the Sync Box is turned on and the fiber cable is connected to the Sync input. Now on mas PC, issue the following commands:
 +
wb cc select_clk 1
 +
wb cc use_dv 2
 +
wb cc use_sync 2
 +
rb cc select_clk
 +
 +
The last command should return 1 which means the Clock Card is still running from the Sync Box clk.
 +
Take some data to verify that the manchester decoder is working:
 +
mce_run test_data_xxxx 100 1
 +
 +
check to see whether the file exist and has some data.
 +
Then unplug the Sync input and issue:
 +
wb cc led 7
 +
 +
no reply should come back. Now issue
 +
rb cc select_clk
 +
and the result should be 0 which means the clock has fallen back on the internal clock on clock card.
 +
 +
== ==
 +
 +
 +
 +
 +
  
 
log results
 
log results

Revision as of 16:39, 6 June 2013

Setup

The following equipments are needed:

  • mas PC: An ubuntu-based PC with ARC-64 PCI card installed an running mas software.
  • A fully populated 5-MDM MCE subrack with Device under test (DUT) plugged into this backplane during testing.
  • fibre-optic cable: connects mas-PC to Clock Card.
  • set of Linear supplies to power up the cards. (3V, 4.5V, 6.2V, -6.2V)
  • Altera USB programmer: attached to the JTAG connector in Clock card front panel.
  • PC with Quartus installed: used to program FPGA and configuration devices on Readout Card.
  • Sync Box with a fiber-optic cable connecting a fiber output to the sync input of the Clock Card.

If you have all the above and if your DUT has already been smoke tested, you are ready to start:

  1. Connect all the cables.
  2. unplug all cards from Subrack except Clock card unit under test, (just pull out, so they are not inserted)
  3. Power on the MCE and if the clock card is not progammed, the red led should be on.

Configuring Clock Card

The FPGA on clock card (U7) can be configured from one of the two on-board configuration devices (EPC16): A factory configuration device (U18) and an application configuration device (U17). The factory configuration is loaded upon power up and hard reset. The application configuration is loaded by issuing a command on the mas PC: wb cc config_app 1.

The FPGA and the application configuration device can be programmed through the front-panel JTAG port while the factory configuration device can be programmed from the on-board connector.

Programming via Front-panel JTAG connector

  1. Load FPGA firmware using Quartus. Firmware is located at http://e-mode.phas.ubc.ca/mce_firmware/. Run auto-detect and you should see list of devices. The part at the bottom of the list corresponts to Clock card FPGA and the part above it in the list is EPC16 or the "application configuration device". Right click on the row and choose a file to program. Load following firmware from the above directory: CC firmware 5.0.e, cc_v0500000e_15may2012.sof for FPGA and cc_v0500000e_15may2012.pof for EPC16. Then checkmark the program button for both devices and press start programming. The green LED should come up when programming is done.
  2. If the tx/rx fibers are connected right, the red LED is off and the green LED is on. If the Sync Box fiber is connected and Sync Box is on, then the amber LED is also off.
  3. Now make sure that the card communicates with the PC.
 mce_cmd -x rb cc fw_rev

and you will see:

 Line   0 : ok : 0x500000e

So far, you confirmed that FPGA is programmed successfully and the fiber interface is working.

Now, proceed to programming the factory-configuration device.

Programming via on-board P2 JTAG connector

  1. Now turn off the MCE,
  2. unplug the Clock Card and move the JTAG programming cable from the front-panel to the on-board P2 connector. plug the card back in and let the cable slide through the slot.
  3. Power on the MCE.
  4. In Quartus, press on auto-detect and you should only see two devices listed. Choose the same pof file for EPC16.

cc_v0500000e_15may2012.pof

  1. Turn off the MCE, unplug the card and remove the JTAG cable. Then re-insert the card and power on the MCE.
  2. The green LED should come on. Ths confirms that factory configuraiton is loaded successfully upon power up.
  1. Verify that the application configuration can be loaded successfuly:
mce_cmd -x wb cc config_app 1

The Green LED should momentarily go off, the red LED should momentarily turn on and then when firmware is loaded, green LED would be on and red is off. This shows that application configuration is loaded successfully.

Testing General Features (card_all_test)

The following script is used to test features that are common to all MCE cards: LED, silicon id, card_type, PCB revision, LEDs, dip switches, etc.

On mas PC, type:

card_all_test -c cc SCC-NNN

The output should look like:

 ****** Check to make sure the LEDs on the target card switched status! ****
 Unit Under Test  :  CC
 Serial Number    :  SCC-069
 Firmware Revision:  5.0.e
 card_id          :  0x20be502
 slot_id          :  [1]
 card_type        :  [1]
 card_rev         :  D
 fpga_temp        :  34 C pass
 card_temp        :  28 C pass
 results are in   :  /data/cryo/current_data/SCC-069_1285959943_all_test

copy the results into the test logfile and record the card_id on MCE CARD Serial-Number Lookup

Testing lvds rx/tx or command/reply lines

run mce_status -s|grep fw_rev and you should see all cards listed: 83886094 83951616 83951616 83886087 83886087 00000000 83886084

Record the result in logfile.

Testing Sync Box communication

Check the amber LED and it should be on if the Sync input is not connected or if the Sync Box is off. Check to see the LED go off when the Sync Box is turned on and the fiber cable is connected to the Sync input. Now on mas PC, issue the following commands:

wb cc select_clk 1
wb cc use_dv 2
wb cc use_sync 2
rb cc select_clk 

The last command should return 1 which means the Clock Card is still running from the Sync Box clk. Take some data to verify that the manchester decoder is working:

mce_run test_data_xxxx 100 1

check to see whether the file exist and has some data. Then unplug the Sync input and issue:

wb cc led 7

no reply should come back. Now issue

rb cc select_clk 

and the result should be 0 which means the clock has fallen back on the internal clock on clock card.

log results