Difference between revisions of "Mce cmd"

From MCEWiki
(Output formatting)
Line 70: Line 70:
 
= Output formatting =
 
= Output formatting =
  
The output consists of two or three parts, separated by colons.  The
+
The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:
first part is of the form "Line <n>" with <n> an integer that
+
Line <line number>: <success> [: auxiliary data]
represents a running counter of lines entered into mce_cmd.  This is
+
 
useful for debugging MCE scripts.  The second part of the output will
+
The <success> indicator will be "ok" if the command succeeded, or "error" otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the auxiliary data.
either be the word "ok" or the word "error", indicating the success or
+
 
failure of the command.  The third part is displayed only if a read
+
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is
command succeeded, or if any command causes error.
+
<success> [: auxiliary data]
 +
 
 +
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no auxiliary data are suppressedIn quiet mode, "Line 12: ok" will not be displayed.

Revision as of 00:11, 6 March 2008

Read and write commands

MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call "block locations". The data block consists of one or more 32-bit words.

The most basic data manipulation commands are RB ("read block") and WB ("write block"). These commands read and write to the entire range of data at the block location, starting at the beginning of the block.

The commands RRA ("read range") and WRA ("write range") can be used to read or write particular subranges of the data in a block location.

All read and write commands take a card (or virtual card) name and a parameter name as the first two arguments. Physical cards are associated with particular hardware elements in the system, for example "cc" (clock card) and "rc2" (readout card). Virtual cards are used to group a set of hardware functions into a single name-space. The data associated with a virtual card parameter may be shared across multiple hardware cards. Parameters accessible via virtual mappings are also accessible via some set of hardware card addresses.

Syntax summary

rb  <card> <param>
rra <card> <param> <starting index> <count>
wb  <card> <param> [data, ...]
wra <card> <param> <starting index> [data, ...]

RB command

RB will return all data associated with the block location.

rb rc1 adc_offset0
Line   1 : ok : 10 11 9 8 12 13 14 15

RRA command

The RRA command returns only the subset of the data that were asked for.

rra rc1 adc_offset0 2 4
Line   1 : ok : 9 8 12 13

WB command

The WB command will update words in the block location. If the number of data words given as arguments to the WB command is smaller than the natural size of the block location, only those first few data locations will be updated. e.g.,

wb rc1 adc_offset0 0 1 2
Line   1 : ok
rb rc1 adc_offset0
Line   2 : ok :  0 1 2 8 12 13 14 15

WRA command

The WRA command updates words starting at the specified index.

wra rc1 adc_offset0 4 100 200
Line   1 : ok
rb rc1 adc_offset0
Line   2 : ok :  0 1 2 8 100 200 14 15

Please note that WRA and RRA are not more efficient than WB and RB. MAS translates WRA and RRA into the equivalent set of WB and RB commands, and not the other way around.


Output formatting

The output consists of two or three parts, separated by colons. If in line prefix mode (which is the default) the output is:

Line <line number>: <success> [: auxiliary data]

The <success> indicator will be "ok" if the command succeeded, or "error" otherwise. Successful commands may return data (for example, an RB command). Failed commands will always return an error message as the auxiliary data.

If mce_cmd is invoked with prefixes turned off ('-p'), the output format is

<success> [: auxiliary data]

If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no auxiliary data are suppressed. In quiet mode, "Line 12: ok" will not be displayed.