Giter Site home page Giter Site logo

pyami's Introduction

pre-commit.ci status

PyIBIS-AMI

PyIBIS-AMI is a Python package of tools useful in the development and testing of IBIS-AMI models. This library is used in PyBERT and also provides two command line applications.

It can be installed via: pip install PyIBIS-AMI.

View API/Developer's Documentation.

Command Line Tools

AMI Config

ami_config -h
Usage: ami_config [OPTIONS] PY_FILE

  Configure IBIS-AMI model C++ source code, IBIS model, and AMI file.

  py_file: name of model configuration file (*.py)

Options:
  -h, --help  Show this message and exit.

Run Tests

run_tests -h
Usage: run_tests [OPTIONS] [TESTS]...

  Run a series of tests on a AMI model DLL file.

  If no tests are specified on the command line, run all tests found in
  `test_dir'. (See `-t' option.)

  usage: %prog [options] [test1 [test2 ...]]

  Tests are written in the EmPy templating language, and produce XML output.
  (See the examples provided in the `examples' directory of the `pyibisami'
  Python package.)

  Test results should be viewed by loading the XML output file into a Web
  browser. By default, the XML output file refers to the supplied XSLT file,
  `test_results.xsl'. It is possible that you may need to copy this file
  from the pyibisami package directory to your local working directory, in
  order to avoid file loading errors in your Web browser.

Options:
  -t, --test_dir PATH  Sets the name of the directory from which tests are
                       taken.
  -m, --model PATH     Sets the AMI model DLL file name.
  -p, --params TEXT    List of lists of model configurations. Format:
                       <filename> or [(name, [(label, ({AMI params., in
                       "key:val" format},{Model params., in "key:val"
                       format})), ...]), ...]
  -x, --xml_file PATH  Sets the name of the XML output file. You should load
                       this file into your Web browser after the program
                       completion.
  -r, --ref_dir PATH   Sets the name of the directory from which reference
                       waveforms are taken.
  -o, --out_dir PATH   Sets the name of the directory in which to place the
                       results.
  -v, --version TEXT   Show program version info and exit.
  -h, --help           Show this message and exit.

pyami's People

Contributors

capn-freako avatar jdpatt avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyami's Issues

Integers in AMI files, but in scientific notation

In the AMI file, I have a parameter described as:

               (Ignore_Bits
			(Usage Info)
			(Type Integer)
			(Default 1e5)
         		(Description "Ignore first few bits")
		)

During the evaluation of the integer, the code fails with:

            elif param_type == "Integer":
                try:
                    self._value = int(value_str)
                except (ValueError, TypeError):
                    raise AMIParamError("Couldn't read integer from '{}'.\n".format(value_str))

I don't know if this is an AMI specification violation, but the following fixes the problem:

            elif param_type == "Integer":
                try:
                    self._value = int(eval(value_str))
                except (ValueError, TypeError):
                    raise AMIParamError("Couldn't read integer from '{}'.\n".format(value_str))

Py3K support missing

It looks like there is no support for Python 3 and moreover this fact seems to be undocumented.

C:\Users\xxxxxxxxxxx\Programme\WinPython-64bit-3.4.4.2\scripts>pip3 install PyAMI
Collecting PyAMI
  Using cached pyAMI-4.1.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\XXXXXX~1\AppData\Local\Temp\pip-build-x_1uco3u\PyAMI\setup.
py", line 87
        print __doc__
                    ^
    SyntaxError: Missing parentheses in call to 'print'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\XXXXXX~1\AppData\Local\Temp\pip-build-x_1uco3u\PyAMI\

Access violation error

I'm getting the following error when I try to initialize.
I've seen this with a few ami dll's:

myModel.initialize(initData)

---------------------------------------------------------------------------
WindowsError                              Traceback (most recent call last)
<ipython-input-5-2f0882b1047d> in <module>()
----> 1 myModel.initialize(initData)

C:\Users\marnj\AppData\Local\Continuum\Anaconda2\lib\site-packages\pyibisami\amimodel.pyc in initialize(self, init_object)
    287                 byref(self._ami_params_out),
    288                 byref(self._ami_mem_handle),
--> 289                 byref(self._msg)
    290             )
    291         except:

WindowsError: exception: access violation reading 0x0000000000000000```

I'm on win-64, python 2.7 64 bit & pyibis-ami 1.1.6

Tx_Jitter keyword in reserved parameters not recognized

I have a parameter that fails in the ami file that looks like this:

      		(Tx_Jitter
			(Usage Info)
			(Type Float)
			(DjRj 0.0 0.4e-12 0.35e-12)
         		(Description "Tx jitter")
		) | Rx_Jitter lumped into Tx-jitter 

My cursory examination of the ami specification indicates that Tx_Jitter is a valid parameter name, but I don't see it in the reserved parameters list.

Parsing issue for Matlab generated IBIS-AMI

I created an IBIS-AMI file in Matlab's Serdes Toolbox just to play around with some modifications but PyBERT fails to parse the .ami file.
The original error message in PyBERT is "list index out of range", triggered by https://github.com/capn-freako/PyAMI/blob/master/pyibisami/ami_parse.py#L73, as the returned dictionary is empty.

It happens with the following file.

(serdes_tx
  (Reserved_Parameters
    (AMI_Version (Usage Info) (Type String) (Value "6.1")
      (Description "This model supports IBIS 6.1. Results may not be valid in earlier versions.")
    )
    (Init_Returns_Impulse (Usage Info) (Type Boolean) (Value True)
      (Description "When True, this model supports AMI_Init (statistical) simulation.")
    )
    (GetWave_Exists (Usage Info) (Type Boolean) (Value True)
      (Description "When True, this model supports AMI_GetWave (time domain) simulation.")
    )
    (Max_Init_Aggressors (Usage Info) (Type Integer) (Value 6)
      (Description "The number of crosstalk aggressors supported by this model.")
    )
    (Modulation (Usage In) (Type String) (Value "NRZ")
      (Description "Specifies whether the model will operate as NRZ or PAM4.")
    )
  )
  (Model_Specific
    (FFE
      (Mode (Usage In) (Type Integer) (List 1 0) (Default 1)
        (List_Tip "fixed" "off")
        (Description "FFE Mode: 0=off, 1=fixed")
      )
      (TapWeights
        (-1 (Usage In) (Type Tap) (Range 0 -2 2) (Default 0)
          (Description "tap -1")
        )
        (0 (Usage In) (Type Tap) (Range 1 -2 2) (Default 1)
          (Description "tap 0")
        )
        (1 (Usage In) (Type Tap) (Range 0 -2 2) (Default 0)
          (Description "tap 1")
        )
        (2 (Usage In) (Type Tap) (Range 0 -2 2) (Default 0)
          (Description "tap 2")
        )
        (3 (Usage In) (Type Tap) (Range 0 -2 2) (Default 0)
          (Description "tap 3")
        )
      )
    )
  )
)

The parser error shows:
Expected ) at 18:2 in (Model_Specific

However, all parentheses are matched, why I don't understand what's wrong.

The original ibis-ami model is attached, including the serdes designer definition file (If you have a license).

Unfortunately I've no experience with parsec, or parsing in general, otherwise I could give more sophisticated input.

serdes.zip

[Model] keyword parsing error.

The following IBIS model syntax is breaking the current parser:

[Model] Amethyst_XFI_RX
| differential model

I suspect the breakage is being caused by the second line being a comment.

Add Reserved parameters to model initializer.

Currently, when we initialize an instance of AMIModel, the AMIModelInitializer instance that we send in contains only type In/InOut parameters from the Model Specific set.
A new function being added to the AMIModel class: get_responses(), needs to know the value of the Reserved parameter: Ignore_Bits, so that it allows the DFE to adapt for the proper time before measuring the step response from GetWave().
It's quite possible that other reserved parameters will be needed by future additions to the AMIModel class.
So, we should include all reserved parameters in the AMIModelInitializer instance we send into the model's initialize() function.
And this will also require modifying the design of the parser.AMIParamConfigurator class, to include the Reserved parameters in the set that it extracts from the AMI file.

So, the following three tasks are required:

  1. ==> Modify the ami.parser.AMIParamConfigurator class, to extract the Reserved parameters, as well as the In/InOut Model Specific parameters, placing these new parameters in a dictionary called: info_ami_params.
  2. ==> Add a new optional argument to the ami.model.AMIModelInitializer class constructor: info_params, to accept this new (optional) dictionary of Reserved, type Info parameters, stashing them for use in model initialization, in a similarly named instance variable.
  3. ==> Modify the ami.model.AMIModel class constructor to make use of this new instance variable, stashing the Reserved parameters in the model, for future accessing by, for instance, the get_responses() function.

Add support for power/ground clamps in Model class.

In the Model class, defined in the ibis_model.py file, there is currently no support for the following IBIS keywords:

  • [Power Clamp]
  • [GND Clamp]

==> Add support for these keywords, using the processing of [Pullup]/[Pulldown] as a reference, and add a Zin trait, which is derived from the clamp data similarly to how Zout is derived from the pull-up/down data.

question about the loop of AMI_getwave()

Hi David,

Why there is a while loop in the getWave function?

Update:
Test with a 64-bit pattern without while loop. works well.
But! If run with a long PRBS pattern , DLL file may cause memory issue.
Using while loop can avoid the python.exe crash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.