Skip to content

FEAT: Added new section in VirtualCompliance to compute skew parameters from Report. #6114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bb9f3fa
Added new section in VirtualCompliance to compute parameters from Rep…
maxcapodi78 May 6, 2025
565f8e9
chore: adding changelog file 6114.added.md [dependabot-skip]
pyansys-ci-bot May 6, 2025
08d4264
add missing files
maxcapodi78 May 6, 2025
137caa2
Merge remote-tracking branch 'origin/add_parameters_to_virtualcomplia…
maxcapodi78 May 6, 2025
a96521c
add missing files
maxcapodi78 May 6, 2025
34cd967
add missing files
maxcapodi78 May 6, 2025
dfc8313
Merge branch 'main' into add_parameters_to_virtualcompliance
Samuelopez-ansys May 6, 2025
c3634aa
add missing files
maxcapodi78 May 6, 2025
8c6c469
Merge remote-tracking branch 'origin/add_parameters_to_virtualcomplia…
maxcapodi78 May 6, 2025
e309b94
add missing files
maxcapodi78 May 6, 2025
1cfb790
add missing files
maxcapodi78 May 6, 2025
3c7a93e
add missing files
maxcapodi78 May 6, 2025
75c0922
add missing files
maxcapodi78 May 6, 2025
49d8017
add missing files
maxcapodi78 May 6, 2025
20d4397
add missing files
maxcapodi78 May 6, 2025
8a2cfc3
add missing files
maxcapodi78 May 6, 2025
28a6efe
add missing files
maxcapodi78 May 6, 2025
5efdfb9
add missing files
maxcapodi78 May 6, 2025
d1d16c0
add missing files
maxcapodi78 May 6, 2025
2029103
Fix Codacy
Samuelopez-ansys May 7, 2025
21c36ca
added units to the table
maxcapodi78 May 7, 2025
48e738b
Merge remote-tracking branch 'origin/add_parameters_to_virtualcomplia…
maxcapodi78 May 7, 2025
3f1b863
fix ibis bug
maxcapodi78 May 7, 2025
da137d3
Merge branch 'main' into add_parameters_to_virtualcompliance
Samuelopez-ansys May 7, 2025
b10caad
fix label on table
maxcapodi78 May 7, 2025
95eb9b8
Merge remote-tracking branch 'origin/add_parameters_to_virtualcomplia…
maxcapodi78 May 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/6114.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added new section in VirtualCompliance to compute skew parameters from Report.
2 changes: 1 addition & 1 deletion src/ansys/aedt/core/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,7 @@
else:
cmp_tx = list(ibis.components.values())[0]
if ibis_rx_component_name:
cmp_rx = ibis.components[ibis_tx_component_name]
cmp_rx = ibis_rx.components[ibis_rx_component_name]

Check warning on line 2296 in src/ansys/aedt/core/circuit.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/circuit.py#L2296

Added line #L2296 was not covered by tests
elif not ibis_rx_file:
cmp_rx = cmp_tx
else:
Expand Down
2 changes: 2 additions & 0 deletions src/ansys/aedt/core/visualization/plot/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ def add_table(
text_align="CENTER",
width=160 if self.use_portrait else 260,
col_widths=col_widths,
num_heading_rows=1,
repeat_headings=1,
) as table:
for i, data_row in enumerate(content):
fill_color = None
Expand Down
286 changes: 280 additions & 6 deletions src/ansys/aedt/core/visualization/post/compliance.py

Large diffs are not rendered by default.

79 changes: 73 additions & 6 deletions src/ansys/aedt/core/visualization/report/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,54 @@
str
Time start value.
"""
return self._legacy_props["context"].get("time_start", None)
return self._legacy_props["context"].get("time_start", "0ps")

@time_start.setter
def time_start(self, value):
self._legacy_props["context"]["time_start"] = value

@property
def thinning(self):
"""Transient windowing.

Returns
-------
int
"""
return self._legacy_props["context"].get("thinning", 0)

@thinning.setter
def thinning(self, value):
self._legacy_props["context"]["thinning"] = value

Check warning on line 87 in src/ansys/aedt/core/visualization/report/standard.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/visualization/report/standard.py#L87

Added line #L87 was not covered by tests

@property
def thinning_points(self):
"""Transient thinning points.

Returns
-------
int
"""
return self._legacy_props["context"].get("thinning_points", 500000000)

@thinning_points.setter
def thinning_points(self, value):
self._legacy_props["context"]["thinning_points"] = value

Check warning on line 101 in src/ansys/aedt/core/visualization/report/standard.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/visualization/report/standard.py#L101

Added line #L101 was not covered by tests

@property
def dy_dx_tolerance(self):
"""Transient thinning points.

Returns
-------
int
"""
return self._legacy_props["context"].get("dy_dx_tolerance", 0.001)

@dy_dx_tolerance.setter
def dy_dx_tolerance(self, value):
self._legacy_props["context"]["dy_dx_tolerance"] = value

Check warning on line 115 in src/ansys/aedt/core/visualization/report/standard.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/aedt/core/visualization/report/standard.py#L115

Added line #L115 was not covered by tests

@property
def time_stop(self):
"""Time stop value.
Expand All @@ -81,7 +123,7 @@
str
Time stop value.
"""
return self._legacy_props["context"].get("time_stop", None)
return self._legacy_props["context"].get("time_stop", "10ns")

@time_stop.setter
def time_stop(self, value):
Expand Down Expand Up @@ -386,10 +428,35 @@
elif self.domain == "Initial Response":
ctxt[2].extend(["IRID", False, "0", "NUMLEVELS", False, "1", "SCID", False, "-1", "SID", False, "0"])
if self.domain == "Time":
if self.time_start:
ctxt[2].extend(["WS", False, self.time_start])
if self.time_stop:
ctxt[2].extend(["WE", False, self.time_stop])
ctxt[2].extend(
[
"DE",
False,
str(1 if self.thinning else 0),
"DP",
False,
str(self.thinning_points),
"DT",
False,
str(self.dy_dx_tolerance),
"NUMLEVELS",
False,
"0",
"WE",
False,
self.time_stop,
"WM",
False,
self.time_stop,
"WN",
False,
self.time_start,
"WS",
False,
self.time_start,
]
)

elif self._post.post_solution_type in ["NexximAMI"]:
ctxt = [
"NAME:Context",
Expand Down
Binary file not shown.
148 changes: 148 additions & 0 deletions tests/system/solvers/example_models/T01/compliance/skew.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"Help": "This Report Template is applicable to TDR Plots from Transient data where a TDR probe has been used.",
"report_category": "Standard",
"report_type": "Rectangular Plot",
"plot_name": "Transient Compliance",
"context": {
"domain": "Time",
"primary_sweep": "Time",
"primary_sweep_range": [
"All"
],
"variations": {
"Time": [
"All"
]
},
"time_start": "0ns",
"time_stop": "5ns"
},
"expressions": {
"curve1" : {
"color": [
0,
255,
255
],
"trace_style": "Solid",
"width": 2,
"trace_type": "Continuous",
"show_symbols": false,
"symbol_color": [
255,
255,
0
],
"show_arrows": true,
"symbol_fill": true,
"symbol_style":"Circle"

}
},
"limitLines": {},
"general": {
"axisx": {
"label": "Time",
"font": "Arial",
"font_size": 10,
"bold": true,
"italic": false,
"color": [
255,
255,
255
],
"linear_scaling": true,
"specify_spacing": false,
"minor_tick_divs": "5",
"auto_units": true,
"units": "us"
},
"axisy1": {
"label": "Voltage",
"font": "Arial",
"font_size": 8,
"bold": true,
"italic": false,
"color": [
255,
255,
255
],
"Display Units": true,
"Number Format": "Auto",
"field_width": "2",
"Field Precision": "0",
"linear_scaling": true,
"specify_spacing": false,
"min_spacing": "5",
"minor_tick_divs": "5",
"auto_units": true,
"units": ""
},
"appearance": {
"background_color": [
20,
20,
40
],
"plot_color": [
20,
20,
40
],
"enable_y_stripes": true,
"Auto Scale Fonts": true,
"field_width": "4",
"precision": "4",
"use_scientific_notation": false
},
"grid": {
"major_color": [
120,
120,
120
],
"minor_color": [
120,
120,
120
],
"major_x": true,
"major_y": true,
"minor_x": false,
"minor_y": false,
"style_major": "Dot",
"style_minor": "Dot"
},
"legend": {
"back_color": [
30,
30,
30
],
"font_color": [
255,
255,
255
],
"show_solution_name": false,
"show_variation_key": true,
"show_trace_name": true
},
"header": {
"font": "Arial",
"title_size": 12,
"color": [
255,
255,
255
],
"bold": true,
"italic": false,
"subtitle_size": 12,
"company_name": "PCIe Gen 3 Compliance",
"show_design_name": false
}
}
}
26 changes: 20 additions & 6 deletions tests/system/solvers/test_01_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ def test_virtual_compliance(self, local_scratch, aedtapp):
os.makedirs(compliance_folder, exist_ok=True)
vc = VirtualComplianceGenerator("Test_full", "Diff_Via")
vc.dut_image = os.path.join(local_path, "example_models", test_subfolder, "nets.jpg")
for plot in aedtapp.post.plots[::]:
try:
plot.export_config(f"{compliance_folder}\\report_{plot.plot_name}.json")
except Exception:
print(f"Failed to generate {plot.plot_name}")
vc.project_file = aedtapp.project_file
# for plot in aedtapp.post.plots[::]:
# try:
# plot.export_config(f"{compliance_folder}\\report_{plot.plot_name}.json")
# except Exception:
# print(f"Failed to generate {plot.plot_name}")

vc.add_report_from_folder(
os.path.join(local_path, "example_models", test_subfolder, "compliance"),
Expand All @@ -141,9 +142,22 @@ def test_virtual_compliance(self, local_scratch, aedtapp):
pass_fail_criteria=3,
name="ERL",
)
local_scratch.copyfile(
os.path.join(local_path, "example_models", test_subfolder, "compliance", "skew.json"),
os.path.join(compliance_folder, "skew.json"),
)
vc.add_report_derived_parameter(
design_name="skew",
parameter="skew",
config_file=os.path.join(compliance_folder, "skew.json"),
traces=["V(V_Rx)", "V(V_Rx8)"],
report_type="time",
pass_fail_criteria=0.2,
name="Differential Skew",
)
vc.save_configuration(f"{compliance_folder}\\main.json")
assert os.path.exists(os.path.join(compliance_folder, "main.json"))
v = VirtualCompliance(aedtapp.desktop_class, template)
v = VirtualCompliance(aedtapp.desktop_class, f"{compliance_folder}\\main.json")
assert v.create_compliance_report()

def test_spisim_raw_read(self, local_scratch):
Expand Down