From 8499585058f8727aaf3896828e66c125faa68f4c Mon Sep 17 00:00:00 2001 From: David Banas Date: Mon, 12 Feb 2024 16:27:43 -0500 Subject: [PATCH] Fixed Rx termination. (#36) * Fixed Rx termination. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: David Banas Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/pyibisami/ami/config.py | 10 +++++----- src/pyibisami/ami/generic.ibs.em | 20 +++++++++----------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/pyibisami/ami/config.py b/src/pyibisami/ami/config.py index c33308c..de3be52 100644 --- a/src/pyibisami/ami/config.py +++ b/src/pyibisami/ami/config.py @@ -35,11 +35,11 @@ import em param_types = { - "INT": {"c_type": "int", "ami_type": "Integer", "getter": "get_param_int"}, - "FLOAT": {"c_type": "float", "ami_type": "Float", "getter": "get_param_float"}, - "TAP": {"c_type": "float", "ami_type": "Tap", "getter": "get_param_float"}, - "BOOL": {"c_type": "bool", "ami_type": "Boolean", "getter": "get_param_bool"}, - "STRING": {"c_type": "char *", "ami_type": "String", "getter": "get_param_str"}, + "INT": {"c_type": "int", "ami_type": "Integer", "getter": "get_param_int"}, + "FLOAT": {"c_type": "float", "ami_type": "Float", "getter": "get_param_float"}, + "TAP": {"c_type": "float", "ami_type": "Tap", "getter": "get_param_float"}, + "BOOL": {"c_type": "bool", "ami_type": "Boolean", "getter": "get_param_bool"}, + "STRING": {"c_type": "char *", "ami_type": "String", "getter": "get_param_str"}, } diff --git a/src/pyibisami/ami/generic.ibs.em b/src/pyibisami/ami/generic.ibs.em index 95bae29..831b121 100644 --- a/src/pyibisami/ami/generic.ibs.em +++ b/src/pyibisami/ami/generic.ibs.em @@ -1,11 +1,11 @@ -[IBIS Ver] 7.1 - @{ from numpy import array +version = ibis_params['version'] file_name = ibis_params['file_name'] file_rev = ibis_params['file_rev'] copyright = ibis_params['copyright'] +source = ibis_params['source'] component = ibis_params['component'] manufacturer = ibis_params['manufacturer'] r_pkg = ibis_params['r_pkg'] @@ -24,12 +24,13 @@ impedance = ibis_params['impedance'] slew_rate = ibis_params['slew_rate'] } +[IBIS Ver] @(version) [File Name] @(file_name) [File Rev] @(file_rev) [Date] @(date) -[Source] ibisami, a public domain IBIS-AMI model creation infrastructure +[Source] @(source) [Disclaimer] THIS MODEL IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" @@ -44,11 +45,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS MODEL, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [Notes] -This IBIS file was generated, using the template file, -"example_tx.ibs.em", from ibisami, a public domain IBIS-AMI model -creation infrastructure. To learn more, visit: - -https://github.com/capn-freako/ibisami/wiki +This IBIS file was generated using the template file: "generic.ibs.em". [Copyright] @(copyright) [Component] @(component) @@ -128,13 +125,14 @@ else: print("[GND Clamp]") print("%-5.2f %-10.3e %-10.3e %-10.3e" % (-1. * voltage_range[0], -10., -10., -10.)) for v in [k * voltage_range[0] for k in range(3)]: - i = v / array(impedance) + i = v / array(impedance) / 2 print("%-5.2f %-10.3e %-10.3e %-10.3e" % (v, i[0], i[1], i[2])) print("") print("[Power Clamp]") print("%-5.2f %-10.3e %-10.3e %-10.3e" % (-1. * voltage_range[0], 10., 10., 10.)) - print("%-5.2f %-10.3e %-10.3e %-10.3e" % (0., 0., 0., 0.)) - print("%-5.2f %-10.3e %-10.3e %-10.3e" % (2. * voltage_range[0], 0., 0., 0.)) + for v in [k * voltage_range[0] for k in range(3)]: + i = v / array(impedance) / 2 + print("%-5.2f %-10.3e %-10.3e %-10.3e" % (v, -i[0], -i[1], -i[2])) print("") }