quickcf - A Utility for Writing XSIM Configuration Files


1. Synopsis

quickcf [ input-filename [output-filename ] ]

2. Description

quickcf constructs an XSIM configuration file from a text file containing declaration statements for the model, independent variable, parameters, and, optionally, parameter groups and feeds.

quickcf reads from input-filename and writes to output-filename if these files are specified in the command line; otherwise standard input and/or standard output are used.

quickcf is designed to provide XSIM programmers with an easy-to-use tool to quickly create simple configuration files; thus, it does not provide access to the full spectrum of configuration file features. The declarations in a quickcf input file are limited to model, independent variable, feed, group, and parameter declarations. For each declaration only a limited set of modifiers is supported.

3. Input File Format

quickcf input is line-oriented with one declaration per input line. Declarations consist of string, integer, and real number fields that may be separated by white space (blanks or tabs) or commas.

Text strings that contain special characters must be enclosed in single or double quotes. The special characters are: space [ ], comma [,], single quote [`], and double quote [``].

If an optional field, other than the last field on a line, is skipped, commas must be used to indicate the missing field.

4. Declarations

4.1. Model declaration

Syntax: model model-name

Semantics: The modeling program model-name is loaded when the configuration file is read.

4.2. Independent variable declaration

Syntax: iv iv-name [iv-loc] [iv-start iv-stop iv-incr]

Semantics: The independent variable is assigned the name iv-name and assigned the location iv-loc in the parameter array. Its initial value is iv-start, its final value is iv-stop, and its increment is iv-incr.

4.3. Feed declaration

Syntax: feed feed-name feed-loc

Semantics: A feed named feed-name is assigned feed-loc in the parameter array.

4.4. Parameter declaration

Syntax: par par-name [par-loc] [par-initial-value] [par-I/O-type] [par-I/O-status]

Semantics: A parameter named par-name is assigned par-loc in the parameter array and given the initial value par-initial-value. par-I/O-type must be either ``input'' or ``output''. Default type is ``input''. par-I/O-status must be either ``static'' or ``dynamic''. If I/O-type is ``input'', default status is ``static''. If I/O-type is ``output'', default status is ``dynamic''.

4.5. Group declaration

Syntax: group group-name

Semantics: A group named group-name is declared. The group includes all parameters declared on subsequent declaration lines until the next group declaration is encountered or the end-of- file is read.

5. Diagnostics

If quickcf fails when reading a declaration, it prints out the line number of the input file on which it failed, and no output file is written.

It the input file does not contain one and only one model declaration, one and only one independent variable declaration, and at least one parameter declaration, a diagnostic message is written, and no output file is written.

6. Limitations

A parameter can only belong to one group.

Except as described in Diagnostics, quickcf does not attempt to diagnose configuration file errors.

7. Example

If the file demo.txt contains:


model demo
iv time 130 0.0 30.0 0.1
feed Cin_1 101
feed Cin_2 102
par Dp 004 0.0
par Disf 024 0.0
par Clngth 039 0.1
group Inputs
par Fp 001 1.0
par Vp 002 0.03
par Gp 003 0.0
par PSg 020 1.0
par ``V'isf'' 022 0.15
par Gisf 023 0.0
par Nseg 037 9.0
par Czero 038 0.0
group ``Dummy group''
group Outputs
par Cout 201, , output
par Q 202, , output static

the command:


quickcf < demo.txt

produces the result:


model {prog = demo,
       fonts = (``-*-new century schoolbook-bold-r-*--17-*'')
}

ivar time {loc=0130}
parinfo time_start {init=0.000000}
parinfo time_stop {init=30.000000}
parinfo time_incr {init=0.100000}

feed Cin_1 {loc=0101}
feed Cin_2 {loc=0102}

real Dp {loc=0004, init=0.000000}
real Disf {loc=0024, init=0.000000}
real Clngth {loc=0039, init=0.100000}
real Fp {loc=0001, init=1.000000}
real Vp {loc=0002, init=0.030000}
real Gp {loc=0003, init=0.000000}
real PSg {loc=0020, init=1.000000}
real ``V'isf'' {loc=0022, init=0.150000}
real Gisf {loc=0023, init=0.000000}
real Nseg {loc=0037, init=9.000000}
real Czero {loc=0038, init=0.000000}
real Cout {loc=0201, output}
real Q {loc=0202, output, static}

group Inputs {width=0805, height=0462,
              text ``CURRENT'' (0000,0000, 0265,0057, font=1),
              groupbtn Outputs (0000,0057, 0265,0057, popdown),
              box (0275,0000, 0530,0462,
                   Fp, Vp, Gp, PSg, ``V'isf'', Gisf, Nseg, Czero
              )
}
group Outputs {width=0805, height=0120,
               groupbtn Inputs (0000,0000, 0265,0057, popdown),
               text ``CURRENT'' (0000,0057, 0265,0057, font=1),
               box (0275,0000, 0530,0120,
                    Cout, Q
               ) 
}

Note that, in the input file, the names V'isf and Dummy group are enclosed in quotes since they include special characters, and the declarations for Cout and Q use commas to skip the initial value since it is an error to give an output parameter an initial value.

In the output, note that the group Dummy group does not appear since it contains no parameters. Also, the parameters Dp and Disf are assigned a value of 0.0 which cannot be altered while running the model. Since their declarations occur before the first group declarations, they do not appear in any group, and the user has no access to them during a simulation session.

The two group windows produced by this configuration file are shown below.



Copyright 1995-1998, University of Washington
Last modified: 01:22pm PDT October 17, 1998