Presentation is loading. Please wait.

Presentation is loading. Please wait.

Clara Gaspar, February 2007 LHCb’s Experiment Control System & Electronics Integration Step by Step.

Similar presentations


Presentation on theme: "Clara Gaspar, February 2007 LHCb’s Experiment Control System & Electronics Integration Step by Step."— Presentation transcript:

1 Clara Gaspar, February 2007 LHCb’s Experiment Control System & Electronics Integration Step by Step

2 Clara Gaspar, February 2007 2 Overview ❚ Interfacing Electronics Boards ❙ SPECS & CC-PC Tools ❙ FwHw tool ❙ The Configuration DB ❚ Hierarchical Control ❙ The FSM Toolkit ❚ Note: This tutorial is only an overview ❙ The PVSS & Framework and the FSM courses are still required in order to use the tools!

3 Clara Gaspar, February 2007 3 SPECS Setup ❚ Demo Setup SPECS Master SPECS Mezzanine I2C widget Croquette ServerPC: pclbcecs03 SPECS I2C ClientPC: Portable SpecsSrv PVSS PVSS00dim Ethernet DNS SupportPC: pclhcb155 PVSS PVSS00dim Note: The DNS should run on a stable machine (same as PVSS), not on a portable…

4 Clara Gaspar, February 2007 4 CC-PC setup (example) ❚ Example Setup CC-PC Elec. Board ClientPC: pclhcb155 PVSS PVSS00dim Ethernet DNS Note: The DNS should run on a stable machine (same as PVSS), not on a portable… ccserv

5 Clara Gaspar, February 2007 5 Getting Ready ❚ Install PVSS 3.6 ❙ And all the cumulative patches ❚ Create a new project ❙ Guidelines for final Project/System names and numbers available at: ❘ https://edms.cern.ch/document/732486/2 https://edms.cern.ch/document/732486/2 ❚ Always download FW components from: ❙ LHCb/Online/ECS/LHCb Framework http://www.cern.ch/lhcb-online/ecs/lhcb-fw http://www.cern.ch/lhcb-online/ecs/lhcb-fw

6 Clara Gaspar, February 2007 6 Component Installation ❚ Download lhcbfw-2.0 (or above) ❚ And install the following components: (When installation tool asks where to install components please use: fwComponents_ ) ❙ fwCore (contains fwFSM) ❙ fwAccessControl ❙ fwConfigurationDB ❙ fwDIM ❙ fwSpecs/fwCcpc ❙ fwHw ❙ lbFsmDomains JCOP LHCb Specific

7 Clara Gaspar, February 2007 7 Setting things up ❚ For Specs: ❙ Server PC: pclbcecs03 ❘ Configure DIM_DNS_NODE 〡 Set Env. Variable DIM_DNS_NODE=pclhcb155 ❘ Start SpecsServer 〡 Available in fwComponents_ /bin (needs in windows: dim.dll and in linux: libdim.so in LD_LIBRARY_PATH) ❚ For CC-PC: (very similar) ❙ On the CC-PC ❘ Configure DIM_DNS_NODE 〡 Set Env. Variable DIM_DNS_NODE=pclhcb155 ❘ Start ccserv 〡 Available with CC-PC server installation

8 Clara Gaspar, February 2007 8 Setting things up ❚ Client PC: pclhcb155 or Portable ❙ Start DIM DNS ❘ Available in fwComponents_ /bin ❙ Configure DIM_DNS_NODE ❘ Set Env. Variable DIM_DNS_NODE=pclhcb155 OR ❘ Add “–dim_dns_node pclhcb155” in PVSS00dim console line ❚ FwSpecs Documentation: ❙ http://www.cern.ch/lhcb-online/ecs/PVSS_SPECS http://www.cern.ch/lhcb-online/ecs/PVSS_SPECS ❚ FwCcpc Documentation: ❙ http://www.cern.ch/lhcb-online/ecs/PVSS_CCPC http://www.cern.ch/lhcb-online/ecs/PVSS_CCPC

9 Clara Gaspar, February 2007 9 Accessing your electronics ❚ Using FwSpecs tools: ❙ Graphical User Interface ❘ Start SpecsClient User Interface 〡 For checking that connectivity works 〡 For debugging 〡 For discovering tool’s possibilities (I2C modes) ❙ Library of functions ❘ To be used in scripts or panels

10 Clara Gaspar, February 2007 10 fwSpecs PVSS Library ❚ Types of functions: ❙ Constants Constants ❙ Conversion Functions Conversion Functions ❙ Common Functions Common Functions ❙ I2C Functions I2C Functions ❙ JTAG Functions JTAG Functions ❙ PBUS Functions PBUS Functions ❙ REG Functions REG Functions ❙ DCU Functions DCU Functions Basically only for tests And for debugging For use with the HW tool

11 Clara Gaspar, February 2007 11 FwHw Tool ❚ A tool for modeling boards and their components ❘ Declaring boards (access via SPECS or CC-PC) Containing: 〡 Groups of Chips (recursive) Containing: ❘ Chips (TTCrx, Beetle, etc.) Containing: ❘ Registers (access via I2C/JTAG/Parallel Bus) ❚ FwHw Documentation: ❙ http://www.cern.ch/lhcb-online/ecs/FWHW http://www.cern.ch/lhcb-online/ecs/FWHW

12 Clara Gaspar, February 2007 12 FwHw Tool ❚ Start FwHw User Interface ❙ Create HW types: ❘ ex.: Delay chip, DCU, TTCRx -> Croc, etc ❙ Create boards of that type: ❘ ex: croc001, etc. ❘ Configure board’s settings (common and specific) ❘ “Subscribe” board ❘ “View” the board ❙ After using FwHw to define the boards: ❘ The library fwSpecs or fwCcpc will give you access to the data to be visualized or sent to the board ex.: fwSpecs_read(“croc001.delay.reg2”,…)

13 Clara Gaspar, February 2007 13 FwHw Tool ❚ Some Details ❙ I2C Sub-addressing Modes (same order as SpecsClient panel) ❘ 0 - Combined: most I2C standard chips (Beetle) ❘ 1 – Separated: chips with a pointer register ❘ 2 – CombinedRead: Calorimeter chips ❘ 3 - SeparatedNoAutoInc: Chips with pointer register but no auto-increment (GOL, TTcRx) ❘ 4 – SeparatedRead: OT FPGA registers ❘ 5 – CombinedFifo: Beetle Shift Registers ❘ 6 – CombinedNoAutoInc: Delay25 multiple reg r/w

14 Clara Gaspar, February 2007 14 FwHw Tool ❚ Some Details ❙ DCU Addressing Modes ❘ Internal DCU -> "Address" empty ❘ External DCU -> "Address" (hex) == MMBBAA 〡 MM = mode: 01 for I2C 〡 BB = bus: example 02 for bus 2 〡 AA = Address: ex. 60 for a DCU at I2C base addr 0x60 ❘ DCU with MUX -> "Address" (hex) == MMBBAA 〡 MM = mode: 01 - I2C/ 02 - JTAG/ 03 - PBUS/ 04 – REG 〡 BBAA = Bus/address for I2C or XXXX address others 〡 Register(hex) = data to write to MUX addr.

15 Clara Gaspar, February 2007 15 FwHw Tool ❚ Some Details ❙ Changing the SPECS speed: ❘ Common Settings, possibilities are: 〡 0 = 1024, 1 = 512, 2 = 256, 3 = 128, 4 = 64, 5 = 32, 6 = 16 ❘ The selected speed will be applied for any operations on that device -> minimizing the number of Speed change operations. ❘ If no speed is given the Max speed (1024 KHz) will be used ❘ The “speed” common setting is not propagated down on “save”.

16 Clara Gaspar, February 2007 16 FwHw Tool ❚ Some Details ❙ Read Modify Write (Masking) Operations: ❘ If the declared, for a register, size = n bytes ❘ If we write n*2 bytes, the last n are used as a mask ❘ Example: If size=2 and we write 0x01020F0F ❘ The server will: 〡 Read the contents of register 〡 Modify only the bits: XXXX0001XXXX0011 〡 Write back the results to the register

17 Clara Gaspar, February 2007 17 FwHw Tool ❚ Some Details ❙ Local Variables: ❘ Datapoint elements created in PVSS but not connected to the SPECS Server. ❘ Possible types: 〡 Int, Float String, DynInt, DynFloat, DynString ❘ Usefull for storing any necessary data: 〡 Summary of board status 〡 Data in a different format 〡 Etc.

18 Clara Gaspar, February 2007 18 FwHw Tool ❚ Subscription: ❙ The “Subscribe” operation has to be done only once per board. ❘ The fact that the board was “Subscribed” is remembered (until you do “Unsubscribe”) ❘ A manager PVSS00ctrl fwSpecsScript.ctl (always running): 〡 detects if a SpecsServer restarts and re-subscribes all boards managed by this specsServer 〡 Also provides the list of SpecsServers running (and the list of SPECS Masters) to the Specs Client UI.

19 Clara Gaspar, February 2007 19 FwHw PVSS Library ❚ Types of functions: ❙ Constants Constants ❙ Hardware Functions Hardware Functions ❙ Recipe Functions Recipe Functions ❙ Conversion Functions Conversion Functions ❙ Utilities Utilities ❙ DEMO 1: How to create hardware DEMO 1: How to create hardware ❙ DEMO 2: How to remove hardware DEMO 2: How to remove hardware ❙ DEMO 3: How to display a register on a panel DEMO 3: How to display a register on a panel ❚ A Tutorial is also available ❙ http://lhcb-online.web.cern.ch/lhcb-online/ecs/PVSS_TELL1/ppt/tutorial(2)_FWHW.ppt http://lhcb-online.web.cern.ch/lhcb-online/ecs/PVSS_TELL1/ppt/tutorial(2)_FWHW.ppt

20 Clara Gaspar, February 2007 20 Using the FwHw Tools ❚ Suggestion: ❙ Graphically: ❘ Create the HW types ❘ Create one board ❘ Give it default settings -> “Save as Default” ❘ Subscribe it ❘ Check if everything works (read, write, etc.) ❙ Write your own script ❘ For creating many boards, modifying settings where needed and “subscribing” them.

21 Clara Gaspar, February 2007 21 Using the FwHw Tools ❚ Some Guidelines ❙ If a “chip” has several registers ❘ If they can be written in one single operation 〡 Declare them as 1 register of size N 〡 This will optimize configuration time ❘ Some (a few) can also be declared separately 〡 If they are often accessed individually ❙ In any scripts or Panels ❘ Use as much as possible: 〡 fwSpecs_writeRead(), instead of write+read 〡 Use as many registers as possible in one go

22 Clara Gaspar, February 2007 22 Using the FwHw Tools ❚ Some Guidelines ❙ In any scripts or Panels ❘ In general: Try to do the minimum amount of operations from PVSS. 〡 If you need new “macros” like “Write MUX & read DCU” please let us know. ❙ For integration with FSM: ❘ Please create a local variable for example: 〡 Int “status”: to summarize your HW state

23 Clara Gaspar, February 2007 23 Using the FwHw tool ❚ More guidelines ❙ Granularity->what is a “HW” (Hw Type) ❘ A “HW” is what gives a Device Unit (in the FSM) ❙ Example: ❘ In the VELO: A Control Board controls many hybrids (FE), a hybrid contains several beetles ❘ A “HW” could be: 〡 A beetle 〡 A Hybrid 〡 A Control Board ❘ Probably a Hybrid is best (see FSM) ❙ Rule: Max ~500 HWs (Device Units) per PVSS System

24 Clara Gaspar, February 2007 24 Accessing the HW ❚ Some notes of using the functions for reading/writing data: ❙ Read write functions: ❘ fwSpecs_read, fwSpecs_write, fwSpecs_writeRead 〡 Accept a list of registers and a list of data items ❙ Data is transferred as a byte array (dyn_char) ❙ Please use the fwHw Conversion functions: ❘ To convert values to and from a panel (ascii) 〡 fwHw_convertByteToHex and fwHw_convertHexToByte ❘ To convert values to 16 or 32 bit integers: 〡 fwHw_convertBytesToWords and fwHw_convertWordsToBytes

25 Clara Gaspar, February 2007 25 Interface to the Config. DB ❚ The Configuration Database tools allows ❙ To save and retrieve sets of data (needed to configure a device) for a particular running mode -> Recipes ❙ Using an Oracle DB or ❙ Using a Cache (in PVSS datapoints) ❙ We will use “Cache” for the moment ❘ Recipes will be copied to DB when Oracle setup at the PIT

26 Clara Gaspar, February 2007 26 FwHw and the Config. DB ❚ Using the Hw Tool to create a Recipe Type: ❙ “Hw Type” tab / “Recipe Types” button ❘ Choose which registers need to receive configuration data -> This will create a Recipe type 〡 Use the default name and append a meaningful keyword if more than one recipe types per device ❘ Guideline: Keep in the same recipe type all registers that can be set at the same time. This will minimize number of PVSS operations

27 Clara Gaspar, February 2007 27 FwHw and the Config. DB ❚ Using the Hw Tool to create a Recipe: ❙ “Hw” tab / “View/Recipes” button / “Recipes” ❘ You can modify the values of the registers (don’t forget to type return) ❘ Save recipes of a certain Recipe Type ❘ Retrieve and/or Apply them ❙ Guideline -> Recipe Names: ❘ / ex.: 〡 PHYSICS/Configure, PHYSICS/Start 〡 CALIBRATION/Configure, etc. ❘ Necessary because a Configurator Object will preload recipes from DB to cache

28 Clara Gaspar, February 2007 28 Integrating boards ❚ More Guidelines: ❙ Create your own HW Type PVSS library (Croc.ctl) containing the functions: ❘ Croc_configure(string hw, string recipe) 〡 Using fwHw “Recipe” functions. ❘ Croc_start(string hw, …), etc. ❙ Create your own Hw Type PVSS panel (Croc.pnl) ❘ Allowing to visualize and operate boards of that type ($2 specifies which board –> dp name) ❘ Using the functions in Croc.ctl

29 Clara Gaspar, February 2007 29 FSM Guidelines ❚ Defined standard “domains” per sub-detector: ❙ DCS ❘ DCS Infrastructure (Cooling, Gas, Temperatures, pressures, etc) that is normally stable throughout a running period ❙ HV ❘ High Voltages or in general components that depend on the status of the LHC machine (fill related) ❙ DAQ ❘ All Electronics and components necessary to take data (run related) ❙ DAI ❘ Infrastructure necessary for the DAQ to work (computers, networks, electrical power, etc.) in general also stable throughout a running period. ❚ And standard states & transitions per domain. ❙ Doc available in EDMS: ❘ https://edms.cern.ch/document/655828/3 https://edms.cern.ch/document/655828/3 ❚ FW Component available: lbFsmDomains

30 Clara Gaspar, February 2007 30 Sub-Detector FSM Hierarchy ❚ ECAL Example ECAL DCS ECAL HV ECAL DAI ECAL DAQ ECAL LV ECAL TEMP ECAL FEE ECAL TELL1 ECAL CRATES ECAL COOLING ECAL ECAL Dev1 ECAL DevN Control Units Device Units

31 Clara Gaspar, February 2007 31 Control Units ❚ Each node is able to: ❙ Summarize information (for the above levels) ❙ “Expand” actions (to the lower levels) ❙ Implement specific behaviour & Take local decisions ❘ Sequence & Automate operations ❘ Recover errors ❙ Include/Exclude children (i.e. partitioning) ❘ Excluded nodes can run is stand-alone ❙ User Interfacing ❘ Present information and receive commands DCS Tem p Tracke r Muon HVHV GA S HVHV

32 Clara Gaspar, February 2007 32 Device Units ❚ Device Units ❙ Provide the interface to real devices: ( Electronics Boards, HV channels, trigger algorithms, etc.) ❘ Can be enabled/disabled ❘ In order to integrate a device within FSM 〡 Deduce a STATE from device readings (in DPs) 〡 Implement COMMANDS as device settings ❘ Commands can apply the recipes previously defined Dev N

33 Clara Gaspar, February 2007 33 FSM Guidelines ❚ DAQ and Trigger domain: ❚ Each electronics board (HW) should implement this FSM

34 Clara Gaspar, February 2007 34 Integrating in the FSM ❚ Creating your own DU ❙ Open the fwDeviceEditorNavigator ❘ Your devices will not be available, but they can be added and used in the FSM tree ❙ FSM tab / Editor mode ❘ “Create/Configure FSM Object Types” ❘ “Add Device Type” 〡 Choose your HW Type (as Device Base Type) ❘ Open it and “Copy from Type” DAQ_Domain_v1 〡 To import guideline states and actions ❘ Configure Device: Initialization, States & Actions

35 Clara Gaspar, February 2007 35 Configure DU FSM ❚ Configuring your DU type ❙ Initialization ❘ #uses “Croc.ctl” ❙ States ❘ Deduce the state from “.status” local variable ❙ Actions: ❘ Use Croc_configure(), Croc_start(), etc. ❘ Set “.status” local variable: 〡 To the new state if operation OK 〡 To error value when an error is detected

36 Clara Gaspar, February 2007 36 Creating an FSM tree ❚ Still in FSM tab/Editor Mode ❙ Select Tree top (sys name), right click: ❙ Add “New Object” ❘ Of type: DAQ_Domain_v1 ❘ Name: XXX_FEE (ex. ECAL_FEE) ❙ Select XXX_FEE, right click: ❙ Add “Device(s) from Hardware View ❘ Of your DU type (ex.HwTypeSPECSCrocDefault) ❘ Choose your DUs (boards)

37 Clara Gaspar, February 2007 37 Running the FSM tree ❚ Move to FSM tab/Navigator Mode ❙ Make sure the DIM_DNS is correctly set ❙ Start/Restart ALL ❙ Select XXX_FEE, right click: ❘ Select “View” to open a panel to operate your Sub- system

38 Clara Gaspar, February 2007 38 Changing the FSM tree ❚ In order to make any changes: ❙ Make your changes, for example in your DU type scripts (initialization, states or actions) ❙ In Navigator Mode: “Stop ALL” ❙ In Editor Mode: ❘ Select Tree top (sys name), right click: ❘ “Generate ALL” ❙ In Navigator Mode: “Start/Restart ALL”


Download ppt "Clara Gaspar, February 2007 LHCb’s Experiment Control System & Electronics Integration Step by Step."

Similar presentations


Ads by Google