The Actel software device in the FeeServer CE
for controlling the Active Partial Configuration solution
Overview
As described in Electronics for the Time Projection Chamber (TPC) the RCU has an Active Partial Reconfiguration (APR) network to reconfigure the Xilinx SRAM based FPGA in case there appear errors due to the radiation environment. This reconfiguration network includes some Flash memory and the Actel Flash based FPGA. The main task of the Actel software device is to monitor and control the operation of the Actel FPGA. For this reason it offers different services, as monitoring different registers that give information about the state of the hardware, to control the main operation modes of the Actel FPGA and to program the Flash memory for the Active Partial Reconfiguration solution to work.
The Actel FPGA features three ways to configure the Xilinx Virtex-II Pro FPGA:
- Initial Configuration
- Configures the Xilinx Virtex-II Pro once during startup or on command from the DCS board.
- Scrubbing
- Continously overwrites the configuration memory of the Xilinx Virtex-II Pro, wether an error occured or not.
- Frame by Frame readback and error correction
- The Actel reads back the single configuration frame of the Xilinx Virtex and compares them to the configuration data stored in the Flash memory on the RCU.
For this Active Partial Reconfiguration solution to work, the Flash memory has to be programmed with the correct firmware for the Xilinx FPGA. There are two ways on how to program the Flash memory:
- The rcuflashprog command line tool
- the here described Actel software device
Information about the Actel FPGA and the rcuflashprog tool can be found at: Electronics for the Time Projection Chamber (TPC)#RCU Auxilliary FPGA Firmware for TPC and PHOS
The services
Some information that the Actel firmware provides is published to the upper layers, to monitor the status of the hardware and information about the number of errors due to the radiation environment.The Services provided are:
- ACTEL_STATE
- The int number representing the state.
- ACTEL_STATENAME
- The name of the current state, can be OFF | IDLE | SCRUBBING | READBACK | ERROR
- ACTEL_FWVERSION
- The firmware version of the Actel FPGA
- ACTEL_STATUSREG
- The status register of the Actel FPGA, Explanation:
- ACTEL_ERRORREG
- The error register of the Actel FPGA, Explanation:
- ACTEL_CYCLECOUNTER
- The number of cycles, how often complete Scrubbing or Frame by frame readback cycles were performed over all the Xilinx memory.
- ACTEL_FRAMEERRORCOUNT
- The number of errors corrected during Frame by frame readback. Expected are about 10-100 Errors for all 216 RCUs during a 4 hour run.
The statemachine
The statemachine for the Actel represents the main operating modes and adds states for error handling. The initial state is OFF/idle and during the transition to ON/configured the error and status register are cleared, the Flash is checked for proper configuration. When entering a mode of active partial reconfiguration, the counters are reset. During Scrubbing the Cyclecounter is updated, during Readback Verification also the Frameerrorcounter. In case slight errors occur during the operation, the Failure state is entered, from where an automatic recovery is attempted. In case this fails, or a severe error occurs, the Error state is entered, from where the Actel software device has to be reset manually.
States can be changed using the fee-client lib. For test purpose, the states can be changed using the feeserver-ctrl command line tool, which uses the fee-client lib. Some commands: To enter the ON/configured state:
echo '<fee>CE_TRIGGER_TRANSITION ACTEL switchon</fee>' | feeserver-ctrl --server TPC-FEE_0_13_1
To enter the Scrubbing state:
echo '<fee>CE_TRIGGER_TRANSITION ACTEL GO_Scrubbing</fee>' | feeserver-ctrl --server TPC-FEE_0_13_1
To quit the scrubbing state:
echo '<fee>CE_TRIGGER_TRANSITION ACTEL QUIT_Scrubbing</fee>' | feeserver-ctrl --server TPC-FEE_0_13_1
The other transitions:
To enter Readback Verification: GO_Readback
To quit Readback Verification: QUIT_Readback
To recover from the Error state: GO_Idle
To from ON/configured back to OFF/idle: stop
Programming the Flash
Programming the Flash on the RCU can be done in two ways: Either via the rcuflashprog command line tool from the DCS board console, or via the FeeServer using the feeserver-ctrl command line tool from a remote console. The usage of the rcuflashprog tool is briefly described (further down), and also in the Actel Usermanual. When programming the Flash via the FeeServer, binary command blocks, that hold the necessary data, have to be available. Since the Flash is divided in three parts (Initial Configuration, Scrubbing, Frame by Frame readback), there are three binary command blocks, each dedicated to one part of the Flash memory. The command blocks can then be send to the FeeServer via the fee-client lib. The feeserver-ctrl command line tool uses this lib. Commands can then be send in the following way:
cat rcu_iconfflash.bin | feeserver-ctrl --server TPC_FEE_1_12_1
Operating the Actel from PVSS
PVSS (Prozess Visualisierungs- und Steuerungssystem by ATM) is a commercial controlling software used to control the ALICE detector. Several panels have been developed by Christian Lippmann at Cern to control the APR solution on the RCU.
As its common in PVSS, a single RCU can be changed in its state by clicking on the according place on the end caps. To change the state of several RCUs, the FSM button in the top left corner, under the Alice logo can be used.
Upgrading the Flash memory with a new RCU firmware version
For now the feeserver-ctrl command line tool is needed. Later the binary command blocks will be stored in the configuration database and can be selected and send from there.
For a full configuration, first the flash has to be erased, and then the three data block send:
cat rcu_eraseflash.bin | feeserver-ctrl --server TPC_FEE_1_12_1 cat rcu_iconfflash.bin | feeserver-ctrl --server TPC_FEE_1_12_1 cat rcu_scrubflash.bin | feeserver-ctrl --server TPC_FEE_1_12_1 cat rcu_frameflash.bin | feeserver-ctrl --server TPC_FEE_1_12_1
Make sure to monitor the logfiles to see that everything went well.
Addendum
How to use the framegen tool
The framegen is used to extract the configuration frames from the Xilinx Virtex-II Pro FPGA.
When reading back the raw data, the framegen stores the frames as three versions:
- the raw framefile
- the read framefile (read header and read footer attached)
- the write framefile (write header and write footer attached)
For this the header and footer files have to be given as arguments to the framegen, as well as the frameconfig file, which defines the frames to be read back. The syntax is: ./framegen frames936.txt read_header read_footer write_header write_footer
How to use the rcuflashprog tool
The rcuflashprog tool is used to program the Flash memory on the RCU.
A sample config file for the rcuflashprog tool:
#enable erase enable_erase = true #init program file enable_icfile = true path_icfile = /mnt/kjekspc4/fee-net/rcu_fw/rcu_190606bg3/ name_icfile = rcu.bit startaddr_icfile = 8000h #scrubbing file enable_scfile = true path_scfile = /mnt/kjekspc4/fee-net/rcu_fw/rcu_190606bg3/ name_scfile = rcu_apr.bit startaddr_scfile = 60000h #frame file enable_frfiles = true path_frfiles = /mnt/kjekspc4/fee-net/rcu_fw/rcu_190606bg3/ name_readframefile = r_frame$.hex name_rawframefile = frame$.hex name_writeframefile = w_frame$.hex framesfile = frames936.txt startaddr_frfiles = 100000h frame_offset = 2h header_size_read = 1Bh footer_size_read = 0Bh
In the enable_xxx config lines, the specific action can be chosen, wether the flash should be deleted prior to programming (recommended), and which of the flash parts (initial config, scrubbing or frame by frame readback) shoudl be programmed. For the initial config and the scrubbing, only one file each has to be supplied (the rcu.bit/rcu_apr.bit). For the frame section, all the single frames files are needed. The names of the frames have to be supplied in the 'framesfile'. The Xilinx Virtex-II Pro has 936 configurable frames, a file with all the 936 filenames can be downloaded here.
A newer version of the rcuflashprog is under development, where the frame files are extracted from the rcu.bit file.
How to use the rcuflash_feessvr tool
The rcuflash_feesvr tool in the FeeServer package generates the binary command blocks that can be send to the FeeServer to program the Flash memory on the RCU.
An example config file for the rcuflash_feeserver tool looks like this:
#FeeServer BLOB generator Configfile. #Do not edit unless you know what you are doing! #You have been warned.. #global option to enable BB_FLASH mode enable_bb_flash = true #enable erase enable_erase = true #init program file enable_icfile = true path_icfile = /home/dominik/src/work/FeeServer/build-dummy/tools/rcu_190606bg/ name_icfile = rcu.bit startaddr_icfile = 8000h BB_init_addr = 0h BB_init_info_addr = 3000h init_addr = 3f9000h init_info_addr = 3f9002 rcu_fw_version = 190606b #scrubbing file enable_scfile = true path_scfile = /home/dominik/src/work/FeeServer/build-dummy/tools/rcu_190606bg/ name_scfile = rcu_apr.bit startaddr_scfile = 60000h BB_scrub_addr = 1000h BB_scrub_info_addr = 4000h scrub_addr = 3fa000 scrub_info_addr = 3fa002 #frame file enable_frfiles = true path_frfiles = /home/dominik/src/work/FeeServer/build-dummy/tools/rcu_190606bg/ name_readframefile = r_frame$.hex name_rawframefile = frame$.hex name_writeframefile = w_frame$.hex framesfile = frames936.txt startaddr_frfiles = 100000h stopaddr_frfiles = 0h frame_offset = 2h #frame offset will have 00 appended: 2h -> 200h header_size_read = 1Bh footer_size_read = 0Bh BB_frame_addr = 2000h BB_frame_info_addr = 5000h frame_addr = 3fb000h frame_info_addr = 3fb002h
Composition of the Binary command blocks
The Binary command blocks contain information for the Actel software device in the FeeServer CE as well as the actual data that has to be programmed to the Flash.
Erase command
the Erase block only consists of the Header and Tailer, which tells the Actel softwaredevice to erase the Flash memory completely.
Header | CE_CMD_TAILER |
---|---|
0xf405 0000 | 0xdd33 0000 |
Initial Configuration Block
The initial configuration block contains the data of the 'rcu.bit' and some information about addresses and pointers in the flash. Furthermore the RCU firmware version is also coded into this command block and written on the Flash. In this way it can be checked which version of the RCU firmware is currently residing in the Flash memory device. This command block has about 560 kBytes in size.
Header | INIT_ADDR | INIT_INFO_ADDR | START_ADDR | FILESIZE | RCU_FW_VERSION | DATA | CE_CMD_TAILER |
---|---|---|---|---|---|---|---|
0xf406 0000 | 0x0000 0000 | 0x0000 3000 | 0x0000 8000 | 0x0008 8e68 | 0x0190 606b | (rcu.bit) | 0xdd33 0000 |
Scrubbing Block
The scrubbing command is similar to the initial configuration command block in its structure, the scrubbing command block just uses different addresses and data and omits the rcu firmware version number. This command block has about 340 kBytes in size.
Header | SCRUB_ADDR | SCRUB_INFO_ADDR | START_ADDR | FILESIZE | DATA | CE_CMD_TAILER |
---|---|---|---|---|---|---|
0xf407 0000 | 0x0000 1000 | 0x0000 4000 | 0x0006 0000 | 0x0005 37e0 | (rcu_apr.bit) | 0xdd33 0000 |
Frame by Frame readback Block
The frame by frame readback block is the most complex and also biggest of the command blocks with its 1,33 MBytes. It holds all the necessary information to program the configuration frames of the Xilinx to the Flash. This is addresses, pointers and also 3 dedicated 'frame info registers', for forward compatibility the number of send frames is submitted as a parameter, which should make it easier to adapt the principle to later versions, maybe using the Xilinx Virtex-4, which has a different number of frames, and also a different size for the single frames.
Header | FRAME_OFFSET | FRAME_ADDR | FRAME_INFO_ADDR | START_ADDR | STOP_ADDR | FRAME_INFO_REG1 | FRAME_INFO_REG2 | FRAME_INFO_REG3 | SIZE_READ | SIZE_WRITE | Readframe Data | Writeframe Data | CE_CMD_TAILER |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0xf403 03a8 | 0x0000 0200 | 0x0000 2000 | 0x0000 5000 | 0x0010 0000 | 0x0000 0000 | 0x0000 2751 | 0x0000 d3cb | 0x0000 1b0b | 0x0000 01f8 | 0x0000 0398 | (NOF*Readframes) | (NOF*Writeframes) | 0xdd33 0000 |
The Header contains the number of frames (0x3a8 = 936).
Download Section
The framegen tool:
You can retrieve the framegen from the CVS, or download a compiled version here.
To get a version from the CVS, check out the dcsctools package, create a directory build-arm in the dcsctools directory, enter it, execute ../.autotools/acsetup.sh there. Do a ../configure --host=arm followed by the usual make. The framegen can only be executed on the DCS board and needs a mounted NFS directory with write access.
The rcuflashprog :
You can retrieve the rcuflashprog from the CVS, or download a compiled version here. Additionally you need the rcuflashprog config file. To program the Xilinx configuration frames to the flash, a file that holds the block, major and minor numbers, a sample file with all 936 frames can be found here.
rcuflashprog.tar.gz package. updated 22.04.08
The rcuflash_feesvr:
You can retrieve the rcuflash_feesvr from the CVS, or download a compiled linux version here. Additionally you need the rcuflash_feesvr config file. To define the frames which are to be put into the blobs, the frames936.txt is needed as well.
The binary command blocks are generated from the single frame files. You can use the framegen tool to extract these...
To compile an own version from the CVS, check out the FeeServer package and create a directory build-dummy in the FeeServer directory and enter it. Execute ../.autotools/acsetup.sh there. Do a ../configure followed by the usual make. The rcuflash_feesvr is then located in tools/src and can be run on any normal linux machine.
rcuflash_feesvr.tar.gz package
Binary command blocks:
For the RCU firmware V1 (FWV: 190606):
- This FW version does not support scrubbing or Frame by Frame readback.
- Also keep in mind that this version has a slight error, which makes it necessary to erase the Xilinx before Flash access is possible!
- The flash with this firmware version on it shows "190606" in the flash firmware version register.
For the RCU firmware V1bg (FWV: 190606bg):
- This FW version does not support scrubbing or Frame by Frame readback.
- The flash with this firmware version on it shows "190606b" in the flash firmware version register.
- This version is currently (13:32, 14 Mar 2008 (CET)) programmed on most of the RCUs of the TPC. We saw this version not working with few RCUs (5 of ~108), these RCUs have the original 190606 version programmed to their flash instead.
For the RCU firmware V1bg2 (FWV: 190606bg2):
- This FW version does not support scrubbing or Frame by Frame readback.
For the RCU firmware V1bg3 (FWV: 190606bg3):
- This FW version does not support any data readout (!) and should therefore only be used for test purposes.
For the RCU firmware V2
- still to come
Dominik 09:21, 31 Mar 2008 (CEST)