Mce.cfg

From MCEWiki
Related topics:

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 by modifying the mce.cin input file during MAS compile. The mapping output of mce_status provides a parsed representation of the hardware configuration file, which can be used by scripts to determine what capabilities are available in a given setup.

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

Multicard MAS

When running MAS with multiple fibre cards, the hardware configuration files will be called mce0.cfg, mce1.cfg, &c. In this case, a symlink will be created in /etc/mce: mce.cfg -> mce0.cfg for legacy support.

The rest of this page concerns itself with the single fibre card setup only. See the Multicard MAS page for full details on running MAS with multiple fibre cards.

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_mux11d

Set to 1 to enable mux11d support.

$hw_subrack

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

$card_list

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 (PSC), remove it from this list.

$hw_rev (map from card types to revision strings)

Currently the only important entries are:

$tes_para, $tes_count and $tes_mapping

Describes the paradigm of TES mappings. The MCE can map "tes" onto any combination of DACs, though some configurations are more common than others.

Setting $tes_para is often enough; allowed values are:

  • "classic" - one dedicated DAC on from each bias card (ACT)
  • "full32" - 32 lines across three rev. F bias cards with 12 dedicated DACs. The 32-value virtual register is mapped to backplane signals in the following order: LN_BIAS_0, LN_BIAS_1, ..., LN_BIAS_29, PXL_HTR, DET_BIAS_ORG.
  • "small16" - 16 lines from bc3 flux_fb[:16] (common for small subracks)
  • "small_2bc" - 16 lines from bc2 flux_fb[16:32] (for small subracks with only two bias cards, ie. the Spider configuration)
  • "none" - null mapping
  • "bc1_f_24_31" - 8 lines from bc1 flux_fb[24:32]
  • "bc3_f_24_31" - 8 lines from bc3 flux_fb[24:32]
  • "bc2_fu_00_15" - 16 lines from bc2 flux_fb_upper (which is the same as flux_fb[16:32])
  • "revF_32" - an alias for "full32"
  • "map" - an arbitrary map. Set $tes_count and $tes_mapping -- see $heater_count and $heater_mapping, below, for the syntax.

The values of $tes_count and $tes_mapping are not examined unless $tes_para = "map".

Bias line mapping for low-noise bias cards (rev E and later): For bias cards with 12 low-noise TES bias DACs, the mapping between the 12 entries in the "bc# bias" register and the backplane signal names is described in the following table:

BC \ Index 0 1 2 3 4 5 6 7 8 9 10 11
BC1 LN_BIAS_0 LN_BIAS_1 LN_BIAS_2 LN_BIAS_3 LN_BIAS_4 LN_BIAS_5 LN_BIAS_6 LN_BIAS_7 LN_BIAS_8 LN_BIAS_9 PXL_HTR n/c
BC2 LN_BIAS_10 LN_BIAS_11 LN_BIAS_12 LN_BIAS_13 LN_BIAS_14 LN_BIAS_15 LN_BIAS_16 LN_BIAS_17 LN_BIAS_18 LN_BIAS_19 n/c DET_BIAS_ORG
BC3 LN_BIAS_20 LN_BIAS_21 LN_BIAS_22 LN_BIAS_23 LN_BIAS_24 LN_BIAS_25 LN_BIAS_26 LN_BIAS_27 LN_BIAS_28 LN_BIAS_29 n/c n/c

$heater_count and $heater_mapping (define a mapping for "heater bias")

For systems that use MCE DACs to heat TESes, it is possible to map those DACs to the "heater bias" virtual address. The syntax is general enough to be a bit confusing. But basically you should set $heater_count to be the number of words in "heater bias", and then map certain cards and DAC sets into the heater bias space. Here's an example:

$heater_count = 8;
$heater_mapping = array(
	/* args are mapping_start, mapping_count, card, param, param_offset */
	array(0, 4, "bc1", "flux_fb", 16),
	array(4, 4, "bc2", "flux_fb", 16) );

This will map the first 4 words of "heater bias" to DACs 16:19 of bc1 flux_fb, and the next 4 to DACs 16:19 of bc2 flux_fb.

To enable the mapping, you must also add "heater" to the $virt_list array.

$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)

The only potential changes needed here are:

  • you might want to add "heater", to access the "heater bias" address.
  • you should add "row" if using mux11d.

Compile the template

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

   sudo apt-get install php5-cli

The MAS configure script should detect when it's missing and let you know. 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.cfg    # should produce my_mce.cfg from my_mce.cin

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

If an existing file is found in /etc/mce/mce.cfg, MAS will act cautiously and not overwrite it: delete the old file first before running "make install" to install the new version.