Difference between revisions of "Mce.cfg"

From MCEWiki
(Modify the template)
($virt_list (list of virtual card names))
Line 84: Line 84:
 
=== $virt_list (list of virtual card names) ===
 
=== $virt_list (list of virtual card names) ===
  
This probably won't need to be changed.
+
This probably won't need to be changed.  An exception is that you might want to add "heater", to access the "heater bias" address.
  
 
== Compile the template ==
 
== Compile the template ==

Revision as of 13:40, 19 August 2011

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

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

Currently the only important entry is for bias cards; set the the value for "bc" to "revE" or greater to enable the 12 new bias lines (Bias Card RevD to RevF changes). For older cards, leave the revision as "revD".

$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
  • "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])

Currently the mappings of the form "bc?_*_##_##" are implemented as needed. This could be made more dynamic at some point. But it's pretty easy to just add a new one to the list in components/tes.

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

This probably won't need to be changed. An exception is that you might want to add "heater", to access the "heater bias" address.

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.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