Skip to content

Commit 7af6555

Browse files
committed
[#91570] ibert_eyescan: Allow disabling loopback
1 parent ddecb75 commit 7af6555

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

protoplaster/tests/bert/vivado_ibert/ibert_eyescan.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@
1010
class EyeScan:
1111

1212
def __init__(self, vivado_cmd: str, hw_server: str, serial_number: str,
13-
channel_path: str, prbs_bits: int) -> None:
13+
channel_path: str, prbs_bits: int, loopback: bool) -> None:
1414
self.eyescan_file = tempfile.NamedTemporaryFile()
1515
self.hw_server = hw_server
1616
self.serial_number = serial_number
1717
self.channel_path = channel_path
1818
self.prbs_bits = prbs_bits
19+
self.loopback = loopback
1920

2021
# Check if Vivado is available
2122
if shutil.which(vivado_cmd) is None:
@@ -38,6 +39,7 @@ def __init__(self, vivado_cmd: str, hw_server: str, serial_number: str,
3839
self.serial_number,
3940
self.channel_path,
4041
str(self.prbs_bits),
42+
int(self.loopback),
4143
]
4244
res = subprocess.run(vivado_argv,
4345
cwd=os.path.dirname(__file__),

protoplaster/tests/bert/vivado_ibert/ibert_eyescan.tcl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
proc perform_eye_scan { outputPath hwServer serialNumber channelPath prbsBits } {
1+
proc perform_eye_scan { outputPath hwServer serialNumber channelPath prbsBits loopback } {
22
# Connect to the emulator
33
open_hw_manager
44
connect_hw_server -url "$hwServer"
@@ -12,9 +12,11 @@ proc perform_eye_scan { outputPath hwServer serialNumber channelPath prbsBits }
1212
lappend xil_newLinks $xil_newLink
1313
set xil_newLinkGroup [create_hw_sio_linkgroup -description {Link Group 0} [get_hw_sio_links $xil_newLinks]]
1414
unset xil_newLinks
15-
# Set link to use PCS Loopback, and write to hardware
16-
set_property LOOPBACK {Far-End PCS} [get_hw_sio_links -of_objects [get_hw_sio_linkgroups {Link_Group_0}]]
17-
commit_hw_sio -non_blocking [get_hw_sio_links -of_objects [get_hw_sio_linkgroups {Link_Group_0}]]
15+
if { $loopback } {
16+
# Set link to use PCS Loopback, and write to hardware
17+
set_property LOOPBACK {Far-End PCS} [get_hw_sio_links -of_objects [get_hw_sio_linkgroups {Link_Group_0}]]
18+
commit_hw_sio -non_blocking [get_hw_sio_links -of_objects [get_hw_sio_linkgroups {Link_Group_0}]]
19+
}
1820
set_property RX_PATTERN "PRBS $prbsBits-bit" [get_hw_sio_links -of_objects [get_hw_sio_linkgroups {Link_Group_0}]]
1921
commit_hw_sio -non_blocking [get_hw_sio_links -of_objects [get_hw_sio_linkgroups {Link_Group_0}]]
2022
set_property TX_PATTERN "PRBS $prbsBits-bit" [get_hw_sio_links -of_objects [get_hw_sio_linkgroups {Link_Group_0}]]
@@ -26,7 +28,7 @@ proc perform_eye_scan { outputPath hwServer serialNumber channelPath prbsBits }
2628
write_hw_sio_scan $outputPath $xil_newScan
2729
}
2830

29-
set requiredArgs 5
31+
set requiredArgs 6
3032
if { $argc != $requiredArgs } {
3133
puts "Incorrect argument count, got $argc, expected $requiredArgs"
3234
exit 1
@@ -37,5 +39,6 @@ set hwServer [lindex $argv 1]
3739
set serialNumber [lindex $argv 2]
3840
set channelPath [lindex $argv 3]
3941
set prbsBits [lindex $argv 4]
42+
set loopback [lindex $argv 5]
4043

41-
perform_eye_scan $outputPath $serialNumber $channelPath $prbsBits
44+
perform_eye_scan $outputPath $hwServer $serialNumber $channelPath $prbsBits $loopback

protoplaster/tests/bert/vivado_ibert/test.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ def setup_class(self):
3333

3434
vivado_cmd = getattr(self, "vivado_cmd", "vivado")
3535
hw_server = getattr(self, "hw_server", "localhost:3121")
36+
loopback = getattr(self, "loopback", True)
3637
if not hasattr(self, "test_name"):
3738
self.test_name = (
3839
f"vivado_ibert eyescan: {self.prbs_bits}-bit PRBS "
39-
f"on {hw_server}/{self.serial_number}/{self.channel_path}")
40+
f"on {hw_server}/{self.serial_number}/{self.channel_path}, "
41+
f"{'' if loopback else 'no '} loopback")
4042
self.eyescan = EyeScan(vivado_cmd, hw_server, self.serial_number,
41-
self.channel_path, self.prbs_bits)
43+
self.channel_path, self.prbs_bits, loopback)
4244

4345
def test_create_diagram(self, record_artifact, artifacts_dir):
4446
"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ protoplaster-mgmt = 'manager.protoplaster_mgmt:main'
1919
dependencies = {file = ["requirements.txt"]}
2020

2121
[tool.setuptools.package-data]
22-
"*" = ["*.md", "*.css", "*.html", "*.yml", "*.svg", "*.png"]
22+
"*" = ["*.md", "*.css", "*.html", "*.yml", "*.svg", "*.png", "*.tcl"]

0 commit comments

Comments
 (0)