Mce.cfg

From MCEWiki
Revision as of 11:30, 30 July 2010 by 142.103.235.58 (talk) (Compile the template)

Overview

The "hardware configuration file", or "mce.cfg file" expresses a mapping between MCE target strings (e.g. "cc led") and MCE internal parameter addresses (e.g. 0x02/0x99). It provides both a low-level description of physical cards ("cc", "rc1", ...) and parameters as well as a facility for mapping abstracted "virtual cards" (such as "sq2", "tes", "rca") into the physical address space.

The file is interpreted by [libconfig ], which defines the syntax rules. The detailed structure of mce.cfg is not of general interest and won't be described here. Users will generally only need to enable or disable certain cards or functions.

At present, it is left to the user to ensure that the mce.cfg contains an accurate description of the hardware attached to the computer. This means that mce.cfg must be regenerated any time any of the following things change:

  • the cards that are connected to the MCE (e.g. number of readout cards, presence/absence of a power supply card)
  • the presence/absence of a biasing address card (BAC) in the BC2 slot
  • significant changes in firmware revision that enable/disable certain MCE functions

Setup

As of mas/trunk:455, the hardware configuration file should be generated using the tools and data in the "config2" directory. The basic steps to creating an mce.cfg file are:

  1. Copy a template from the templates folder
  2. Modify the template to accurately describe your hardware and firmware
  3. Compile the modified template into a config file.
  4. Install the config file to /etc/mce/mce.cfg

Choose a template

Currently, separate templates are provided for "v1" sub-racks (5-MDM; also called large, SCUBA-2, etc.) and "v2" sub-racks (3-MDM; small, Caltech). Depending on the size of your MCE, just run (from mas/config2):

  cp template/mce_v1.cin ./mce.cin    # I have a 5-MDM MCE

or

  cp template/mce_v2.cin ./mce.cin    # I have a 3-MDM MCE


Modify the template

The template is a PHP script that defines several variables that describe the MCE configuration. We describe them here. Note the following subtle terminology:

  • "card name", the unique name of each card in the system. e.g. "rc2", "psc", "bac".
  • "card type", a class of card, e.g. "rc", "bc", "bac".

$hw_subrack ("small" or "large")

Set to "small" for 3-MDM, "large for 5-MDM MCE. This mostly affects the mapping of bias card DACs into "sa", and "sq2" virtual spaces.

$card_list (list of card names)

In this array indicate all cards present in the system. If you use a biasing address card, be sure to list it here. If you do not have a power supply card, remove it from this list.

$hw_rev (map from card types to revision strings)

This probably doesn't matter yet.

$tes_para (string)

Describes the paradigm of TES mappings. Although the MCE can map "tes" onto any combination of DACs, only a couple of configurations are in common use. The currently supported options are:

  • "classic" - one dedicated DAC on from each bias card (ACT)
  • "small16" - 16 lines from bc3 flux_fb[:16] (common for small subracks)
  • "none" - null mapping

$fw_rev (map from card types to integers)

Since certain MCE features depend on firmware revision, they will be included or excluded based on the revisions described in this table. In many cases the firmware will be upgraded without any changes to the interface and this does not require a change to mce.cfg (i.e. there may be a large number of firmware revision numbers that produce the same mce.cfg file).

$virt_list (list of virtual card names)

This probably won't need to be changed.


Compile the template

You will need PHP. If you don't know that you have it, run:

   sudo apt-get install php5-cli

Then to compile, run

   make

This will, by default, compile "mce.cin" into "mce.cfg". If you have multiple configuration templates with weird names, you can compile them like

   make my_mce.cin    # should produce my_mce.cfg

If you encounter compilation errors:

  • "PHP parse error" in mce.cin is probably _your_ syntax error; check that your declarations follow PHP syntax.
  • for complaints about undefined variables make sure you have not misspelled anything in mce.cin
  • other than that there are probably plenty of errors and bugs in the other source files; please let us know if things aren't working

To check that the mce.cfg is syntactically sound, run

   mce_status -g -c mce.cfg

This will not issue MCE commands, but will dump the target string mapping to the screen. If the mce.cfg is invalid, a complaint will issue.

Install the template

To install the local mce.cfg to /etc/mce/mce.cfg, just run:

   sudo make install