PyIBIS-AMI 7.2.7__tar.gz → 7.2.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. {pyibis_ami-7.2.7/src/pyibis_ami.egg-info → pyibis_ami-7.2.9}/PKG-INFO +25 -25
  2. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/README.md +23 -24
  3. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/pyproject.toml +2 -2
  4. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9/src/pyibis_ami.egg-info}/PKG-INFO +25 -25
  5. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibis_ami.egg-info/requires.txt +1 -0
  6. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/IBIS_AMI_Tester.ipynb +9 -7
  7. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ami/model.py +14 -4
  8. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ami/parser.py +16 -6
  9. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ibis/model.py +6 -1
  10. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/tools/run_notebook.py +5 -2
  11. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/LICENSE +0 -0
  12. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/MANIFEST.in +0 -0
  13. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/docs/source/ami.rst +0 -0
  14. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/docs/source/conf.py +0 -0
  15. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/docs/source/ibis.rst +0 -0
  16. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/docs/source/index.rst +0 -0
  17. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/docs/source/install.rst +0 -0
  18. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/docs/source/modules.rst +0 -0
  19. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/docs/source/tools.rst +0 -0
  20. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/all_taps.run +0 -0
  21. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/bandwidth.run +0 -0
  22. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/dummy.em +0 -0
  23. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/examples.md +0 -0
  24. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/freq_resp.em +0 -0
  25. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/impulse.em +0 -0
  26. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/impulse_response_8ma.txt +0 -0
  27. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/mode.run +0 -0
  28. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/stratix4_ami_tx_runs/all_taps.run +0 -0
  29. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/stratix4_ami_tx_runs/test_results.xml +0 -0
  30. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/examples/test_results/test_results.xsl +0 -0
  31. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/setup.cfg +0 -0
  32. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibis_ami.egg-info/SOURCES.txt +0 -0
  33. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibis_ami.egg-info/dependency_links.txt +0 -0
  34. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibis_ami.egg-info/entry_points.txt +0 -0
  35. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibis_ami.egg-info/top_level.txt +0 -0
  36. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/IBIS_AMI_Checker.ipynb +0 -0
  37. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/__init__.py +0 -0
  38. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/__main__.py +0 -0
  39. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ami/__init__.py +0 -0
  40. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ami/config.py +0 -0
  41. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ami/generic.ami.em +0 -0
  42. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ami/generic.ibs.em +0 -0
  43. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ami/parameter.py +0 -0
  44. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ami/reserved_parameter_names.py +0 -0
  45. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/common.py +0 -0
  46. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ibis/__init__.py +0 -0
  47. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ibis/file.py +0 -0
  48. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/ibis/parser.py +0 -0
  49. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/tools/__init__.py +0 -0
  50. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/tools/run_tests.py +0 -0
  51. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/src/pyibisami/tools/test_results.xsl +0 -0
  52. {pyibis_ami-7.2.7 → pyibis_ami-7.2.9}/tests/test_run_tests.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyibis-ami
3
- Version: 7.2.7
3
+ Version: 7.2.9
4
4
  Summary: Facilitates working directly with IBIS-AMI DLLs from the Python command prompt.
5
5
  Author-email: David Banas <capn.freako@gmail.com>
6
6
  Project-URL: Documentation, https://pyibis-ami.readthedocs.io/en/latest/
@@ -27,6 +27,7 @@ Requires-Dist: chaco>=6.0.0
27
27
  Requires-Dist: click>=8.1.3
28
28
  Requires-Dist: empy>=3.3.4
29
29
  Requires-Dist: importlib_resources
30
+ Requires-Dist: jupyter
30
31
  Requires-Dist: matplotlib>=3.6.1
31
32
  Requires-Dist: numpy<1.27,>=1.26
32
33
  Requires-Dist: papermill
@@ -39,7 +40,7 @@ Dynamic: license-file
39
40
  # PyIBIS-AMI
40
41
 
41
42
  PyIBIS-AMI is a Python package of tools useful in the development and testing of IBIS-AMI models.
42
- This library is used in [PyBERT](https://github.com/capn-freako/PyBERT) and also provides two
43
+ This library is used in [PyBERT](https://github.com/capn-freako/PyBERT) and also provides three
43
44
  command line applications.
44
45
 
45
46
  It can be installed via: `pip install PyIBIS-AMI`.
@@ -48,9 +49,23 @@ It can be installed via: `pip install PyIBIS-AMI`.
48
49
 
49
50
  ## Command Line Tools
50
51
 
51
- ### Run IBIS-AMI Model Testing Notebook
52
+ ### AMI Config
53
+
54
+ ```
55
+ ami_config -h
56
+ Usage: ami_config [OPTIONS] PY_FILE
57
+
58
+ Configure IBIS-AMI model C++ source code, IBIS model, and AMI file.
59
+
60
+ py_file: name of model configuration file (*.py)
61
+
62
+ Options:
63
+ -h, --help Show this message and exit.
64
+ ```
65
+
66
+ ### Run (New) IBIS-AMI Model Testing Notebook
52
67
 
53
- ```shell
68
+ ```
54
69
  $ run-notebook -h
55
70
  Usage: run-notebook [OPTIONS] IBIS_FILE BIT_RATE
56
71
 
@@ -76,46 +91,31 @@ Options:
76
91
  -h, --help Show this message and exit.
77
92
  ```
78
93
 
79
- ### AMI Config
80
-
81
- ```shell
82
- ami_config -h
83
- Usage: ami_config [OPTIONS] PY_FILE
84
-
85
- Configure IBIS-AMI model C++ source code, IBIS model, and AMI file.
86
-
87
- py_file: name of model configuration file (*.py)
94
+ ### Run (Old Style) Tests
88
95
 
89
- Options:
90
- -h, --help Show this message and exit.
91
96
  ```
92
-
93
- ### Run Tests
94
-
95
- ```shell
96
97
  run_tests -h
97
98
  Usage: run_tests [OPTIONS] [TESTS]...
98
99
 
99
100
  Run a series of tests on a AMI model DLL file.
100
101
 
101
102
  If no tests are specified on the command line, run all tests found in
102
- `test_dir'. (See `-t' option.)
103
+ `test_dir`. (See `-t` option.)
103
104
 
104
105
  usage: %prog [options] [test1 [test2 ...]]
105
106
 
106
107
  Tests are written in the EmPy templating language, and produce XML output.
107
- (See the examples provided in the `examples' directory of the `pyibisami'
108
+ (See the examples provided in the `examples` directory of the `pyibisami`
108
109
  Python package.)
109
110
 
110
111
  Test results should be viewed by loading the XML output file into a Web
111
112
  browser. By default, the XML output file refers to the supplied XSLT file,
112
- `test_results.xsl'. It is possible that you may need to copy this file
113
+ `test_results.xsl`. It is possible that you may need to copy this file
113
114
  from the pyibisami package directory to your local working directory, in
114
115
  order to avoid file loading errors in your Web browser.
115
116
 
116
117
  Options:
117
- -t, --test_dir PATH Sets the name of the directory from which tests are
118
- taken.
118
+ -t, --test_dir PATH Sets the name of the directory from which tests are taken.
119
119
  -m, --model PATH Sets the AMI model DLL file name.
120
120
  -p, --params TEXT List of lists of model configurations. Format:
121
121
  <filename> or [(name, [(label, ({AMI params., in
@@ -130,4 +130,4 @@ Options:
130
130
  results.
131
131
  -v, --version TEXT Show program version info and exit.
132
132
  -h, --help Show this message and exit.
133
- ```
133
+ ```
@@ -3,7 +3,7 @@
3
3
  # PyIBIS-AMI
4
4
 
5
5
  PyIBIS-AMI is a Python package of tools useful in the development and testing of IBIS-AMI models.
6
- This library is used in [PyBERT](https://github.com/capn-freako/PyBERT) and also provides two
6
+ This library is used in [PyBERT](https://github.com/capn-freako/PyBERT) and also provides three
7
7
  command line applications.
8
8
 
9
9
  It can be installed via: `pip install PyIBIS-AMI`.
@@ -12,9 +12,23 @@ It can be installed via: `pip install PyIBIS-AMI`.
12
12
 
13
13
  ## Command Line Tools
14
14
 
15
- ### Run IBIS-AMI Model Testing Notebook
15
+ ### AMI Config
16
+
17
+ ```
18
+ ami_config -h
19
+ Usage: ami_config [OPTIONS] PY_FILE
20
+
21
+ Configure IBIS-AMI model C++ source code, IBIS model, and AMI file.
22
+
23
+ py_file: name of model configuration file (*.py)
24
+
25
+ Options:
26
+ -h, --help Show this message and exit.
27
+ ```
28
+
29
+ ### Run (New) IBIS-AMI Model Testing Notebook
16
30
 
17
- ```shell
31
+ ```
18
32
  $ run-notebook -h
19
33
  Usage: run-notebook [OPTIONS] IBIS_FILE BIT_RATE
20
34
 
@@ -40,46 +54,31 @@ Options:
40
54
  -h, --help Show this message and exit.
41
55
  ```
42
56
 
43
- ### AMI Config
44
-
45
- ```shell
46
- ami_config -h
47
- Usage: ami_config [OPTIONS] PY_FILE
48
-
49
- Configure IBIS-AMI model C++ source code, IBIS model, and AMI file.
50
-
51
- py_file: name of model configuration file (*.py)
57
+ ### Run (Old Style) Tests
52
58
 
53
- Options:
54
- -h, --help Show this message and exit.
55
59
  ```
56
-
57
- ### Run Tests
58
-
59
- ```shell
60
60
  run_tests -h
61
61
  Usage: run_tests [OPTIONS] [TESTS]...
62
62
 
63
63
  Run a series of tests on a AMI model DLL file.
64
64
 
65
65
  If no tests are specified on the command line, run all tests found in
66
- `test_dir'. (See `-t' option.)
66
+ `test_dir`. (See `-t` option.)
67
67
 
68
68
  usage: %prog [options] [test1 [test2 ...]]
69
69
 
70
70
  Tests are written in the EmPy templating language, and produce XML output.
71
- (See the examples provided in the `examples' directory of the `pyibisami'
71
+ (See the examples provided in the `examples` directory of the `pyibisami`
72
72
  Python package.)
73
73
 
74
74
  Test results should be viewed by loading the XML output file into a Web
75
75
  browser. By default, the XML output file refers to the supplied XSLT file,
76
- `test_results.xsl'. It is possible that you may need to copy this file
76
+ `test_results.xsl`. It is possible that you may need to copy this file
77
77
  from the pyibisami package directory to your local working directory, in
78
78
  order to avoid file loading errors in your Web browser.
79
79
 
80
80
  Options:
81
- -t, --test_dir PATH Sets the name of the directory from which tests are
82
- taken.
81
+ -t, --test_dir PATH Sets the name of the directory from which tests are taken.
83
82
  -m, --model PATH Sets the AMI model DLL file name.
84
83
  -p, --params TEXT List of lists of model configurations. Format:
85
84
  <filename> or [(name, [(label, ({AMI params., in
@@ -94,4 +93,4 @@ Options:
94
93
  results.
95
94
  -v, --version TEXT Show program version info and exit.
96
95
  -h, --help Show this message and exit.
97
- ```
96
+ ```
@@ -5,17 +5,17 @@ build-backend = "setuptools.build_meta"
5
5
  [project]
6
6
  name = "pyibis-ami"
7
7
  description = "Facilitates working directly with IBIS-AMI DLLs from the Python command prompt."
8
- version = "7.2.7"
8
+ version = "7.2.9"
9
9
  authors = [ {name = "David Banas", email = "capn.freako@gmail.com"}
10
10
  ]
11
11
  readme = "README.md"
12
12
  requires-python = ">=3.10,<3.13"
13
- # license = "BSD-3-Clause"
14
13
  dependencies = [
15
14
  "chaco>=6.0.0",
16
15
  "click>=8.1.3",
17
16
  "empy>=3.3.4",
18
17
  "importlib_resources",
18
+ "jupyter",
19
19
  "matplotlib>=3.6.1",
20
20
  "numpy>=1.26,<1.27",
21
21
  "papermill",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyibis-ami
3
- Version: 7.2.7
3
+ Version: 7.2.9
4
4
  Summary: Facilitates working directly with IBIS-AMI DLLs from the Python command prompt.
5
5
  Author-email: David Banas <capn.freako@gmail.com>
6
6
  Project-URL: Documentation, https://pyibis-ami.readthedocs.io/en/latest/
@@ -27,6 +27,7 @@ Requires-Dist: chaco>=6.0.0
27
27
  Requires-Dist: click>=8.1.3
28
28
  Requires-Dist: empy>=3.3.4
29
29
  Requires-Dist: importlib_resources
30
+ Requires-Dist: jupyter
30
31
  Requires-Dist: matplotlib>=3.6.1
31
32
  Requires-Dist: numpy<1.27,>=1.26
32
33
  Requires-Dist: papermill
@@ -39,7 +40,7 @@ Dynamic: license-file
39
40
  # PyIBIS-AMI
40
41
 
41
42
  PyIBIS-AMI is a Python package of tools useful in the development and testing of IBIS-AMI models.
42
- This library is used in [PyBERT](https://github.com/capn-freako/PyBERT) and also provides two
43
+ This library is used in [PyBERT](https://github.com/capn-freako/PyBERT) and also provides three
43
44
  command line applications.
44
45
 
45
46
  It can be installed via: `pip install PyIBIS-AMI`.
@@ -48,9 +49,23 @@ It can be installed via: `pip install PyIBIS-AMI`.
48
49
 
49
50
  ## Command Line Tools
50
51
 
51
- ### Run IBIS-AMI Model Testing Notebook
52
+ ### AMI Config
53
+
54
+ ```
55
+ ami_config -h
56
+ Usage: ami_config [OPTIONS] PY_FILE
57
+
58
+ Configure IBIS-AMI model C++ source code, IBIS model, and AMI file.
59
+
60
+ py_file: name of model configuration file (*.py)
61
+
62
+ Options:
63
+ -h, --help Show this message and exit.
64
+ ```
65
+
66
+ ### Run (New) IBIS-AMI Model Testing Notebook
52
67
 
53
- ```shell
68
+ ```
54
69
  $ run-notebook -h
55
70
  Usage: run-notebook [OPTIONS] IBIS_FILE BIT_RATE
56
71
 
@@ -76,46 +91,31 @@ Options:
76
91
  -h, --help Show this message and exit.
77
92
  ```
78
93
 
79
- ### AMI Config
80
-
81
- ```shell
82
- ami_config -h
83
- Usage: ami_config [OPTIONS] PY_FILE
84
-
85
- Configure IBIS-AMI model C++ source code, IBIS model, and AMI file.
86
-
87
- py_file: name of model configuration file (*.py)
94
+ ### Run (Old Style) Tests
88
95
 
89
- Options:
90
- -h, --help Show this message and exit.
91
96
  ```
92
-
93
- ### Run Tests
94
-
95
- ```shell
96
97
  run_tests -h
97
98
  Usage: run_tests [OPTIONS] [TESTS]...
98
99
 
99
100
  Run a series of tests on a AMI model DLL file.
100
101
 
101
102
  If no tests are specified on the command line, run all tests found in
102
- `test_dir'. (See `-t' option.)
103
+ `test_dir`. (See `-t` option.)
103
104
 
104
105
  usage: %prog [options] [test1 [test2 ...]]
105
106
 
106
107
  Tests are written in the EmPy templating language, and produce XML output.
107
- (See the examples provided in the `examples' directory of the `pyibisami'
108
+ (See the examples provided in the `examples` directory of the `pyibisami`
108
109
  Python package.)
109
110
 
110
111
  Test results should be viewed by loading the XML output file into a Web
111
112
  browser. By default, the XML output file refers to the supplied XSLT file,
112
- `test_results.xsl'. It is possible that you may need to copy this file
113
+ `test_results.xsl`. It is possible that you may need to copy this file
113
114
  from the pyibisami package directory to your local working directory, in
114
115
  order to avoid file loading errors in your Web browser.
115
116
 
116
117
  Options:
117
- -t, --test_dir PATH Sets the name of the directory from which tests are
118
- taken.
118
+ -t, --test_dir PATH Sets the name of the directory from which tests are taken.
119
119
  -m, --model PATH Sets the AMI model DLL file name.
120
120
  -p, --params TEXT List of lists of model configurations. Format:
121
121
  <filename> or [(name, [(label, ({AMI params., in
@@ -130,4 +130,4 @@ Options:
130
130
  results.
131
131
  -v, --version TEXT Show program version info and exit.
132
132
  -h, --help Show this message and exit.
133
- ```
133
+ ```
@@ -2,6 +2,7 @@ chaco>=6.0.0
2
2
  click>=8.1.3
3
3
  empy>=3.3.4
4
4
  importlib_resources
5
+ jupyter
5
6
  matplotlib>=3.6.1
6
7
  numpy<1.27,>=1.26
7
8
  papermill
@@ -148,14 +148,14 @@
148
148
  "\n",
149
149
  "# Changing these will only have an effect if you are running this notebook manually.\n",
150
150
  "\n",
151
- "ibis_dir = \"/Users/davibana/prj/IBISAMI/celestica\"\n",
152
- "ibis_file = \"rx.ibs\" # IBIS-AMI model to test.\n",
153
- "# params = \"test_runs/rx/ctle_1p5.run\" # Directory or file containing AMI parameter sweep definitions.\n",
154
- "params = \"debug.run\" # Directory or file containing AMI parameter sweep definitions.\n",
151
+ "ibis_dir = \".\"\n",
152
+ "ibis_file = \"rx.ibs\" # IBIS-AMI model to test.\n",
153
+ "params = \"rx_test.run\" # Directory or file containing AMI parameter sweep definitions.\n",
155
154
  "is_tx = False # True for Tx; False for Rx.\n",
156
155
  "debug = False # Set to 'True' if you're having trouble and need some debugging info.\n",
157
156
  "bit_rate = 53.125e9\n",
158
157
  "nspui = 32 # vector samples per unit interval\n",
158
+ "no_nspui_swp = False # Skip samples per UI sweeping when true.\n",
159
159
  "nbits = 20 # number of bits for AMI_Init() exercising\n",
160
160
  "plot_t_max = 0.5e-9 # maximum x-axis extent for time domain plots (s)\n",
161
161
  "f_max = 40e9 # maximum frequency (Hz)\n",
@@ -1177,7 +1177,8 @@
1177
1177
  }
1178
1178
  ],
1179
1179
  "source": [
1180
- "samples_per_bit()\n"
1180
+ "if not no_nspui_swp:\n",
1181
+ " samples_per_bit()\n"
1181
1182
  ]
1182
1183
  },
1183
1184
  {
@@ -1388,7 +1389,8 @@
1388
1389
  }
1389
1390
  ],
1390
1391
  "source": [
1391
- "samples_per_bit()\n"
1392
+ "if not no_nspui_swp:\n",
1393
+ " samples_per_bit()\n"
1392
1394
  ]
1393
1395
  },
1394
1396
  {
@@ -1449,7 +1451,7 @@
1449
1451
  "name": "python",
1450
1452
  "nbconvert_exporter": "python",
1451
1453
  "pygments_lexer": "ipython3",
1452
- "version": "3.10.16"
1454
+ "version": "3.11.13"
1453
1455
  }
1454
1456
  },
1455
1457
  "nbformat": 4,
@@ -332,16 +332,26 @@ class AMIModel: # pylint: disable=too-many-instance-attributes
332
332
  )
333
333
 
334
334
  # Construct the AMI parameters string.
335
- def sexpr(pname, pval):
336
- """Create an S-expression from a parameter name/value pair, calling
337
- recursively as needed to elaborate sub-parameter dictionaries."""
335
+ def sexpr(pname: str, pval: Any) -> str:
336
+ """
337
+ Create an S-expression from a parameter name/value pair, calling
338
+ recursively as needed to elaborate sub-parameter dictionaries.
339
+
340
+ Args:
341
+ pname: Parameter name.
342
+ pval: Parameter value.
343
+
344
+ Returns:
345
+ A string containing the S-expression constructed.
346
+ """
338
347
  if isinstance(pval, str):
339
348
  return f'({pname} "{pval}")'
340
349
  if isinstance(pval, dict):
341
350
  subs = []
342
351
  for sname in pval:
343
352
  subs.append(sexpr(sname, pval[sname]))
344
- return sexpr(pname, " ".join(subs))
353
+ # return sexpr(pname, " ".join(subs))
354
+ return f"({pname} {' '.join(subs)})"
345
355
  return f"({pname} {pval})"
346
356
 
347
357
  ami_params_in = f"({init_object.ami_params['root_name']} "
@@ -102,6 +102,12 @@ class AMIParamConfigurator(HasTraits):
102
102
  description,
103
103
  reserved_param_dict,
104
104
  model_specific_dict) = parse_ami_file_contents(ami_file_contents_str)
105
+ if err_str:
106
+ raise RuntimeError(
107
+ "\n".join([
108
+ "AMI parsing error:",
109
+ err_str
110
+ ]))
105
111
  if not reserved_param_dict:
106
112
  raise ValueError(
107
113
  "\n".join([
@@ -338,10 +344,13 @@ def lexeme(p):
338
344
  def int2tap(x):
339
345
  """Convert integer to tap position."""
340
346
  x = x.strip()
341
- if x[0] == "-":
342
- res = "pre" + x[1:]
343
- else:
344
- res = "post" + x
347
+ match x[0]:
348
+ case "-":
349
+ res = "pre" + x[1:]
350
+ case "+":
351
+ res = "post" + x[1:]
352
+ case _:
353
+ res = "post" + x
345
354
  return res
346
355
 
347
356
 
@@ -350,7 +359,8 @@ rparen = lexeme(string(")"))
350
359
  number = lexeme(regex(r"[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?"))
351
360
  integ = lexeme(regex(r"[-+]?[0-9]+"))
352
361
  nat = lexeme(regex(r"[0-9]+"))
353
- tap_ix = (integ << whitespace).parsecmap(int2tap)
362
+ # tap_ix = (integ << whitespace).parsecmap(int2tap) # Doesn't work!
363
+ tap_ix = integ.parsecmap(int2tap)
354
364
  symbol = lexeme(regex(r"[0-9a-zA-Z_][^\s()]*"))
355
365
  true = lexeme(string("True")).result(True)
356
366
  false = lexeme(string("False")).result(False)
@@ -501,7 +511,7 @@ def parse_ami_file_contents( # pylint: disable=too-many-locals,too-many-branche
501
511
  try:
502
512
  res = ami_parse(file_contents)
503
513
  except ParseError as pe:
504
- err_str = ParseErrMsg(f"Expected {pe.expected} at {pe.loc()} in:\n{pe.text[pe.index:]}")
514
+ err_str = ParseErrMsg(f"Expected {pe.expected} at {pe.loc()} in:{pe.text[pe.index: pe.index + 20]}")
505
515
  return err_str, AmiRootName(""), "", {}, {}
506
516
 
507
517
  err_str, param_dict = proc_branch(res)
@@ -209,7 +209,8 @@ class Model(HasTraits): # pylint: disable=too-many-instance-attributes
209
209
  self._slew = (ramp["rising"][0] + ramp["falling"][0]) / 2e9 # (V/ns)
210
210
  elif mtype == "input":
211
211
  if "gnd_clamp" not in subDict and "power_clamp" not in subDict:
212
- raise LookupError("Missing clamp curves!")
212
+ # raise LookupError("Missing clamp curves!")
213
+ pass
213
214
 
214
215
  plotdata = ArrayPlotData()
215
216
 
@@ -220,6 +221,8 @@ class Model(HasTraits): # pylint: disable=too-many-instance-attributes
220
221
  plotdata.set_data("gc_ityps", gc_ityps)
221
222
  plotdata.set_data("gc_imins", gc_imins)
222
223
  plotdata.set_data("gc_imaxs", gc_imaxs)
224
+ else:
225
+ gc_z = 2e6
223
226
 
224
227
  if "power_clamp" in subDict:
225
228
  pc_vs, pc_ityps, pc_imins, pc_imaxs, pc_zs = proc_iv(subDict["power_clamp"])
@@ -232,6 +235,8 @@ class Model(HasTraits): # pylint: disable=too-many-instance-attributes
232
235
  plotdata.set_data("pc_ityps", pc_ityps)
233
236
  plotdata.set_data("pc_imins", pc_imins)
234
237
  plotdata.set_data("pc_imaxs", pc_imaxs)
238
+ else:
239
+ pc_z = 2e6
235
240
 
236
241
  plot_iv = Plot(plotdata) # , padding_left=75)
237
242
  # The 'line_style' trait of a LinePlot instance must be 'dash' or 'dot dash' or 'dot' or 'long dash' or 'solid'.
@@ -107,6 +107,7 @@ def run_notebook(
107
107
  @click.option("--debug", is_flag=True, help="Provide extra debugging information.")
108
108
  @click.option("--is_tx", is_flag=True, help="Flags a Tx model.")
109
109
  @click.option("--nspui", default=32, show_default=True, help="Number of samples per unit interval.")
110
+ @click.option("--no-nspui-swp", is_flag=True, help="Skip samples per UI sweep.")
110
111
  @click.option("--nbits", default=200, show_default=True, help="Number of bits to run in simulations.")
111
112
  @click.option("--plot-t-max", default=0.5e-9, show_default=True, help="Maximum time value for plots (s).")
112
113
  @click.option("--f-max", default=40e9, show_default=True, help="Maximum frequency for transfer functions (Hz).")
@@ -117,18 +118,20 @@ def run_notebook(
117
118
  @click.argument("bit_rate", type=float)
118
119
  @click.version_option(package_name="PyIBIS-AMI")
119
120
  # pylint: disable=too-many-arguments,too-many-positional-arguments
120
- def main(notebook, out_dir, params, ibis_file, bit_rate, debug, is_tx, nspui, nbits,
121
+ def main(notebook, out_dir, params, ibis_file, bit_rate,
122
+ debug, is_tx, nspui, no_nspui_swp, nbits,
121
123
  plot_t_max, f_max, f_step, fig_x, fig_y):
122
124
  "Run a *Jupyter* notebook on an IBIS-AMI model file."
123
125
  run_notebook(
124
126
  Path(ibis_file).resolve(), Path(notebook).resolve(),
125
- out_dir=out_dir,
127
+ out_dir=Path(out_dir).resolve(),
126
128
  notebook_params={
127
129
  'ibis_dir': ".",
128
130
  'ibis_file': ibis_file,
129
131
  'debug': debug,
130
132
  'is_tx': is_tx,
131
133
  'nspui': nspui,
134
+ 'no_nspui_swp': no_nspui_swp,
132
135
  'nbits': nbits,
133
136
  'plot_t_max': plot_t_max,
134
137
  'f_max': f_max,
File without changes
File without changes
File without changes
File without changes
File without changes