[http://hackage.haskell.org/package/amitool AMITool] is a Haskell package, which provides the essential tools necessary, in order to create IBIS-AMI models using Haskell.

+

''AMITool'' is a Haskell package, which provides the essential tools necessary, in order to create IBIS-AMI models using Haskell.

''Authors: [mailto:capn.freako@gmail.com David Banas]''

''Authors: [mailto:capn.freako@gmail.com David Banas]''

Line 111:

Line 111:

== FAQ ==

== FAQ ==

−

;Why Haskell?

+

=== Why Haskell? ===

−

:Because the Haskell code to parse an AMI parameter string looks like this:

+

Because the Haskell code to parse an AMI parameter string looks like this:

amiToken = do skipJunk

amiToken = do skipJunk

Line 132:

Line 132:

* It has a very good compiler, so we don't have the same deployability and/or performance issues we have with interpreted languages, such as Python.

* It has a very good compiler, so we don't have the same deployability and/or performance issues we have with interpreted languages, such as Python.

−

;Will we get the performance we need out of ''AMI_Getwave'' if it's written in Haskell?

+

=== Will we get the performance we need out of ''AMI_Getwave'' if it's written in Haskell? ===

−

:Unclear. We'll have to write it and test it, in order to find out.

+

Not yet. The most recent source code submission to GitHub ''does'' include the AMI_Getwave function, but its performance is 10x worse than the equivalent C code. I'm investigating...

+

+

=== Okay, I'm interested; how do I quickly learn Haskell? ===

+

Grab a copy of [http://www.amazon.com/Programming-Haskell-Graham-Hutton/dp/0521692695/ref=cm_lmf_tit_3/188-8557920-6692504 this book], and work through the chapters, doing the problems at the end of each. I will make my own answers to these problems available to anyone, whom asks.

+

+

=== I've made it through the book, above, but it's rather academic; how do I do real practical things with Haskell? ===

+

Grab a copy of [http://www.amazon.com/Real-World-Haskell-Bryan-OSullivan/dp/0596514980/ref=cm_lmf_tit_1/188-8557920-6692504 this book], and keep it by your side always. (I sleep with mine. ;-) )

+

+

== Model Comparison & Correlation ==

+

+

=== Impulse and Frequency Response Comparisons ===

+

The following plots show a comparison of the impulse and frequency responses of the C and Haskell models of a Rx CTLE equalizer, for both the ''AMI_Init'' and ''AMI_GetWave'' functions. The HSpice AC sweep of the actual circuit has been added to the frequency response plot, for reference. In order to generate the C and Haskell impulse responses, below, I invoked each model, in turn, using the ''IBIS_AMI_test'' tool provided by [http://www.sisoft.com/ SiSoft, Inc.], using the scaled unit pulse sequence, [0, 0.1, 0, ..., 0], as input. In order to generate the frequency responses, I took FFTs of the impulse responses. The configuration files given to the `-i' and '-g' options were identical, except for root name. And both models used the same set of `fract/pole' data to formualte their impulse responses. The sample interval is 25 ps (i.e. - 40 GHz sample rate), and the vectors are 128 elements long.

+

+

[[Image:Model_Comparison.png]]

+

+

Note the excellent agreement in spectral magnitude between the Haskell model and the HSpice AC sweep. (The deviation at the extreme right is due to aliasing.)

+

+

The spurs in the C model frequency response at 5, 10, and 15 GHz are due to a well understood bug in the C code, which is easy to fix.

[[Category:Libraries]]

[[Category:Libraries]]

[[Category:Packages]]

[[Category:Packages]]

Revision as of 16:41, 13 March 2013

AMITool is a Haskell package, which provides the essential tools necessary, in order to create IBIS-AMI models using Haskell.

1 Usage

NOTE) This package is, currently, in a VERY premature and incomplete state. I only set up this Wiki page so that those interested in participating in this project's development would have a central focal point for documentation, communication, etc. This package is really NOT ready for prime time, yet.

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

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:

It has a very good compiler, so we don't have the same deployability and/or performance issues we have with interpreted languages, such as Python.

7.2 Will we get the performance we need out of AMI_Getwave if it's written in Haskell?

Not yet. The most recent source code submission to GitHub does include the AMI_Getwave function, but its performance is 10x worse than the equivalent C code. I'm investigating...

7.3 Okay, I'm interested; how do I quickly learn Haskell?

Grab a copy of this book, and work through the chapters, doing the problems at the end of each. I will make my own answers to these problems available to anyone, whom asks.

7.4 I've made it through the book, above, but it's rather academic; how do I do real practical things with Haskell?

Grab a copy of this book, and keep it by your side always. (I sleep with mine. ;-) )

8 Model Comparison & Correlation

8.1 Impulse and Frequency Response Comparisons

The following plots show a comparison of the impulse and frequency responses of the C and Haskell models of a Rx CTLE equalizer, for both the AMI_Init and AMI_GetWave functions. The HSpice AC sweep of the actual circuit has been added to the frequency response plot, for reference. In order to generate the C and Haskell impulse responses, below, I invoked each model, in turn, using the IBIS_AMI_test tool provided by SiSoft, Inc., using the scaled unit pulse sequence, [0, 0.1, 0, ..., 0], as input. In order to generate the frequency responses, I took FFTs of the impulse responses. The configuration files given to the `-i' and '-g' options were identical, except for root name. And both models used the same set of `fract/pole' data to formualte their impulse responses. The sample interval is 25 ps (i.e. - 40 GHz sample rate), and the vectors are 128 elements long.

Note the excellent agreement in spectral magnitude between the Haskell model and the HSpice AC sweep. (The deviation at the extreme right is due to aliasing.)

The spurs in the C model frequency response at 5, 10, and 15 GHz are due to a well understood bug in the C code, which is easy to fix.