The source code of this package has been arranged such that, presumably, all you have to do, in order to model your own device, is edit the following section of the ''ExmplUsrModel.hs'' file, and re-run ''make'':

+

+

-- Change the line, below, as follows:

+

-- - Change "testAMI" to the root name of your AMI parameter tree.

+

-- - Change "Mode" to the name you've given to the filter mode selection parameter.

1 Usage

1.1 Installation

(This is necessary, because the shared object library produced by this package needs to dynamically link to certain standard Haskell libraries, at run time. I'm working on a statically linked version of this package, which won't require this step. Please, stay tuned.)

Download the [source tarball] and extract it:

$ tar xzf amitool-v0.1.tgz

Move into the newly created directory, and build the project:

$ cd amitool-v0.1
$ make

If the make succeeds, you'll find the following output files in the directory:

libami.so - This is the shared object library plug-in, which contains your AMI model. It will be dynamically loaded, at run time, by your EDA tool when simulating.

ami_test - This is an example C program, which will attempt to load libami.so and call its AMI_Init and AMI_Close functions, as a check on correct compilation. That is, for this simple test, it functions as a stand-in for the EDA tool.

You can quickly verify correct compilation and/or system infrastructural integrity by executing the following command:

$ ./ami_test test.ami

1.2 Customization

The source code of this package has been arranged such that, presumably, all you have to do, in order to model your own device, is edit the following section of the ExmplUsrModel.hs file, and re-run make:

2.2 Public interface

2.2.1 New data types

The AMIParse module defines a new type alias, AmiToken, and a new abstract data type, AmiExp, as follows:

type AmiToken = (String, AmiExp)

data AmiExp = Vals [String]
| Tokens [AmiToken]

Note that, taken together, the two new data items, above, form a recursive structure. This helps shorten the code that parses an AMI parameter string, which itself is recursive in nature.

2.2.2 Supporting functions

Several supporting functions are provided for working with the new data types described, above. A few of the more interesting examples are given, below. For a complete list, refer to the documentation.

checkProbMeas

Checks a value of type 'ProbSpace' for correctness, and returns a value of type 'TestResult'.

checkSigma

Checks whether event space is actually a Sigma field over the sample space.

smplSetUnion

Collapses a list of samples down to the maximally reduced set, which still composes a proper union of the input.

smplSetInt

Reduces a list of samples to a single sample representing their intersection.