Skip to content

Commit

Permalink
Ibis reader refactoring (#3568)
Browse files Browse the repository at this point in the history
* Ibis reader refactoring

* Ibis reader refactoring

* Ibis reader refactoring

* Ibis reader refactoring

* Ibis reader refactoring

* Ibis reader refactoring

* Ibis reader refactoring

---------

Co-authored-by: maxcapodi78 <Shark78>
  • Loading branch information
maxcapodi78 authored Sep 15, 2023
1 parent b38c155 commit d3dffba
Show file tree
Hide file tree
Showing 15 changed files with 901 additions and 179 deletions.
Binary file added _unittest/example_models/T15/channel_4.sss
Binary file not shown.
Binary file not shown.
Binary file not shown.
25 changes: 25 additions & 0 deletions _unittest/example_models/T15/ibis_ami_example_rx.ami
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
(IBIS_AMI_EXAMPLE
(Reserved_Parameters
(AMI_Version (Usage Info) (Type String) (Value "5.1")
(Description "Valid for AMI_Version 5.1 and above"))
(Ignore_Bits (Usage Info)(Type Integer)(Default 4)
(Description "Ignore 4 bits to fill up tapped delay line"))
(Max_Init_Aggressors (Usage Info) (Type Integer)(Default 10)
(Description "Number of aggressors supported by the model"))
(Init_Returns_Impulse (Usage Info) (Type Boolean)(Default True)
(Description "AMI_Init function returns impulse and parameters_out"))
(GetWave_Exists (Usage Info)(Type Boolean)(Default True)
(Description "yes, it exists"))
) | End Reserved_Parameters
(Model_Specific
| method = 1 applies the tap weights inside AMI_Init() to the channel impulse.
| method = 2 applies the tap weights inside AMI_Getwave() to the wave.
| Results of both methods should be nearly identical in AMI, but not in VerifEye
| because we ignore the GetWave function there! method = 1 is faster
(method (Usage In)(Type Integer)(Default 1) )
(clock_threshold (Usage In)(Type Float)(Default 0.4)
(Description "clock threshold for the receiver"))
(ffe_weight_1 (Usage In)(Type Float)(Default 1.0))
(ffe_weight_2 (Usage In)(Type Float)(Default 0.0))
(ffe_weight_3 (Usage In)(Type Float)(Default 0.0))
))
59 changes: 59 additions & 0 deletions _unittest/example_models/T15/ibis_ami_example_rx.ibs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[IBIS Ver] 5.1
[Disclaimer]
Example IBIS file that refers to example
Algorithmic Model. This file does not
contain a model for an actual physical
device.
[File Name] ibis_ami_example_rx.ibs
|
[Date] March 29, 2018 10:59:00 AM EDT
[File Rev] 0.2
[Source]
|
[Notes]
|
[Component] example_device_rx
|
[Manufacturer] ANSYS, Inc.
|
[Package]
R_pkg 0.01m NA NA
L_pkg 0.001nH NA NA
C_pkg 0.001pF NA NA
|
[Pin] signal_name model_name R_pin L_pin C_pin
11 example_rx_P example_model_rx NA NA NA
12 example_rx_N example_model_rx NA NA NA
|
[Diff Pin] inv_pin vdiff tdelay_typ tdelay_min tdelay_max|
11 12 0.2 NA NA NA


| ------------------------------------
|
| model example_model_rx
|
[Model] example_model_rx
Model_type Input
C_comp 166.88f 166.88f 166.88f
Vinl = .5
Vinh = .5
[Temperature Range] 85 100 0
[Voltage Range] 1. 1. 1.
[Algorithmic Model]
Executable Windows_Intel7_32 ibis_ami_example_w32.dll ibis_ami_example_rx.ami
Executable Windows_Intel10_64 ibis_ami_example_w64.dll ibis_ami_example_rx.ami
Executable Linux_Intel10_32 ibis_ami_example_l32.so ibis_ami_example_rx.ami
Executable Linux_Intel10_64 ibis_ami_example_l64.so ibis_ami_example_rx.ami
[End Algorithmic Model]
[GND_clamp]
-1 0.0 0.0 0.0
1.5 0.0 0.0 0.0
[POWER_clamp]
-1 0.0 0.0 0.0
1.5 0.0 0.0 0.0
|
| ------------------------------------
|
|
[End]
24 changes: 24 additions & 0 deletions _unittest/example_models/T15/ibis_ami_example_tx.ami
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
(IBIS_AMI_EXAMPLE
(Reserved_Parameters
(AMI_Version (Usage Info) (Type String) (Value "5.1")
(Description "Valid for AMI_Version 5.1 and above"))
(Ignore_Bits (Usage Info)(Type Integer)(Default 4)
(Description "Ignore 4 bits to fill up tapped delay line"))
(Max_Init_Aggressors (Usage Info) (Type Integer)(Default 10)
(Description "Number of aggressors supported by the model"))
(Init_Returns_Impulse (Usage Info) (Type Boolean)(Default True)
(Description "AMI_Init function returns impulse and parameters_out"))
(GetWave_Exists (Usage Info)(Type Boolean)(Default True)
(Description "yes, it exists"))
) | End Reserved_Parameters
(Model_Specific
| method = 1 applies the tap weights inside AMI_Init() to the channel impulse.
| method = 2 applies the tap weights inside AMI_Getwave() to the wave.
| Results of both methods should be nearly identical in AMI, but not in VerifEye
| because we ignore the GetWave function there! method = 1 is faster
(method (Usage In)(Type Integer)(Default 1))
(ffe_weight_1 (Usage In)(Type Float)(Default 1.0))
(ffe_weight_2 (Usage In)(Type Float)(Default 0.0))
(ffe_weight_3 (Usage In)(Type Float)(Default 0.0))
)
)
63 changes: 63 additions & 0 deletions _unittest/example_models/T15/ibis_ami_example_tx.ibs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
[IBIS Ver] 5.1
[Disclaimer]
Example IBIS file that refers to example
Algorithmic Model. This file does not
contain a model for an actual physical
device.
[File Name] ibis_ami_example_tx.ibs
|
[Date] March 29, 2018 10:59:00 AM EDT
[File Rev] 0.3
[Source]
|
[Notes]
|
[Component] example_device_tx
|
[Manufacturer] ANSYS, Inc.
|
[Package]
R_pkg 0.01m NA NA
L_pkg 0.001nH NA NA
C_pkg 0.001pF NA NA
|
[Pin] signal_name model_name R_pin L_pin C_pin
14 example_tx_P example_model_tx NA NA NA
15 example_tx_N example_model_tx NA NA NA

[Diff Pin] inv_pin vdiff tdelay_typ tdelay_min tdelay_max|
14 15 0.2 NA NA NA


|Model row 3
|
|model example_model_tx
|
[Model] example_model_tx
Model_type Output
C_comp 64f 64f 64f
Cref =0
[Model Spec]
Vmeas 0.0882 0.0882 0.0882
Vref 0.0882 0.0882 0.0882
[Algorithmic Model]
Executable Windows_Intel7_32 ibis_ami_example_w32.dll ibis_ami_example_tx.ami
Executable Windows_Intel10_64 ibis_ami_example_w64.dll ibis_ami_example_tx.ami
Executable Linux_Intel10_32 ibis_ami_example_l32.so ibis_ami_example_tx.ami
Executable Linux_Intel10_64 ibis_ami_example_l64.so ibis_ami_example_tx.ami
[End Algorithmic Model]
[Temperature Range] 85.0000 85.0000 85.0000
[Voltage Range] 0.1694 0.1694 0.1694
[Pulldown]
-2.50 -5.3821E-02 -5.3821E-02 -5.3821E-02
0.00 0.0000E+00 0.0000E+00 0.0000E+00
2.50 5.3821E-02 5.3821E-02 5.3821E-02
[Pullup]
-2.50 5.3821E-02 5.3821E-02 5.3821E-02
0.00 0.0000E+00 0.0000E+00 0.0000E+00
2.50 -5.3821E-02 -5.3821E-02 -5.3821E-02
[Ramp]
dV/dt_r 0.052/16.573p 0.052/16.573p 0.052/16.573p
dV/dt_f 0.052/17.251p 0.052/17.251p 0.052/17.251p

[End]
Binary file not shown.
Binary file not shown.
12 changes: 9 additions & 3 deletions _unittest/test_15_ibs_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ def test_01_read_ibis(self):
assert ibis.components["MT47H64M4BP-3_25"].pins["A1_MT47H64M4BP-3_25_u26a_800_modified"].c_value == "0.59pF"

# Add pin
ibis.components["MT47H32M8BP-3_25"].pins["A7_MT47H32M8BP-3_25_u26a_800_modified"].add()
ibis.components["MT47H32M8BP-3_25"].pins["A8_MT47H32M8BP-3_25_u26a_800_modified"].add()
pin = (
ibis.components["MT47H32M8BP-3_25"]
.pins["A7_MT47H32M8BP-3_25_u26a_800_modified"]
.pins["A8_MT47H32M8BP-3_25_u26a_800_modified"]
.insert(0.1016, 0.05334, 0.0)
)
assert pin.name == "CompInst@A7_MT47H32M8BP-3_25_u26a_800_modified"
assert pin.name == "CompInst@DQS#_MT47H32M8BP-3_25_u26a_800_modified"

# Add buffer
ibis.buffers["RDQS#_u26a_800_modified"].add()
Expand All @@ -72,3 +72,9 @@ def test_02_read_ibis_from_circuit(self):
)
assert len(ibis_model.components) == 6
assert len(ibis_model.models) == 17

def test_03_read_ibis_ami(self):
ibis_model = self.aedtapp.get_ibis_model_from_file(
os.path.join(local_path, "example_models", test_subfolder, "ibis_ami_example_tx.ibs"), is_ami=True
)
assert ibis_model.buffers["example_model_tx_ibis_ami_example_tx"].insert(0, 0)
10 changes: 7 additions & 3 deletions pyaedt/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,21 +413,25 @@ def create_schematic_from_netlist(self, file_to_import):
return True

@pyaedt_function_handler()
def get_ibis_model_from_file(self, path):
def get_ibis_model_from_file(self, path, is_ami=False):
"""Create an IBIS model based on the data contained in an IBIS file.
Parameters
----------
path : str
Path of the IBIS file.
is_ami : bool, optional
Whether if import an IBIS or an IBIS AMI.
Returns
-------
:class:`pyaedt.generic.ibis_reader.Ibis`
IBIS object exposing all data from the IBIS file.
"""

reader = ibis_reader.IbisReader(path, self)
if is_ami:
reader = ibis_reader.AMIReader(path, self)
else:
reader = ibis_reader.IbisReader(path, self)
reader.parse_ibis_file()
return reader.ibis_model

Expand Down
69 changes: 69 additions & 0 deletions pyaedt/generic/ami.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"Reserved_Parameters" : {
"AMI_Version": {
"Usage": "",
"Type": "",
"Format": {
"Value": "",
"Range": "",
"List": "",
"List_Tip": "",
"Corner": "",
"Increment": "",
"Steps": "",
"Table": "",
"Gaussian": "",
"Dual-Dirac": "",
"DjRj": ""
},
"Default": "",
"Description": "",
"List_Tip": ""
},
"Init_Returns_Impulse": "",
"GetWave_Exists": "",
"Use_Init_Output": "",
"Max_Init_Aggressors": "",
"Ignore_Bits": "",
"Resolve_Exists": "",
"Model_Name": "",
"Supporting_Files": "",
"DLL_Path": "",
"DLL_ID": "",
"Tx_Jitter": "",
"Tx_DCD": "",
"Tx_Rj": "",
"Tx_Dj": "",
"Tx_Sj": "",
"Tx_Sj_Frequency": "",
"Rx_DCD": "",
"Rx_Rj": "",
"Rx_Dj": "",
"Rx_Sj": "",
"Rx_Clock_PDF": "",
"Rx_Clock_Recovery_Mean": "",
"Rx_Clock_Recovery_Rj": "",
"Rx_Clock_Recovery_Dj": "",
"Rx_Clock_Recovery_Sj": "",
"Rx_Clock_Recovery_DCD": "",
"Rx_Receiver_Sensitivity": "",
"Rx_Noise": "",
"Rx_GaussianNoise": "",
"Rx_UniformNoise": "",
"Modulation": "",
"PAM4_Mapping": "",
"PAM4_UpperThreshold": "",
"PAM4_CenterThreshold": "",
"PAM4_LowerThreshold": "",
"PAM4_UpperEyeOffset": "",
"PAM4_CenterEyeOffset": "",
"PAM4_LowerEyeOffset": "",
"Ts4file": "",
"Tx_V": "",
"Tx_R": "",
"Rx_R": ""
},
"Model_Specific": {

}
}
Loading

0 comments on commit d3dffba

Please sign in to comment.