https://wiki.haskell.org/api.php?action=feedcontributions&user=Dbanas&feedformat=atomHaskellWiki - User contributions [en]2020-11-29T06:18:39ZUser contributionsMediaWiki 1.27.4https://wiki.haskell.org/index.php?title=Treeviz&diff=57976Treeviz2014-04-28T13:32:53Z<p>Dbanas: /* ToDo */ Removed the "split code..." ToDo item.</p>
<hr />
<div>A set of types, classes, and functions for visualizing computation decomposition trees.<br />
<br />
== Introduction ==<br />
<br />
This library can assist you in visualizing how computation is broken down, or decomposed, by certain ''Divide-And-Conquer'' type algorithms. Such algorithms are often capable of significantly reducing the order of complexity of an operation, by taking advantage of recursions, which occur when the original input is broken into halves, thirds, etc. Such repeated recursive breakdown often produces tree structures from an initially linear data input. And being able to visualize how the elements of these trees are recombined, when the operation is evaluated, can help us make smarter choices about how to apply a particular type of massively parallel computational resource to the computational problem.<br />
<br />
One specific example is provided, a fast Fourier transform (FFT). Here is typical output from that example:<br />
<br />
(If you compile and run ''Main.hs'', note that the two output files, ''tree.gv'' and ''legend.gv'' need to be post-processed, as follows, in order to generate the graphics shown, below.)<br />
<br />
dot <filename_root>.gv -Tpng ><filename_root>.png<br />
<br />
[[File:logtree.png]]<br />
[[File:legend.png]]<br />
<br />
== ToDo ==<br />
<br />
# Convert source to big boy Haskell, using Foldable, Traversable, etc.<br />
# Add the ability to track and classify operations performed, including keeping track of "trivial" twiddles and phasors.<br />
# Add more LogTree instances.<br />
# Improve user documentation. ;-)<br />
<br />
[[Category:Applications]]<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Treeviz&diff=57852Treeviz2014-04-10T14:13:18Z<p>Dbanas: /* ToDo */ Brought "ToDo" list up-to-date.</p>
<hr />
<div>A set of types, classes, and functions for visualizing computation decomposition trees.<br />
<br />
== Introduction ==<br />
<br />
This library can assist you in visualizing how computation is broken down, or decomposed, by certain ''Divide-And-Conquer'' type algorithms. Such algorithms are often capable of significantly reducing the order of complexity of an operation, by taking advantage of recursions, which occur when the original input is broken into halves, thirds, etc. Such repeated recursive breakdown often produces tree structures from an initially linear data input. And being able to visualize how the elements of these trees are recombined, when the operation is evaluated, can help us make smarter choices about how to apply a particular type of massively parallel computational resource to the computational problem.<br />
<br />
One specific example is provided, a fast Fourier transform (FFT). Here is typical output from that example:<br />
<br />
(If you compile and run ''Main.hs'', note that the two output files, ''tree.gv'' and ''legend.gv'' need to be post-processed, as follows, in order to generate the graphics shown, below.)<br />
<br />
dot <filename_root>.gv -Tpng ><filename_root>.png<br />
<br />
[[File:logtree.png]]<br />
[[File:legend.png]]<br />
<br />
== ToDo ==<br />
<br />
# Split source into multiple files.<br />
# Convert source to big boy Haskell, using Foldable, Traversable, etc.<br />
# Add the ability to track and classify operations performed, including keeping track of "trivial" twiddles and phasors.<br />
# Add more LogTree instances.<br />
# Improve user documentation. ;-)<br />
<br />
[[Category:Applications]]<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Treeviz&diff=57851Treeviz2014-04-10T13:22:51Z<p>Dbanas: /* ToDo */</p>
<hr />
<div>A set of types, classes, and functions for visualizing computation decomposition trees.<br />
<br />
== Introduction ==<br />
<br />
This library can assist you in visualizing how computation is broken down, or decomposed, by certain ''Divide-And-Conquer'' type algorithms. Such algorithms are often capable of significantly reducing the order of complexity of an operation, by taking advantage of recursions, which occur when the original input is broken into halves, thirds, etc. Such repeated recursive breakdown often produces tree structures from an initially linear data input. And being able to visualize how the elements of these trees are recombined, when the operation is evaluated, can help us make smarter choices about how to apply a particular type of massively parallel computational resource to the computational problem.<br />
<br />
One specific example is provided, a fast Fourier transform (FFT). Here is typical output from that example:<br />
<br />
(If you compile and run ''Main.hs'', note that the two output files, ''tree.gv'' and ''legend.gv'' need to be post-processed, as follows, in order to generate the graphics shown, below.)<br />
<br />
dot <filename_root>.gv -Tpng ><filename_root>.png<br />
<br />
[[File:logtree.png]]<br />
[[File:legend.png]]<br />
<br />
== ToDo ==<br />
<br />
# Move code from explicit recursion to Foldable/Traversable based, instead.<br />
<br />
[[Category:Applications]]<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Treeviz&diff=57740Treeviz2014-04-03T00:57:52Z<p>Dbanas: Added "ToDo" list.</p>
<hr />
<div>A set of types, classes, and functions for visualizing computation decomposition trees.<br />
<br />
== Introduction ==<br />
<br />
This library can assist you in visualizing how computation is broken down, or decomposed, by certain ''Divide-And-Conquer'' type algorithms. Such algorithms are often capable of significantly reducing the order of complexity of an operation, by taking advantage of recursions, which occur when the original input is broken into halves, thirds, etc. Such repeated recursive breakdown often produces tree structures from an initially linear data input. And being able to visualize how the elements of these trees are recombined, when the operation is evaluated, can help us make smarter choices about how to apply a particular type of massively parallel computational resource to the computational problem.<br />
<br />
One specific example is provided, a fast Fourier transform (FFT). Here is typical output from that example:<br />
<br />
(If you compile and run ''Main.hs'', note that the two output files, ''tree.gv'' and ''legend.gv'' need to be post-processed, as follows, in order to generate the graphics shown, below.)<br />
<br />
dot <filename_root>.gv -Tpng ><filename_root>.png<br />
<br />
[[File:logtree.png]]<br />
[[File:legend.png]]<br />
<br />
== ToDo ==<br />
<br />
# Figure out why some mixed decimation style FFT implementations are giving an incorrect result.<br />
# Move code from explicit recursion to Foldable/Traversable based, instead.<br />
<br />
[[Category:Applications]]<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=BayHac2014&diff=57680BayHac20142014-03-16T01:43:07Z<p>Dbanas: /* Projects */</p>
<hr />
<div>__NOTOC__<br />
<br />
[[Image:BayHac13_banner.png]]<br />
<br />
<b><span style="color:#e73">San Francisco Bay Area</span> <span style="color:#aaa">&amp;</span> <span style="color:#930">Silicon Valley</span> <span style="color:#aaa">Haskell Hackathon</span></b><br />
<br />
Come join a group of Haskell hackers to work on a wide variety of projects. All levels welcome.<br />
<br />
Special thanks to [https://developers.google.com/open-source/ Google] for sponsoring BayHac '14, who will be providing a '''lunch''' again!<br />
<br />
----<br />
{|<br />
|When:<br />
|Friday, May 16th – Sunday, May 18th, 2014<br />
|-<br />
|Where:<br />
|[http://www.hackerdojo.com/ Hacker Dojo]<br />
|-<br />
|Cost:<br />
|Free<br />
|-<br />
|News and Discussion:<br />
|[http://groups.google.com/group/bayhac BayHac Google Group]<br />
|}<br />
<br />
<big>Details and sign-up form to follow in April.</big><br />
<br />
== Location ==<br />
<br />
[http://www.hackerdojo.com/ Hacker Dojo], 599 Fairchild Drive, Mountain View, CA ([https://maps.google.com/maps?ie=UTF8&cid=11488539903009648209&q=Hacker+Dojo&iwloc=A&gl=US&hl=en-US Google Map])<br />
<br />
== Schedule ==<br />
<br />
Basic timing... details to be developed. Expect lightening talks, hacking, and other activities:<br />
<br />
{|<br />
|Friday, May 16th<br />
|3pm - 7pm<br />
|-<br />
|Saturday, May 17th<br />
|10am ~ 7pm<br />
|-<br />
|Sunday, May 18th<br />
|10am - 4pm<br />
|}<br />
<br />
== Lightning Talks ==<br />
<br />
== Attendees == <br />
<br />
# Jonathan Fischoff - organizer<br />
# [http://www.ozonehouse.com/mark/ Mark Lentczner] - asst. organizer<br />
# [mailto:capn.freako@gmail.com David Banas] - amateur Haskeller<br />
<br />
== Projects ==<br />
# [http://www.haskell.org/haskellwiki/Treeviz TreeViz] - a computation breakdown visualization project hosted by [mailto:capn.freako@gmail.com David Banas]<br />
<br />
== IRC channel ==<br />
<br />
We'll be hanging out on #bayhac on FreeNode.<br />
<br />
[[Category:Community]]</div>Dbanashttps://wiki.haskell.org/index.php?title=BayHac2014&diff=57679BayHac20142014-03-16T01:36:37Z<p>Dbanas: /* Attendees */</p>
<hr />
<div>__NOTOC__<br />
<br />
[[Image:BayHac13_banner.png]]<br />
<br />
<b><span style="color:#e73">San Francisco Bay Area</span> <span style="color:#aaa">&amp;</span> <span style="color:#930">Silicon Valley</span> <span style="color:#aaa">Haskell Hackathon</span></b><br />
<br />
Come join a group of Haskell hackers to work on a wide variety of projects. All levels welcome.<br />
<br />
Special thanks to [https://developers.google.com/open-source/ Google] for sponsoring BayHac '14, who will be providing a '''lunch''' again!<br />
<br />
----<br />
{|<br />
|When:<br />
|Friday, May 16th – Sunday, May 18th, 2014<br />
|-<br />
|Where:<br />
|[http://www.hackerdojo.com/ Hacker Dojo]<br />
|-<br />
|Cost:<br />
|Free<br />
|-<br />
|News and Discussion:<br />
|[http://groups.google.com/group/bayhac BayHac Google Group]<br />
|}<br />
<br />
<big>Details and sign-up form to follow in April.</big><br />
<br />
== Location ==<br />
<br />
[http://www.hackerdojo.com/ Hacker Dojo], 599 Fairchild Drive, Mountain View, CA ([https://maps.google.com/maps?ie=UTF8&cid=11488539903009648209&q=Hacker+Dojo&iwloc=A&gl=US&hl=en-US Google Map])<br />
<br />
== Schedule ==<br />
<br />
Basic timing... details to be developed. Expect lightening talks, hacking, and other activities:<br />
<br />
{|<br />
|Friday, May 16th<br />
|3pm - 7pm<br />
|-<br />
|Saturday, May 17th<br />
|10am ~ 7pm<br />
|-<br />
|Sunday, May 18th<br />
|10am - 4pm<br />
|}<br />
<br />
== Lightning Talks ==<br />
<br />
== Attendees == <br />
<br />
# Jonathan Fischoff - organizer<br />
# [http://www.ozonehouse.com/mark/ Mark Lentczner] - asst. organizer<br />
# [mailto:capn.freako@gmail.com David Banas] - amateur Haskeller<br />
<br />
== Projects ==<br />
<br />
== IRC channel ==<br />
<br />
We'll be hanging out on #bayhac on FreeNode.<br />
<br />
[[Category:Community]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Treeviz&diff=57369Treeviz2013-12-30T23:49:02Z<p>Dbanas: /* Introduction */ Added example output.</p>
<hr />
<div>A set of types, classes, and functions for visualizing computation decomposition trees.<br />
<br />
== Introduction ==<br />
<br />
This library can assist you in visualizing how computation is broken down, or decomposed, by certain ''Divide-And-Conquer'' type algorithms. Such algorithms are often capable of significantly reducing the order of complexity of an operation, by taking advantage of recursions, which occur when the original input is broken into halves, thirds, etc. Such repeated recursive breakdown often produces tree structures from an initially linear data input. And being able to visualize how the elements of these trees are recombined, when the operation is evaluated, can help us make smarter choices about how to apply a particular type of massively parallel computational resource to the computational problem.<br />
<br />
One specific example is provided, a fast Fourier transform (FFT). Here is typical output from that example:<br />
<br />
(If you compile and run ''Main.hs'', note that the two output files, ''tree.gv'' and ''legend.gv'' need to be post-processed, as follows, in order to generate the graphics shown, below.)<br />
<br />
dot <filename_root>.gv -Tpng ><filename_root>.png<br />
<br />
[[File:logtree.png]]<br />
[[File:legend.png]]<br />
<br />
[[Category:Applications]]<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=File:Logtree.png&diff=57368File:Logtree.png2013-12-30T23:33:00Z<p>Dbanas: An example log tree visualization graph. This one depicts a FFT.</p>
<hr />
<div>An example log tree visualization graph. This one depicts a FFT.</div>Dbanashttps://wiki.haskell.org/index.php?title=File:Legend.png&diff=57367File:Legend.png2013-12-30T23:29:14Z<p>Dbanas: Computational node type legend for graph in tree.png</p>
<hr />
<div>Computational node type legend for graph in tree.png</div>Dbanashttps://wiki.haskell.org/index.php?title=Treeviz&diff=57291Treeviz2013-12-08T03:39:07Z<p>Dbanas: Added two additional categories.</p>
<hr />
<div>A set of types, classes, and functions for visualizing computation decomposition trees.<br />
<br />
== Introduction ==<br />
<br />
This library can assist you in visualizing how computation is broken down, or decomposed, by certain ''Divide-And-Conquer'' type algorithms. Such algorithms are often capable of significantly reducing the order of complexity of an operation, by taking advantage of recursions, which occur when the original input is broken into halves, thirds, etc. Such repeated recursive breakdown often produces tree structures from an initially linear data input. And being able to visualize how the elements of these trees are recombined, when the operation is evaluated, can help us make smarter choices about how to apply a particular type of massively parallel computational resource to the computational problem.<br />
<br />
[[Category:Applications]]<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Treeviz&diff=57290Treeviz2013-12-08T03:26:46Z<p>Dbanas: Initial revision.</p>
<hr />
<div>A set of types, classes, and functions for visualizing computation decomposition trees.<br />
<br />
== Introduction ==<br />
<br />
This library can assist you in visualizing how computation is broken down, or decomposed, by certain ''Divide-And-Conquer'' type algorithms. Such algorithms are often capable of significantly reducing the order of complexity of an operation, by taking advantage of recursions, which occur when the original input is broken into halves, thirds, etc. Such repeated recursive breakdown often produces tree structures from an initially linear data input. And being able to visualize how the elements of these trees are recombined, when the operation is evaluated, can help us make smarter choices about how to apply a particular type of massively parallel computational resource to the computational problem.<br />
<br />
[[Category:Applications]]</div>Dbanashttps://wiki.haskell.org/index.php?title=AMI_Tool&diff=55803AMI Tool2013-04-30T13:22:06Z<p>Dbanas: /* Installation */ Corrected test command line.</p>
<hr />
<div>''AMITool'' is a Haskell package, which provides the essential tools necessary, in order to create IBIS-AMI models using Haskell.<br />
<br />
''Authors: [mailto:capn.freako@gmail.com David Banas]''<br />
<br />
== Usage ==<br />
<br />
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.<br />
<br />
=== Installation ===<br />
<br />
NOTE) This package is currently only supported on Linux.<br />
<br />
If you haven't already, install the [http://hackage.haskell.org/platform// Haskell Platform] on your system.<br />
<br />
(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.)<br />
<br />
Download the [https://github.com/capn-freako/AMI-Tool source tarball] and extract it:<br />
<br />
$ tar xzf amitool-v0.1.tgz<br />
<br />
Move into the newly created directory, and build the project:<br />
<br />
$ cd amitool-v0.1<br />
$ make<br />
<br />
If the make succeeds, you'll find the following output files in the directory:<br />
<br />
* '''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.<br />
* '''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.<br />
<br />
You can quickly verify correct compilation and/or system infrastructural integrity by executing the following command:<br />
<br />
$ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:./" ./ami_test<br />
<br />
=== Customization ===<br />
<br />
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'':<br />
<br />
-- Change the line, below, as follows:<br />
-- - Change "testAMI" to the root name of your AMI parameter tree.<br />
-- - Change "Mode" to the name you've given to the filter mode selection parameter.<br />
= case getAmiExp amiTree ["testAMI", "Mode"] of<br />
-- Change the `Vals' lines, below, to reflect your possible values of filter<br />
-- mode, and the corresponding action to be taken in that mode, adding/deleting<br />
-- lines as necessary.<br />
Just (Vals ["0"]) -> impulse -- Bypassed.<br />
Just (Vals ["1"]) -> fir (lpf 0.5 2) impulse -- 2nd order FIR LPF w/ cutoff at 1/2 Nyquist<br />
-- That's it; no more changes are required.<br />
<br />
== Description ==<br />
<br />
=== Source Files ===<br />
<br />
* AMIParse.hs - Haskell source code for parsing an AMI parameter string<br />
* AMIModel.hs - Haskell source code for generic implementation of AMI functions<br />
* ExmplUsrModel.hs - Haskell source code for model specific behavior<br />
* ami_model.c - C source code for implementation of dynamic loading interface, as well as setup/tear-down of Haskell run-time system<br />
* ami_test.c - example C source code showing how to dynamically load a shared object library and call the AMI functions<br />
<br />
=== Public interface ===<br />
<br />
==== New data types ====<br />
<br />
The '''AMIParse''' module defines a new type alias, ''AmiToken'', and a new abstract data type, ''AmiExp'', as follows:<br />
<br />
type AmiToken = (String, AmiExp)<br />
<br />
data AmiExp = Vals [String]<br />
| Tokens [AmiToken]<br />
<br />
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.<br />
<br />
==== Supporting functions ====<br />
<br />
The '''AMIParse''' module exposes the following public functions:<br />
<br />
; amiToken :: Parser AmiToken<br />
: Parses an AMI parameter string, returning an AmiToken.<br />
<br />
; getAmiExp :: AmiToken -> [String] -> Maybe AmiExp<br />
: Scans through an AmiToken (presumably, returned by ''amiToken'') for a particular requested value. For example:<br />
getAmiExp (amiToken "(rootName (Mode 2))") ["rootName", "Mode"] = Just (Vals "2")<br />
<br />
== Extended Testing ==<br />
In order to perform more extensive testing on either the default ''libami.so'' or your own customized version of this file, you can use the [http://www.sisoft.com/elearning/ibis-ami.html AMI Toolkit] from '''SiSoft, Inc.'''<br />
<br />
You'll find example input to thier ''IBIS_AMI_test'' program in the ''test.ami.csv'' file, included in this package.<br />
<br />
Output from the program is written to ''test_out.ami.csv''.<br />
<br />
See the documentation, which comes with their tool kit, for more details.<br />
<br />
The command to invoke is:<br />
<br />
IBIS_AMI_test -i test.ami.csv -f libami.so<br />
<br />
== Documentation ==<br />
This page serves as the primary documentation for this package.<br />
<br />
== Related work ==<br />
;[http://www.eda.org/ibis/macromodel_wip/ IBIS Advanced Technology Modeling Workgroup]<br />
:In particular, see the ''Tools'' and ''Work Archive'' sections.<br />
<br />
== Community ==<br />
In progress. Meanwhile, I will serve as e-mail reflectron for all interested parties. [mailto:capn.freako@gmail.com Send me your comments], and I will disseminate them to the group.<br />
<br />
Alternatively, if you feel your comments are relevant to the ATM modeling community in general, [mailto:ibis-macro@freelists.org use their mailing list], instead.<br />
<br />
To sign up for, or view the archives of the ATM mailing list, [http://www.freelists.org/list/ibis-macro visit their page] on '''Freelists.org'''.<br />
<br />
== FAQ ==<br />
<br />
=== Why Haskell? ===<br />
Because the Haskell code to parse an AMI parameter string looks like this:<br />
<br />
amiToken = do skipJunk<br />
symbol (char '(')<br />
lbl <- symbol (identifier <?> "label")<br />
do tokens <- try (symbol (many1 amiToken))<br />
symbol (char ')')<br />
return (lbl, Tokens tokens)<br />
<|> do vals <- sepBy (quotedVal <|> many (noneOf " )")) (char ' ')<br />
symbol (char ')')<br />
return (lbl, Vals vals)<br />
<br />
And for the following reasons:<br />
* It is a modern, strongly typed, functional language, which means we:<br />
** can think at a higher level of abstraction when coding,<br />
** are alerted to more of our programming errors at compile time,<br />
** don't have to do as much memory housekeeping, and<br />
** get to write less code.<br />
* 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.<br />
<br />
=== Will we get the performance we need out of ''AMI_Getwave'' if it's written in Haskell? ===<br />
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...<br />
<br />
=== Okay, I'm interested; how do I quickly learn Haskell? ===<br />
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.<br />
<br />
=== I've made it through the book, above, but it's rather academic; how do I do real practical things with Haskell? ===<br />
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. ;-) )<br />
<br />
== Model Comparison & Correlation ==<br />
<br />
=== Impulse and Frequency Response Comparisons ===<br />
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.<br />
<br />
[[Image:Model_Comparison.png]]<br />
<br />
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.)<br />
<br />
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.<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=AMI_Tool&diff=55559AMI Tool2013-03-13T16:41:34Z<p>Dbanas: /* Impulse and Frequency Response Comparisons */ Added SiSoft link. Minor correction to verbiage.</p>
<hr />
<div>''AMITool'' is a Haskell package, which provides the essential tools necessary, in order to create IBIS-AMI models using Haskell.<br />
<br />
''Authors: [mailto:capn.freako@gmail.com David Banas]''<br />
<br />
== Usage ==<br />
<br />
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.<br />
<br />
=== Installation ===<br />
<br />
NOTE) This package is currently only supported on Linux.<br />
<br />
If you haven't already, install the [http://hackage.haskell.org/platform// Haskell Platform] on your system.<br />
<br />
(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.)<br />
<br />
Download the [https://github.com/capn-freako/AMI-Tool source tarball] and extract it:<br />
<br />
$ tar xzf amitool-v0.1.tgz<br />
<br />
Move into the newly created directory, and build the project:<br />
<br />
$ cd amitool-v0.1<br />
$ make<br />
<br />
If the make succeeds, you'll find the following output files in the directory:<br />
<br />
* '''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.<br />
* '''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.<br />
<br />
You can quickly verify correct compilation and/or system infrastructural integrity by executing the following command:<br />
<br />
$ ./ami_test test.ami<br />
<br />
=== Customization ===<br />
<br />
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'':<br />
<br />
-- Change the line, below, as follows:<br />
-- - Change "testAMI" to the root name of your AMI parameter tree.<br />
-- - Change "Mode" to the name you've given to the filter mode selection parameter.<br />
= case getAmiExp amiTree ["testAMI", "Mode"] of<br />
-- Change the `Vals' lines, below, to reflect your possible values of filter<br />
-- mode, and the corresponding action to be taken in that mode, adding/deleting<br />
-- lines as necessary.<br />
Just (Vals ["0"]) -> impulse -- Bypassed.<br />
Just (Vals ["1"]) -> fir (lpf 0.5 2) impulse -- 2nd order FIR LPF w/ cutoff at 1/2 Nyquist<br />
-- That's it; no more changes are required.<br />
<br />
== Description ==<br />
<br />
=== Source Files ===<br />
<br />
* AMIParse.hs - Haskell source code for parsing an AMI parameter string<br />
* AMIModel.hs - Haskell source code for generic implementation of AMI functions<br />
* ExmplUsrModel.hs - Haskell source code for model specific behavior<br />
* ami_model.c - C source code for implementation of dynamic loading interface, as well as setup/tear-down of Haskell run-time system<br />
* ami_test.c - example C source code showing how to dynamically load a shared object library and call the AMI functions<br />
<br />
=== Public interface ===<br />
<br />
==== New data types ====<br />
<br />
The '''AMIParse''' module defines a new type alias, ''AmiToken'', and a new abstract data type, ''AmiExp'', as follows:<br />
<br />
type AmiToken = (String, AmiExp)<br />
<br />
data AmiExp = Vals [String]<br />
| Tokens [AmiToken]<br />
<br />
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.<br />
<br />
==== Supporting functions ====<br />
<br />
The '''AMIParse''' module exposes the following public functions:<br />
<br />
; amiToken :: Parser AmiToken<br />
: Parses an AMI parameter string, returning an AmiToken.<br />
<br />
; getAmiExp :: AmiToken -> [String] -> Maybe AmiExp<br />
: Scans through an AmiToken (presumably, returned by ''amiToken'') for a particular requested value. For example:<br />
getAmiExp (amiToken "(rootName (Mode 2))") ["rootName", "Mode"] = Just (Vals "2")<br />
<br />
== Extended Testing ==<br />
In order to perform more extensive testing on either the default ''libami.so'' or your own customized version of this file, you can use the [http://www.sisoft.com/elearning/ibis-ami.html AMI Toolkit] from '''SiSoft, Inc.'''<br />
<br />
You'll find example input to thier ''IBIS_AMI_test'' program in the ''test.ami.csv'' file, included in this package.<br />
<br />
Output from the program is written to ''test_out.ami.csv''.<br />
<br />
See the documentation, which comes with their tool kit, for more details.<br />
<br />
The command to invoke is:<br />
<br />
IBIS_AMI_test -i test.ami.csv -f libami.so<br />
<br />
== Documentation ==<br />
This page serves as the primary documentation for this package.<br />
<br />
== Related work ==<br />
;[http://www.eda.org/ibis/macromodel_wip/ IBIS Advanced Technology Modeling Workgroup]<br />
:In particular, see the ''Tools'' and ''Work Archive'' sections.<br />
<br />
== Community ==<br />
In progress. Meanwhile, I will serve as e-mail reflectron for all interested parties. [mailto:capn.freako@gmail.com Send me your comments], and I will disseminate them to the group.<br />
<br />
Alternatively, if you feel your comments are relevant to the ATM modeling community in general, [mailto:ibis-macro@freelists.org use their mailing list], instead.<br />
<br />
To sign up for, or view the archives of the ATM mailing list, [http://www.freelists.org/list/ibis-macro visit their page] on '''Freelists.org'''.<br />
<br />
== FAQ ==<br />
<br />
=== Why Haskell? ===<br />
Because the Haskell code to parse an AMI parameter string looks like this:<br />
<br />
amiToken = do skipJunk<br />
symbol (char '(')<br />
lbl <- symbol (identifier <?> "label")<br />
do tokens <- try (symbol (many1 amiToken))<br />
symbol (char ')')<br />
return (lbl, Tokens tokens)<br />
<|> do vals <- sepBy (quotedVal <|> many (noneOf " )")) (char ' ')<br />
symbol (char ')')<br />
return (lbl, Vals vals)<br />
<br />
And for the following reasons:<br />
* It is a modern, strongly typed, functional language, which means we:<br />
** can think at a higher level of abstraction when coding,<br />
** are alerted to more of our programming errors at compile time,<br />
** don't have to do as much memory housekeeping, and<br />
** get to write less code.<br />
* 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.<br />
<br />
=== Will we get the performance we need out of ''AMI_Getwave'' if it's written in Haskell? ===<br />
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...<br />
<br />
=== Okay, I'm interested; how do I quickly learn Haskell? ===<br />
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.<br />
<br />
=== I've made it through the book, above, but it's rather academic; how do I do real practical things with Haskell? ===<br />
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. ;-) )<br />
<br />
== Model Comparison & Correlation ==<br />
<br />
=== Impulse and Frequency Response Comparisons ===<br />
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.<br />
<br />
[[Image:Model_Comparison.png]]<br />
<br />
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.)<br />
<br />
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.<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=AMI_Tool&diff=55558AMI Tool2013-03-13T16:30:23Z<p>Dbanas: Removed broken link.</p>
<hr />
<div>''AMITool'' is a Haskell package, which provides the essential tools necessary, in order to create IBIS-AMI models using Haskell.<br />
<br />
''Authors: [mailto:capn.freako@gmail.com David Banas]''<br />
<br />
== Usage ==<br />
<br />
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.<br />
<br />
=== Installation ===<br />
<br />
NOTE) This package is currently only supported on Linux.<br />
<br />
If you haven't already, install the [http://hackage.haskell.org/platform// Haskell Platform] on your system.<br />
<br />
(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.)<br />
<br />
Download the [https://github.com/capn-freako/AMI-Tool source tarball] and extract it:<br />
<br />
$ tar xzf amitool-v0.1.tgz<br />
<br />
Move into the newly created directory, and build the project:<br />
<br />
$ cd amitool-v0.1<br />
$ make<br />
<br />
If the make succeeds, you'll find the following output files in the directory:<br />
<br />
* '''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.<br />
* '''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.<br />
<br />
You can quickly verify correct compilation and/or system infrastructural integrity by executing the following command:<br />
<br />
$ ./ami_test test.ami<br />
<br />
=== Customization ===<br />
<br />
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'':<br />
<br />
-- Change the line, below, as follows:<br />
-- - Change "testAMI" to the root name of your AMI parameter tree.<br />
-- - Change "Mode" to the name you've given to the filter mode selection parameter.<br />
= case getAmiExp amiTree ["testAMI", "Mode"] of<br />
-- Change the `Vals' lines, below, to reflect your possible values of filter<br />
-- mode, and the corresponding action to be taken in that mode, adding/deleting<br />
-- lines as necessary.<br />
Just (Vals ["0"]) -> impulse -- Bypassed.<br />
Just (Vals ["1"]) -> fir (lpf 0.5 2) impulse -- 2nd order FIR LPF w/ cutoff at 1/2 Nyquist<br />
-- That's it; no more changes are required.<br />
<br />
== Description ==<br />
<br />
=== Source Files ===<br />
<br />
* AMIParse.hs - Haskell source code for parsing an AMI parameter string<br />
* AMIModel.hs - Haskell source code for generic implementation of AMI functions<br />
* ExmplUsrModel.hs - Haskell source code for model specific behavior<br />
* ami_model.c - C source code for implementation of dynamic loading interface, as well as setup/tear-down of Haskell run-time system<br />
* ami_test.c - example C source code showing how to dynamically load a shared object library and call the AMI functions<br />
<br />
=== Public interface ===<br />
<br />
==== New data types ====<br />
<br />
The '''AMIParse''' module defines a new type alias, ''AmiToken'', and a new abstract data type, ''AmiExp'', as follows:<br />
<br />
type AmiToken = (String, AmiExp)<br />
<br />
data AmiExp = Vals [String]<br />
| Tokens [AmiToken]<br />
<br />
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.<br />
<br />
==== Supporting functions ====<br />
<br />
The '''AMIParse''' module exposes the following public functions:<br />
<br />
; amiToken :: Parser AmiToken<br />
: Parses an AMI parameter string, returning an AmiToken.<br />
<br />
; getAmiExp :: AmiToken -> [String] -> Maybe AmiExp<br />
: Scans through an AmiToken (presumably, returned by ''amiToken'') for a particular requested value. For example:<br />
getAmiExp (amiToken "(rootName (Mode 2))") ["rootName", "Mode"] = Just (Vals "2")<br />
<br />
== Extended Testing ==<br />
In order to perform more extensive testing on either the default ''libami.so'' or your own customized version of this file, you can use the [http://www.sisoft.com/elearning/ibis-ami.html AMI Toolkit] from '''SiSoft, Inc.'''<br />
<br />
You'll find example input to thier ''IBIS_AMI_test'' program in the ''test.ami.csv'' file, included in this package.<br />
<br />
Output from the program is written to ''test_out.ami.csv''.<br />
<br />
See the documentation, which comes with their tool kit, for more details.<br />
<br />
The command to invoke is:<br />
<br />
IBIS_AMI_test -i test.ami.csv -f libami.so<br />
<br />
== Documentation ==<br />
This page serves as the primary documentation for this package.<br />
<br />
== Related work ==<br />
;[http://www.eda.org/ibis/macromodel_wip/ IBIS Advanced Technology Modeling Workgroup]<br />
:In particular, see the ''Tools'' and ''Work Archive'' sections.<br />
<br />
== Community ==<br />
In progress. Meanwhile, I will serve as e-mail reflectron for all interested parties. [mailto:capn.freako@gmail.com Send me your comments], and I will disseminate them to the group.<br />
<br />
Alternatively, if you feel your comments are relevant to the ATM modeling community in general, [mailto:ibis-macro@freelists.org use their mailing list], instead.<br />
<br />
To sign up for, or view the archives of the ATM mailing list, [http://www.freelists.org/list/ibis-macro visit their page] on '''Freelists.org'''.<br />
<br />
== FAQ ==<br />
<br />
=== Why Haskell? ===<br />
Because the Haskell code to parse an AMI parameter string looks like this:<br />
<br />
amiToken = do skipJunk<br />
symbol (char '(')<br />
lbl <- symbol (identifier <?> "label")<br />
do tokens <- try (symbol (many1 amiToken))<br />
symbol (char ')')<br />
return (lbl, Tokens tokens)<br />
<|> do vals <- sepBy (quotedVal <|> many (noneOf " )")) (char ' ')<br />
symbol (char ')')<br />
return (lbl, Vals vals)<br />
<br />
And for the following reasons:<br />
* It is a modern, strongly typed, functional language, which means we:<br />
** can think at a higher level of abstraction when coding,<br />
** are alerted to more of our programming errors at compile time,<br />
** don't have to do as much memory housekeeping, and<br />
** get to write less code.<br />
* 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.<br />
<br />
=== Will we get the performance we need out of ''AMI_Getwave'' if it's written in Haskell? ===<br />
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...<br />
<br />
=== Okay, I'm interested; how do I quickly learn Haskell? ===<br />
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.<br />
<br />
=== I've made it through the book, above, but it's rather academic; how do I do real practical things with Haskell? ===<br />
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. ;-) )<br />
<br />
== Model Comparison & Correlation ==<br />
<br />
=== Impulse and Frequency Response Comparisons ===<br />
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 an ideal impulse (i.e. - [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.<br />
<br />
[[Image:Model_Comparison.png]]<br />
<br />
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.)<br />
<br />
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.<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=BayHac2013&diff=55557BayHac20132013-03-13T16:19:59Z<p>Dbanas: /* Projects */</p>
<hr />
<div>[[Image:BayHac13_banner.png]]<br />
<br />
<b><span style="color:#e73">San Francisco Bay Area</span> <span style="color:#aaa">&amp;</span> <span style="color:#930">Silicon Valley</span> <span style="color:#aaa">Haskell Hackathon</span></b><br />
<br />
Come join a group of Haskell hackers to work on a wide variety of projects. All levels welcome.<br />
<br />
----<br />
{|<br />
|When:<br />
|Friday, May 17th – Sunday, May 19th, 2013<br />
|-<br />
|Hours:<br />
|10am ~ 7pm (still in early planning stages)<br />
|-<br />
|Where:<br />
|[http://www.hackerdojo.com/ Hacker Dojo] ''- note the Dojo has moved''<br />
|-<br />
|Cost:<br />
|Free<br />
|-<br />
|Sign up:<br />
|[https://docs.google.com/forms/d/1u502QHmyFC_Wi4fqv_jYTTRun8E6D_gwcbf6bB3dvrs/viewform sign-up form]<br />
|-<br />
|News and Discussion:<br />
|[http://groups.google.com/group/bayhac BayHac Google Group]<br />
|}<br />
<br />
== Location ==<br />
<br />
[http://www.hackerdojo.com/ Hacker Dojo], 599 Fairchild Drive, Mountain View, CA ([https://maps.google.com/maps?ie=UTF8&cid=11488539903009648209&q=Hacker+Dojo&iwloc=A&gl=US&hl=en-US Google Map])<br />
<br />
== Attendees == <br />
<br />
If you're attending, please use the [https://docs.google.com/forms/d/1u502QHmyFC_Wi4fqv_jYTTRun8E6D_gwcbf6bB3dvrs/viewform sign-up form] to help the organizers plan. Add your name here if you want to let others know you're coming.<br />
<br />
# [http://www.ozonehouse.com/mark/ Mark Lentczner] - organizer<br />
# [http://www.johantibell.com/mark/ Johan Tibell] - organizer<br />
# [http://www.linkedin.com/pub/david-banas/1/6ab/a48 David Banas] - ''AMITool'' project lead<br />
<br />
== Projects ==<br />
<br />
If you plan working on a project at the Hackathon, you can put it up here so other interested hackers can see what projects are afoot. If you don't have a project, look here and find one!<br />
<br />
# [http://code.google.com/p/plush/ Plush] - Mark L.<br />
# [http://www.haskell.org/haskellwiki/AMI_Tool AMITool] - David Banas<br />
[[Category:Community]]</div>Dbanashttps://wiki.haskell.org/index.php?title=BayHac2013&diff=55556BayHac20132013-03-13T16:17:29Z<p>Dbanas: /* Attendees */</p>
<hr />
<div>[[Image:BayHac13_banner.png]]<br />
<br />
<b><span style="color:#e73">San Francisco Bay Area</span> <span style="color:#aaa">&amp;</span> <span style="color:#930">Silicon Valley</span> <span style="color:#aaa">Haskell Hackathon</span></b><br />
<br />
Come join a group of Haskell hackers to work on a wide variety of projects. All levels welcome.<br />
<br />
----<br />
{|<br />
|When:<br />
|Friday, May 17th – Sunday, May 19th, 2013<br />
|-<br />
|Hours:<br />
|10am ~ 7pm (still in early planning stages)<br />
|-<br />
|Where:<br />
|[http://www.hackerdojo.com/ Hacker Dojo] ''- note the Dojo has moved''<br />
|-<br />
|Cost:<br />
|Free<br />
|-<br />
|Sign up:<br />
|[https://docs.google.com/forms/d/1u502QHmyFC_Wi4fqv_jYTTRun8E6D_gwcbf6bB3dvrs/viewform sign-up form]<br />
|-<br />
|News and Discussion:<br />
|[http://groups.google.com/group/bayhac BayHac Google Group]<br />
|}<br />
<br />
== Location ==<br />
<br />
[http://www.hackerdojo.com/ Hacker Dojo], 599 Fairchild Drive, Mountain View, CA ([https://maps.google.com/maps?ie=UTF8&cid=11488539903009648209&q=Hacker+Dojo&iwloc=A&gl=US&hl=en-US Google Map])<br />
<br />
== Attendees == <br />
<br />
If you're attending, please use the [https://docs.google.com/forms/d/1u502QHmyFC_Wi4fqv_jYTTRun8E6D_gwcbf6bB3dvrs/viewform sign-up form] to help the organizers plan. Add your name here if you want to let others know you're coming.<br />
<br />
# [http://www.ozonehouse.com/mark/ Mark Lentczner] - organizer<br />
# [http://www.johantibell.com/mark/ Johan Tibell] - organizer<br />
# [http://www.linkedin.com/pub/david-banas/1/6ab/a48 David Banas] - ''AMITool'' project lead<br />
<br />
== Projects ==<br />
<br />
If you plan working on a project at the Hackathon, you can put it up here so other interested hackers can see what projects are afoot. If you don't have a project, look here and find one!<br />
<br />
# [http://code.google.com/p/plush/ Plush] - Mark L.<br />
<br />
[[Category:Community]]</div>Dbanashttps://wiki.haskell.org/index.php?title=AMI_Tool&diff=45924AMI Tool2012-06-07T01:02:35Z<p>Dbanas: /* AMI_Init Impulse Response */</p>
<hr />
<div>[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.<br />
<br />
''Authors: [mailto:capn.freako@gmail.com David Banas]''<br />
<br />
== Usage ==<br />
<br />
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.<br />
<br />
=== Installation ===<br />
<br />
NOTE) This package is currently only supported on Linux.<br />
<br />
If you haven't already, install the [http://hackage.haskell.org/platform// Haskell Platform] on your system.<br />
<br />
(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.)<br />
<br />
Download the [https://github.com/capn-freako/AMI-Tool source tarball] and extract it:<br />
<br />
$ tar xzf amitool-v0.1.tgz<br />
<br />
Move into the newly created directory, and build the project:<br />
<br />
$ cd amitool-v0.1<br />
$ make<br />
<br />
If the make succeeds, you'll find the following output files in the directory:<br />
<br />
* '''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.<br />
* '''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.<br />
<br />
You can quickly verify correct compilation and/or system infrastructural integrity by executing the following command:<br />
<br />
$ ./ami_test test.ami<br />
<br />
=== Customization ===<br />
<br />
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'':<br />
<br />
-- Change the line, below, as follows:<br />
-- - Change "testAMI" to the root name of your AMI parameter tree.<br />
-- - Change "Mode" to the name you've given to the filter mode selection parameter.<br />
= case getAmiExp amiTree ["testAMI", "Mode"] of<br />
-- Change the `Vals' lines, below, to reflect your possible values of filter<br />
-- mode, and the corresponding action to be taken in that mode, adding/deleting<br />
-- lines as necessary.<br />
Just (Vals ["0"]) -> impulse -- Bypassed.<br />
Just (Vals ["1"]) -> fir (lpf 0.5 2) impulse -- 2nd order FIR LPF w/ cutoff at 1/2 Nyquist<br />
-- That's it; no more changes are required.<br />
<br />
== Description ==<br />
<br />
=== Source Files ===<br />
<br />
* AMIParse.hs - Haskell source code for parsing an AMI parameter string<br />
* AMIModel.hs - Haskell source code for generic implementation of AMI functions<br />
* ExmplUsrModel.hs - Haskell source code for model specific behavior<br />
* ami_model.c - C source code for implementation of dynamic loading interface, as well as setup/tear-down of Haskell run-time system<br />
* ami_test.c - example C source code showing how to dynamically load a shared object library and call the AMI functions<br />
<br />
=== Public interface ===<br />
<br />
==== New data types ====<br />
<br />
The '''AMIParse''' module defines a new type alias, ''AmiToken'', and a new abstract data type, ''AmiExp'', as follows:<br />
<br />
type AmiToken = (String, AmiExp)<br />
<br />
data AmiExp = Vals [String]<br />
| Tokens [AmiToken]<br />
<br />
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.<br />
<br />
==== Supporting functions ====<br />
<br />
The '''AMIParse''' module exposes the following public functions:<br />
<br />
; amiToken :: Parser AmiToken<br />
: Parses an AMI parameter string, returning an AmiToken.<br />
<br />
; getAmiExp :: AmiToken -> [String] -> Maybe AmiExp<br />
: Scans through an AmiToken (presumably, returned by ''amiToken'') for a particular requested value. For example:<br />
getAmiExp (amiToken "(rootName (Mode 2))") ["rootName", "Mode"] = Just (Vals "2")<br />
<br />
== Extended Testing ==<br />
In order to perform more extensive testing on either the default ''libami.so'' or your own customized version of this file, you can use the [http://www.sisoft.com/elearning/ibis-ami.html AMI Toolkit] from '''SiSoft, Inc.'''<br />
<br />
You'll find example input to thier ''IBIS_AMI_test'' program in the ''test.ami.csv'' file, included in this package.<br />
<br />
Output from the program is written to ''test_out.ami.csv''.<br />
<br />
See the documentation, which comes with their tool kit, for more details.<br />
<br />
The command to invoke is:<br />
<br />
IBIS_AMI_test -i test.ami.csv -f libami.so<br />
<br />
== Documentation ==<br />
This page serves as the primary documentation for this package.<br />
<br />
== Related work ==<br />
;[http://www.eda.org/ibis/macromodel_wip/ IBIS Advanced Technology Modeling Workgroup]<br />
:In particular, see the ''Tools'' and ''Work Archive'' sections.<br />
<br />
== Community ==<br />
In progress. Meanwhile, I will serve as e-mail reflectron for all interested parties. [mailto:capn.freako@gmail.com Send me your comments], and I will disseminate them to the group.<br />
<br />
Alternatively, if you feel your comments are relevant to the ATM modeling community in general, [mailto:ibis-macro@freelists.org use their mailing list], instead.<br />
<br />
To sign up for, or view the archives of the ATM mailing list, [http://www.freelists.org/list/ibis-macro visit their page] on '''Freelists.org'''.<br />
<br />
== FAQ ==<br />
<br />
=== Why Haskell? ===<br />
Because the Haskell code to parse an AMI parameter string looks like this:<br />
<br />
amiToken = do skipJunk<br />
symbol (char '(')<br />
lbl <- symbol (identifier <?> "label")<br />
do tokens <- try (symbol (many1 amiToken))<br />
symbol (char ')')<br />
return (lbl, Tokens tokens)<br />
<|> do vals <- sepBy (quotedVal <|> many (noneOf " )")) (char ' ')<br />
symbol (char ')')<br />
return (lbl, Vals vals)<br />
<br />
And for the following reasons:<br />
* It is a modern, strongly typed, functional language, which means we:<br />
** can think at a higher level of abstraction when coding,<br />
** are alerted to more of our programming errors at compile time,<br />
** don't have to do as much memory housekeeping, and<br />
** get to write less code.<br />
* 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.<br />
<br />
=== Will we get the performance we need out of ''AMI_Getwave'' if it's written in Haskell? ===<br />
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...<br />
<br />
=== Okay, I'm interested; how do I quickly learn Haskell? ===<br />
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.<br />
<br />
=== I've made it through the book, above, but it's rather academic; how do I do real practical things with Haskell? ===<br />
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. ;-) )<br />
<br />
== Model Comparison & Correlation ==<br />
<br />
=== Impulse and Frequency Response Comparisons ===<br />
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 an ideal impulse (i.e. - [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.<br />
<br />
[[Image:Model_Comparison.png]]<br />
<br />
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.)<br />
<br />
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.<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=File:Model_Comparison.png&diff=45923File:Model Comparison.png2012-06-07T00:53:07Z<p>Dbanas: uploaded a new version of "Image:Model Comparison.png": Updated model comparison image</p>
<hr />
<div>screen shot of CosmosScope session, showing comparison of C, Haskell, and SPICE CTLE transfer functions</div>Dbanashttps://wiki.haskell.org/index.php?title=AMI_Tool&diff=45922AMI Tool2012-06-07T00:07:26Z<p>Dbanas: Updating w/ GetWave performance info.</p>
<hr />
<div>[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.<br />
<br />
''Authors: [mailto:capn.freako@gmail.com David Banas]''<br />
<br />
== Usage ==<br />
<br />
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.<br />
<br />
=== Installation ===<br />
<br />
NOTE) This package is currently only supported on Linux.<br />
<br />
If you haven't already, install the [http://hackage.haskell.org/platform// Haskell Platform] on your system.<br />
<br />
(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.)<br />
<br />
Download the [https://github.com/capn-freako/AMI-Tool source tarball] and extract it:<br />
<br />
$ tar xzf amitool-v0.1.tgz<br />
<br />
Move into the newly created directory, and build the project:<br />
<br />
$ cd amitool-v0.1<br />
$ make<br />
<br />
If the make succeeds, you'll find the following output files in the directory:<br />
<br />
* '''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.<br />
* '''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.<br />
<br />
You can quickly verify correct compilation and/or system infrastructural integrity by executing the following command:<br />
<br />
$ ./ami_test test.ami<br />
<br />
=== Customization ===<br />
<br />
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'':<br />
<br />
-- Change the line, below, as follows:<br />
-- - Change "testAMI" to the root name of your AMI parameter tree.<br />
-- - Change "Mode" to the name you've given to the filter mode selection parameter.<br />
= case getAmiExp amiTree ["testAMI", "Mode"] of<br />
-- Change the `Vals' lines, below, to reflect your possible values of filter<br />
-- mode, and the corresponding action to be taken in that mode, adding/deleting<br />
-- lines as necessary.<br />
Just (Vals ["0"]) -> impulse -- Bypassed.<br />
Just (Vals ["1"]) -> fir (lpf 0.5 2) impulse -- 2nd order FIR LPF w/ cutoff at 1/2 Nyquist<br />
-- That's it; no more changes are required.<br />
<br />
== Description ==<br />
<br />
=== Source Files ===<br />
<br />
* AMIParse.hs - Haskell source code for parsing an AMI parameter string<br />
* AMIModel.hs - Haskell source code for generic implementation of AMI functions<br />
* ExmplUsrModel.hs - Haskell source code for model specific behavior<br />
* ami_model.c - C source code for implementation of dynamic loading interface, as well as setup/tear-down of Haskell run-time system<br />
* ami_test.c - example C source code showing how to dynamically load a shared object library and call the AMI functions<br />
<br />
=== Public interface ===<br />
<br />
==== New data types ====<br />
<br />
The '''AMIParse''' module defines a new type alias, ''AmiToken'', and a new abstract data type, ''AmiExp'', as follows:<br />
<br />
type AmiToken = (String, AmiExp)<br />
<br />
data AmiExp = Vals [String]<br />
| Tokens [AmiToken]<br />
<br />
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.<br />
<br />
==== Supporting functions ====<br />
<br />
The '''AMIParse''' module exposes the following public functions:<br />
<br />
; amiToken :: Parser AmiToken<br />
: Parses an AMI parameter string, returning an AmiToken.<br />
<br />
; getAmiExp :: AmiToken -> [String] -> Maybe AmiExp<br />
: Scans through an AmiToken (presumably, returned by ''amiToken'') for a particular requested value. For example:<br />
getAmiExp (amiToken "(rootName (Mode 2))") ["rootName", "Mode"] = Just (Vals "2")<br />
<br />
== Extended Testing ==<br />
In order to perform more extensive testing on either the default ''libami.so'' or your own customized version of this file, you can use the [http://www.sisoft.com/elearning/ibis-ami.html AMI Toolkit] from '''SiSoft, Inc.'''<br />
<br />
You'll find example input to thier ''IBIS_AMI_test'' program in the ''test.ami.csv'' file, included in this package.<br />
<br />
Output from the program is written to ''test_out.ami.csv''.<br />
<br />
See the documentation, which comes with their tool kit, for more details.<br />
<br />
The command to invoke is:<br />
<br />
IBIS_AMI_test -i test.ami.csv -f libami.so<br />
<br />
== Documentation ==<br />
This page serves as the primary documentation for this package.<br />
<br />
== Related work ==<br />
;[http://www.eda.org/ibis/macromodel_wip/ IBIS Advanced Technology Modeling Workgroup]<br />
:In particular, see the ''Tools'' and ''Work Archive'' sections.<br />
<br />
== Community ==<br />
In progress. Meanwhile, I will serve as e-mail reflectron for all interested parties. [mailto:capn.freako@gmail.com Send me your comments], and I will disseminate them to the group.<br />
<br />
Alternatively, if you feel your comments are relevant to the ATM modeling community in general, [mailto:ibis-macro@freelists.org use their mailing list], instead.<br />
<br />
To sign up for, or view the archives of the ATM mailing list, [http://www.freelists.org/list/ibis-macro visit their page] on '''Freelists.org'''.<br />
<br />
== FAQ ==<br />
<br />
=== Why Haskell? ===<br />
Because the Haskell code to parse an AMI parameter string looks like this:<br />
<br />
amiToken = do skipJunk<br />
symbol (char '(')<br />
lbl <- symbol (identifier <?> "label")<br />
do tokens <- try (symbol (many1 amiToken))<br />
symbol (char ')')<br />
return (lbl, Tokens tokens)<br />
<|> do vals <- sepBy (quotedVal <|> many (noneOf " )")) (char ' ')<br />
symbol (char ')')<br />
return (lbl, Vals vals)<br />
<br />
And for the following reasons:<br />
* It is a modern, strongly typed, functional language, which means we:<br />
** can think at a higher level of abstraction when coding,<br />
** are alerted to more of our programming errors at compile time,<br />
** don't have to do as much memory housekeeping, and<br />
** get to write less code.<br />
* 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.<br />
<br />
=== Will we get the performance we need out of ''AMI_Getwave'' if it's written in Haskell? ===<br />
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...<br />
<br />
=== Okay, I'm interested; how do I quickly learn Haskell? ===<br />
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.<br />
<br />
=== I've made it through the book, above, but it's rather academic; how do I do real practical things with Haskell? ===<br />
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. ;-) )<br />
<br />
== Model Comparison & Correlation ==<br />
<br />
=== ''AMI_Init'' Impulse Response ===<br />
The following plot shows a comparison of the transfer functions of the C and Haskell models of a Rx CTLE equalizer to a HSpice AC sweep of the actual circuit. In order to generate the C and Haskell transfer functions, below, I invoked each model, in turn, using the ''IBIS_AMI_test'' tool provided by SiSoft, Inc., using an ideal impulse (i.e. - [0, 1, 0, ..., 0]) as input, and took a FFT of the returned waveform. The configuration files given to the `-i' option 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. The vertical cursor has been positioned to the frequency at which the error in the Haskell model magnitude, relative to the SPICE model, first reaches 3 dB.<br />
<br />
[[Image:Model_Comparison.png]]<br />
<br />
Note the excellent agreement in spectral magnitude, out past 16 GHz, between the Haskell model and the HSpice AC sweep.<br />
<br />
The spurs in the C model transfer function at 5, 10, and 15 GHz are due to a well understood bug in the C code, which is easy to fix.<br />
<br />
The flipped up tail near the end of the Haskell model spectral magnitude curve is reminiscent of aliasing, but I'm puzzled as to why the same effect is not present in the C model.<br />
<br />
Finally, it is necessary to offset the HSpice results by -36 dB, in order to match the two models. I don't understand where this normalization error is creeping into the process.<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Random_Processes&diff=40682Random Processes2011-06-28T00:10:56Z<p>Dbanas: /* Community */ Added links to source tree and mailing list.</p>
<hr />
<div>[http://hackage.haskell.org/package/randproc RandProc] is a Haskell library, which defines and supports certain data structures that are convenient when working with random processes in a mathematically rigorous fashion.<br />
<br />
The concepts embedded in RandProc come from the text I used in my graduate stochastic processes course:<br />
<br />
Robert M. Gray, Lee D. Davisson; ''Random Processes - a Mathematical Approach for Engineers''; Prentice-Hall Information and System Sciences Series, Thomas Kailath, Series Editor.<br />
<br />
''Authors: [mailto:dbanas@banasfamily.net David Banas]''<br />
<br />
== Installation ==<br />
<br />
Download the `randproc` package:<br />
<br />
$ cabal install randproc<br />
<br />
and import it:<br />
<br />
import Data.RandProc<br />
<br />
== Description ==<br />
<br />
=== Underlying concepts ===<br />
As per the reference text, a ''probability space'' is taken to be composed of:<br />
<br />
* an '''abstract space''' of samples,<br />
* an '''event space''', which must be a sigma field over the abstract sample space, and<br />
* a '''probability measure''' over the event space.<br />
<br />
In the code, the ''event space'' and ''probability measure'' are combined, in order to keep the code concise.<br />
<br />
=== Public interface ===<br />
==== New data types ====<br />
The code defines an abstract data type, ''Sample'', as follows:<br />
data Sample = Point Double<br />
| Range (Double, Double)<br />
| Empty<br />
| Full<br />
deriving (Eq, Show)<br />
However, this type is not exported in the public interface of the `RandProc` module. Instead, helper functions ''point'' and ''range'' are provided, as alternatives, in order to protect against future implementation changes.<br />
<br />
''Note) There is, currently, a single exception to the above. The ''Empty'' value constructor ''is'' exported, as it is currently necessary. However, this is really just a hack designed to put off the task of making the support functions more intelligent, with regards to their handling of empty sample sets.''<br />
<br />
An event is defined in the code as simply an alias for a list of samples:<br />
type Event = [Sample]<br />
<br />
And a measure just attaches a probability of occurrence to an event:<br />
data Measure = Measure {<br />
event :: Event<br />
,prob :: Double<br />
}<br />
deriving (Eq, Ord, Show)<br />
<br />
==== Supporting functions ====<br />
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.<br />
<br />
; checkProbMeas<br />
: Checks a value of type 'ProbSpace' for correctness, and returns a value of type 'TestResult'.<br />
<br />
; checkSigma<br />
: Checks whether event space is actually a Sigma field over the sample space.<br />
<br />
; smplSetUnion<br />
: Collapses a list of samples down to the maximally reduced set, which still composes a proper union of the input.<br />
<br />
; smplSetInt<br />
: Reduces a list of samples to a single sample representing their intersection.<br />
<br />
== Usage ==<br />
For more extensive usage examples, see the `test/Test.hs` file.<br />
=== Construction of a probability space representing a fair coin ===<br />
fairCoin = ProbSpace<br />
[point 0.0, point 1.0]<br />
[Measure ( [Empty]) 0, Measure ( [point 0]) 0.5<br />
, Measure ( [point 1]) 0.5, Measure ( [point 0, point 1]) 1.0]<br />
=== Testing the probability space defined, above ===<br />
checkProbMeas fairCoin<br />
<br />
== Documentation ==<br />
The documentation for this library is generated, via Haddock.<br />
<br />
== Related work ==<br />
;[[Probabilistic_Functional_Programming | Probabilistic Functional Programming]]<br />
:I suspect a potential symbiosis between this library and `RandProc`<br />
<br />
== Community ==<br />
;[http://randprocnotes.wordpress.com/ RandProcNotes]<br />
:Blog dedicated to the `RandProc` Haskell library<br />
;[http://trac.haskell.org/RandProc/ Bug Tracker]<br />
:Bug tracker for the `RandProc` Haskell library<br />
;[mailto:RandProc@projects.haskell.org Mailing List]<br />
:Mailing list for `RandProc` users and developers<br />
;[http://code.haskell.org/RandProc/ Source Code Tree]<br />
:Browsable source tree<br />
;Darcs repository<br />
:<code>darcs get http://code.haskell.org/RandProc/</code><br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]<br />
[[Category:Mathematics]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Random_Processes&diff=40680Random Processes2011-06-27T23:27:28Z<p>Dbanas: /* Related work */ minor formatting change</p>
<hr />
<div>[http://hackage.haskell.org/package/randproc RandProc] is a Haskell library, which defines and supports certain data structures that are convenient when working with random processes in a mathematically rigorous fashion.<br />
<br />
The concepts embedded in RandProc come from the text I used in my graduate stochastic processes course:<br />
<br />
Robert M. Gray, Lee D. Davisson; ''Random Processes - a Mathematical Approach for Engineers''; Prentice-Hall Information and System Sciences Series, Thomas Kailath, Series Editor.<br />
<br />
''Authors: [mailto:dbanas@banasfamily.net David Banas]''<br />
<br />
== Installation ==<br />
<br />
Download the `randproc` package:<br />
<br />
$ cabal install randproc<br />
<br />
and import it:<br />
<br />
import Data.RandProc<br />
<br />
== Description ==<br />
<br />
=== Underlying concepts ===<br />
As per the reference text, a ''probability space'' is taken to be composed of:<br />
<br />
* an '''abstract space''' of samples,<br />
* an '''event space''', which must be a sigma field over the abstract sample space, and<br />
* a '''probability measure''' over the event space.<br />
<br />
In the code, the ''event space'' and ''probability measure'' are combined, in order to keep the code concise.<br />
<br />
=== Public interface ===<br />
==== New data types ====<br />
The code defines an abstract data type, ''Sample'', as follows:<br />
data Sample = Point Double<br />
| Range (Double, Double)<br />
| Empty<br />
| Full<br />
deriving (Eq, Show)<br />
However, this type is not exported in the public interface of the `RandProc` module. Instead, helper functions ''point'' and ''range'' are provided, as alternatives, in order to protect against future implementation changes.<br />
<br />
''Note) There is, currently, a single exception to the above. The ''Empty'' value constructor ''is'' exported, as it is currently necessary. However, this is really just a hack designed to put off the task of making the support functions more intelligent, with regards to their handling of empty sample sets.''<br />
<br />
An event is defined in the code as simply an alias for a list of samples:<br />
type Event = [Sample]<br />
<br />
And a measure just attaches a probability of occurrence to an event:<br />
data Measure = Measure {<br />
event :: Event<br />
,prob :: Double<br />
}<br />
deriving (Eq, Ord, Show)<br />
<br />
==== Supporting functions ====<br />
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.<br />
<br />
; checkProbMeas<br />
: Checks a value of type 'ProbSpace' for correctness, and returns a value of type 'TestResult'.<br />
<br />
; checkSigma<br />
: Checks whether event space is actually a Sigma field over the sample space.<br />
<br />
; smplSetUnion<br />
: Collapses a list of samples down to the maximally reduced set, which still composes a proper union of the input.<br />
<br />
; smplSetInt<br />
: Reduces a list of samples to a single sample representing their intersection.<br />
<br />
== Usage ==<br />
For more extensive usage examples, see the `test/Test.hs` file.<br />
=== Construction of a probability space representing a fair coin ===<br />
fairCoin = ProbSpace<br />
[point 0.0, point 1.0]<br />
[Measure ( [Empty]) 0, Measure ( [point 0]) 0.5<br />
, Measure ( [point 1]) 0.5, Measure ( [point 0, point 1]) 1.0]<br />
=== Testing the probability space defined, above ===<br />
checkProbMeas fairCoin<br />
<br />
== Documentation ==<br />
The documentation for this library is generated, via Haddock.<br />
<br />
== Related work ==<br />
;[[Probabilistic_Functional_Programming | Probabilistic Functional Programming]]<br />
:I suspect a potential symbiosis between this library and `RandProc`<br />
<br />
== Community ==<br />
;[http://randprocnotes.wordpress.com/ RandProcNotes]<br />
:Blog dedicated to the `RandProc` Haskell library<br />
;[http://trac.haskell.org/RandProc/ Bug Tracker]<br />
:Bug tracker for the `RandProc` Haskell library<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]<br />
[[Category:Mathematics]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Random_Processes&diff=40679Random Processes2011-06-27T23:23:55Z<p>Dbanas: Added link to bug tracker.</p>
<hr />
<div>[http://hackage.haskell.org/package/randproc RandProc] is a Haskell library, which defines and supports certain data structures that are convenient when working with random processes in a mathematically rigorous fashion.<br />
<br />
The concepts embedded in RandProc come from the text I used in my graduate stochastic processes course:<br />
<br />
Robert M. Gray, Lee D. Davisson; ''Random Processes - a Mathematical Approach for Engineers''; Prentice-Hall Information and System Sciences Series, Thomas Kailath, Series Editor.<br />
<br />
''Authors: [mailto:dbanas@banasfamily.net David Banas]''<br />
<br />
== Installation ==<br />
<br />
Download the `randproc` package:<br />
<br />
$ cabal install randproc<br />
<br />
and import it:<br />
<br />
import Data.RandProc<br />
<br />
== Description ==<br />
<br />
=== Underlying concepts ===<br />
As per the reference text, a ''probability space'' is taken to be composed of:<br />
<br />
* an '''abstract space''' of samples,<br />
* an '''event space''', which must be a sigma field over the abstract sample space, and<br />
* a '''probability measure''' over the event space.<br />
<br />
In the code, the ''event space'' and ''probability measure'' are combined, in order to keep the code concise.<br />
<br />
=== Public interface ===<br />
==== New data types ====<br />
The code defines an abstract data type, ''Sample'', as follows:<br />
data Sample = Point Double<br />
| Range (Double, Double)<br />
| Empty<br />
| Full<br />
deriving (Eq, Show)<br />
However, this type is not exported in the public interface of the `RandProc` module. Instead, helper functions ''point'' and ''range'' are provided, as alternatives, in order to protect against future implementation changes.<br />
<br />
''Note) There is, currently, a single exception to the above. The ''Empty'' value constructor ''is'' exported, as it is currently necessary. However, this is really just a hack designed to put off the task of making the support functions more intelligent, with regards to their handling of empty sample sets.''<br />
<br />
An event is defined in the code as simply an alias for a list of samples:<br />
type Event = [Sample]<br />
<br />
And a measure just attaches a probability of occurrence to an event:<br />
data Measure = Measure {<br />
event :: Event<br />
,prob :: Double<br />
}<br />
deriving (Eq, Ord, Show)<br />
<br />
==== Supporting functions ====<br />
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.<br />
<br />
; checkProbMeas<br />
: Checks a value of type 'ProbSpace' for correctness, and returns a value of type 'TestResult'.<br />
<br />
; checkSigma<br />
: Checks whether event space is actually a Sigma field over the sample space.<br />
<br />
; smplSetUnion<br />
: Collapses a list of samples down to the maximally reduced set, which still composes a proper union of the input.<br />
<br />
; smplSetInt<br />
: Reduces a list of samples to a single sample representing their intersection.<br />
<br />
== Usage ==<br />
For more extensive usage examples, see the `test/Test.hs` file.<br />
=== Construction of a probability space representing a fair coin ===<br />
fairCoin = ProbSpace<br />
[point 0.0, point 1.0]<br />
[Measure ( [Empty]) 0, Measure ( [point 0]) 0.5<br />
, Measure ( [point 1]) 0.5, Measure ( [point 0, point 1]) 1.0]<br />
=== Testing the probability space defined, above ===<br />
checkProbMeas fairCoin<br />
<br />
== Documentation ==<br />
The documentation for this library is generated, via Haddock.<br />
<br />
== Related work ==<br />
I suspect a potential symbiosis between this library and [[Probabilistic_Functional_Programming | Probabilistic Functional Programming]]<br />
<br />
== Community ==<br />
;[http://randprocnotes.wordpress.com/ RandProcNotes]<br />
:Blog dedicated to the `RandProc` Haskell library<br />
;[http://trac.haskell.org/RandProc/ Bug Tracker]<br />
:Bug tracker for the `RandProc` Haskell library<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]<br />
[[Category:Mathematics]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Random_Processes&diff=40678Random Processes2011-06-27T19:32:21Z<p>Dbanas: Added blog link.</p>
<hr />
<div>[http://hackage.haskell.org/package/randproc RandProc] is a Haskell library, which defines and supports certain data structures that are convenient when working with random processes in a mathematically rigorous fashion.<br />
<br />
The concepts embedded in RandProc come from the text I used in my graduate stochastic processes course:<br />
<br />
Robert M. Gray, Lee D. Davisson; ''Random Processes - a Mathematical Approach for Engineers''; Prentice-Hall Information and System Sciences Series, Thomas Kailath, Series Editor.<br />
<br />
''Authors: [mailto:dbanas@banasfamily.net David Banas]''<br />
<br />
== Installation ==<br />
<br />
Download the `randproc` package:<br />
<br />
$ cabal install randproc<br />
<br />
and import it:<br />
<br />
import Data.RandProc<br />
<br />
== Description ==<br />
<br />
=== Underlying concepts ===<br />
As per the reference text, a ''probability space'' is taken to be composed of:<br />
<br />
* an '''abstract space''' of samples,<br />
* an '''event space''', which must be a sigma field over the abstract sample space, and<br />
* a '''probability measure''' over the event space.<br />
<br />
In the code, the ''event space'' and ''probability measure'' are combined, in order to keep the code concise.<br />
<br />
=== Public interface ===<br />
==== New data types ====<br />
The code defines an abstract data type, ''Sample'', as follows:<br />
data Sample = Point Double<br />
| Range (Double, Double)<br />
| Empty<br />
| Full<br />
deriving (Eq, Show)<br />
However, this type is not exported in the public interface of the `RandProc` module. Instead, helper functions ''point'' and ''range'' are provided, as alternatives, in order to protect against future implementation changes.<br />
<br />
''Note) There is, currently, a single exception to the above. The ''Empty'' value constructor ''is'' exported, as it is currently necessary. However, this is really just a hack designed to put off the task of making the support functions more intelligent, with regards to their handling of empty sample sets.''<br />
<br />
An event is defined in the code as simply an alias for a list of samples:<br />
type Event = [Sample]<br />
<br />
And a measure just attaches a probability of occurrence to an event:<br />
data Measure = Measure {<br />
event :: Event<br />
,prob :: Double<br />
}<br />
deriving (Eq, Ord, Show)<br />
<br />
==== Supporting functions ====<br />
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.<br />
<br />
; checkProbMeas<br />
: Checks a value of type 'ProbSpace' for correctness, and returns a value of type 'TestResult'.<br />
<br />
; checkSigma<br />
: Checks whether event space is actually a Sigma field over the sample space.<br />
<br />
; smplSetUnion<br />
: Collapses a list of samples down to the maximally reduced set, which still composes a proper union of the input.<br />
<br />
; smplSetInt<br />
: Reduces a list of samples to a single sample representing their intersection.<br />
<br />
== Usage ==<br />
For more extensive usage examples, see the `test/Test.hs` file.<br />
=== Construction of a probability space representing a fair coin ===<br />
fairCoin = ProbSpace<br />
[point 0.0, point 1.0]<br />
[Measure ( [Empty]) 0, Measure ( [point 0]) 0.5<br />
, Measure ( [point 1]) 0.5, Measure ( [point 0, point 1]) 1.0]<br />
=== Testing the probability space defined, above ===<br />
checkProbMeas fairCoin<br />
<br />
== Documentation ==<br />
The documentation for this library is generated, via Haddock.<br />
<br />
== Related work ==<br />
I suspect a potential symbiosis between this library and [[Probabilistic_Functional_Programming | Probabilistic Functional Programming]]<br />
<br />
== Community ==<br />
;[http://randprocnotes.wordpress.com/ RandProcNotes]<br />
:Blog dedicated to the `RandProc` Haskell library<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]<br />
[[Category:Mathematics]]</div>Dbanashttps://wiki.haskell.org/index.php?title=Random_Processes&diff=40600Random Processes2011-06-22T23:04:11Z<p>Dbanas: Initial creation.</p>
<hr />
<div>[http://hackage.haskell.org/package/randproc RandProc] is a Haskell library, which defines and supports certain data structures that are convenient when working with random processes in a mathematically rigorous fashion.<br />
<br />
The concepts embedded in RandProc come from the text I used in my graduate stochastic processes course:<br />
<br />
Robert M. Gray, Lee D. Davisson; ''Random Processes - a Mathematical Approach for Engineers''; Prentice-Hall Information and System Sciences Series, Thomas Kailath, Series Editor.<br />
<br />
''Authors: [mailto:dbanas@banasfamily.net David Banas]''<br />
<br />
== Installation ==<br />
<br />
Download the `randproc` package:<br />
<br />
$ cabal install randproc<br />
<br />
and import it:<br />
<br />
import Data.RandProc<br />
<br />
== Description ==<br />
<br />
=== Underlying concepts ===<br />
As per the reference text, a ''probability space'' is taken to be composed of:<br />
<br />
* an '''abstract space''' of samples,<br />
* an '''event space''', which must be a sigma field over the abstract sample space, and<br />
* a '''probability measure''' over the event space.<br />
<br />
In the code, the ''event space'' and ''probability measure'' are combined, in order to keep the code concise.<br />
<br />
=== Public interface ===<br />
==== New data types ====<br />
The code defines an abstract data type, ''Sample'', as follows:<br />
data Sample = Point Double<br />
| Range (Double, Double)<br />
| Empty<br />
| Full<br />
deriving (Eq, Show)<br />
However, this type is not exported in the public interface of the `RandProc` module. Instead, helper functions ''point'' and ''range'' are provided, as alternatives, in order to protect against future implementation changes.<br />
<br />
''Note) There is, currently, a single exception to the above. The ''Empty'' value constructor ''is'' exported, as it is currently necessary. However, this is really just a hack designed to put off the task of making the support functions more intelligent, with regards to their handling of empty sample sets.''<br />
<br />
An event is defined in the code as simply an alias for a list of samples:<br />
type Event = [Sample]<br />
<br />
And a measure just attaches a probability of occurrence to an event:<br />
data Measure = Measure {<br />
event :: Event<br />
,prob :: Double<br />
}<br />
deriving (Eq, Ord, Show)<br />
<br />
==== Supporting functions ====<br />
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.<br />
<br />
; checkProbMeas<br />
: Checks a value of type 'ProbSpace' for correctness, and returns a value of type 'TestResult'.<br />
<br />
; checkSigma<br />
: Checks whether event space is actually a Sigma field over the sample space.<br />
<br />
; smplSetUnion<br />
: Collapses a list of samples down to the maximally reduced set, which still composes a proper union of the input.<br />
<br />
; smplSetInt<br />
: Reduces a list of samples to a single sample representing their intersection.<br />
<br />
== Usage ==<br />
For more extensive usage examples, see the `test/Test.hs` file.<br />
=== Construction of a probability space representing a fair coin ===<br />
fairCoin = ProbSpace<br />
[point 0.0, point 1.0]<br />
[Measure ( [Empty]) 0, Measure ( [point 0]) 0.5<br />
, Measure ( [point 1]) 0.5, Measure ( [point 0, point 1]) 1.0]<br />
=== Testing the probability space defined, above ===<br />
checkProbMeas fairCoin<br />
<br />
== Documentation ==<br />
The documentation for this library is generated, via Haddock.<br />
<br />
== Related work ==<br />
I suspect a potential symbiosis between this library and [[Probabilistic_Functional_Programming | Probabilistic Functional Programming]]<br />
<br />
== Community ==<br />
Coming soon.<br />
<br />
[[Category:Libraries]]<br />
[[Category:Packages]]<br />
[[Category:Mathematics]]</div>Dbanas