### Initialize MESA Example Design Source: https://github.com/xilinx/chipscopy/blob/master/docs/mesa.md Use resolve_example_design to automatically configure hardware paths based on the platform and example ID. This setup allows the notebook to run in either MESA or direct mode. ```python import os from chipscopy import create_session, delete_session from chipscopy.examples.mesa import resolve_example_design CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = "vck190" EXAMPLE_ID = "ila_and_vio" PROGRAMMING_FILE = "" # Direct mode: set to your own PDI to skip MESA PROBES_FILE = "" example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) example_design.print_summary() session = create_session(cs_server_url=CS_URL, hw_server_url=HW_URL) device = session.devices.filter_by(family=example_design.device_family).get() if not example_design.verify_device_idcode(device): raise RuntimeError("Device IDCODE does not match the manifest design.") example_design.program_device(device) device.discover_and_setup_cores(ltx_file=example_design.probes_file) # ... your example logic here ... delete_session(session) ``` -------------------------------- ### Configure Hardware and MESA Setup Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/memory/memory_example.ipynb Define hardware server connection parameters and resolve the example design configuration. ```python # ============================================================ # USER CONFIGURATION - Edit these for your own setup / design # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "vck190") EXAMPLE_ID = "memory_example" PROG_DEVICE = True # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") ``` -------------------------------- ### Update ChipScoPy Examples Source: https://github.com/xilinx/chipscopy/blob/master/docs/chipscopy_installation.md Run this command within the virtual environment to fetch the latest example files. ```shell (venv) > chipscopy-get-examples ``` -------------------------------- ### Create a ChipScoPy Session Source: https://github.com/xilinx/chipscopy/blob/master/docs/session/references.md Use these examples to initialize a session by connecting to hardware and ChipScope servers. The second example demonstrates how to bypass version checks and disable core scanning. ```python my_session = create_session(hw_server_url="TCP:localhost:3121", cs_server_url="TCP:localhost:3042") ``` ```python my_session = create_session(hw_server_url="TCP:localhost:3121", cs_server_url="TCP:localhost:3042", disable_core_scan=True, bypass_version_check=True) ``` -------------------------------- ### Configure Board 1 Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/cross_link_debug/cross_link_debug.ipynb Sets up environment variables and resolves the example design for the first board. ```python # ============================================================ # USER CONFIGURATION - Board 1 (edit for your own setup / design) # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL_1 = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM_1 = os.getenv("HW_PLATFORM_1", "vck190") HW_PLATFORM = os.getenv("HW_PLATFORM", HW_PLATFORM_1) # alias for MESA compliance checks EXAMPLE_ID_1 = "cross_link_debug" PROG_DEVICE_1 = True # Direct mode for board 1: set these to skip MESA for board 1. PROGRAMMING_FILE_1 = "" PROBES_FILE_1 = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design_1 = resolve_example_design( HW_PLATFORM_1, EXAMPLE_ID_1, programming_file=PROGRAMMING_FILE_1, probes_file=PROBES_FILE_1, ) design_manifest_1 = example_design_1.manifest DEVICE_FAMILY_1 = example_design_1.device_family PROGRAMMING_FILE_1 = example_design_1.programming_file PROBES_FILE_1 = example_design_1.probes_file print("Board 1:") example_design_1.print_summary() print(f"HW_URL_1: {HW_URL_1}") ``` -------------------------------- ### Configure Hardware and Design Paths Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ila_and_vio/ila_and_vio.ipynb Sets up server URLs and resolves the example design files for the target platform. ```python # ============================================================ # USER CONFIGURATION - Edit these for your own setup / design # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "vck190") EXAMPLE_ID = "ila_and_vio" PROG_DEVICE = True # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") ``` -------------------------------- ### Configure Board 2 Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/cross_link_debug/cross_link_debug.ipynb Sets up environment variables and resolves the example design for the second board. ```python # ============================================================ # USER CONFIGURATION - Board 2 (edit for your own setup / design) # ============================================================ HW_URL_2 = os.getenv("HW_SERVER_URL_2", os.getenv("HW_SERVER_URL", "TCP:localhost:3121")) HW_PLATFORM_2 = os.getenv("HW_PLATFORM_2", "vcu128") EXAMPLE_ID_2 = "cross_link_debug" PROG_DEVICE_2 = True # Direct mode for board 2: set these to skip MESA for board 2. PROGRAMMING_FILE_2 = "" PROBES_FILE_2 = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design_2 = resolve_example_design( HW_PLATFORM_2, EXAMPLE_ID_2, programming_file=PROGRAMMING_FILE_2, probes_file=PROBES_FILE_2, device_family="virtexuplus", ) design_manifest_2 = example_design_2.manifest DEVICE_FAMILY_2 = example_design_2.device_family PROGRAMMING_FILE_2 = example_design_2.programming_file PROBES_FILE_2 = example_design_2.probes_file print("Board 2:") example_design_2.print_summary() print(f"HW_URL_2: {HW_URL_2}") ``` -------------------------------- ### Discover and Setup IBERT Cores Source: https://github.com/xilinx/chipscopy/blob/master/docs/ibert.md Initialize a session and discover IBERT cores on a device by setting ibert_scan to True. ```python from chipscopy import create_session CS_URL = "TCP:localhost:3042" HW_URL = "TCP:localhost:3121" session = create_session(cs_server_url=CS_URL, hw_server_url=HW_URL) device = session.devices.at(index=0) device.discover_and_setup_cores(ibert_scan=True) ``` -------------------------------- ### Launch Jupyter Notebook Server Source: https://github.com/xilinx/chipscopy/blob/master/docs/chipscopy_installation.md Starts the Jupyter notebook server within the virtual environment to access ChipScoPy examples. ```shell (venv) > jupyter notebook ``` -------------------------------- ### Configuring Environment and MESA Design Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/usp/link_and_eye_scan_usp.ipynb Sets up server URLs and platform parameters, then resolves the example design using MESA. ```python # ============================================================ # USER CONFIGURATION - Edit these for your own setup / design # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "vcu128") EXAMPLE_ID = "link_and_eye_scan_usp" PROG_DEVICE = True # Optional quad selection. Empty string -> use the first quad listed in the # design manifest (MESA mode) or required-via-env-var (direct mode). IBERT_QUAD = os.getenv("IBERT_QUAD", "") # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") ``` -------------------------------- ### Create Session and Connect Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/versal_gtm/yk_scan_example.ipynb Configures server URLs and platform settings, resolves the example design, and initializes the ChipScoPy session. ```python CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "vpk120") EXAMPLE_ID = "yk_scan_example" PROG_DEVICE = True # Optional GTM quad selection. Empty string -> auto-pick the first quad from the # design manifest. Works in both MESA and direct mode. IBERT_QUAD = os.getenv("IBERT_QUAD", "") # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") session = create_session(cs_server_url=CS_URL, hw_server_url=HW_URL) report_versions(session) ``` -------------------------------- ### Install ChipScoPy Package Source: https://github.com/xilinx/chipscopy/blob/master/docs/chipscopy_installation.md Installs the latest version of the ChipScoPy package into the active virtual environment. ```shell # installs latest version (venv) > python -m pip install chipscopy ``` -------------------------------- ### Start Hardware and Chipscope Servers Source: https://github.com/xilinx/chipscopy/blob/master/docs/chipscopy_installation.md Commands to initialize the required hardware and chipscope servers for board communication. ```shell hw_server ``` ```shell cs_server ``` -------------------------------- ### chipscopy.examples.mesa.get_manifest Source: https://github.com/xilinx/chipscopy/blob/master/docs/mesa.md Retrieves the MESA manifest for a specific platform and optional example ID. ```APIDOC ## chipscopy.examples.mesa.get_manifest(platform: str, example_id: str | None = None) ### Description Fetches the MESA manifest for the specified platform and optional example ID. ### Parameters - **platform** (str) - Required - The hardware platform. - **example_id** (str | None) - Optional - The example ID. ### Returns - **Manifest | None** - The manifest object if found, otherwise None. ``` -------------------------------- ### Install ChipScoPy Dependencies Source: https://github.com/xilinx/chipscopy/blob/master/docs/chipscopy_installation.md Installs optional support packages for core add-ons and Jupyter notebooks. ```shell (venv) > python -m pip install chipscopy[core-addons] (venv) > python -m pip install chipscopy[jupyter] ``` -------------------------------- ### Program the device with example design Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ila_and_vio/vio.ipynb Verifies the device IDCODE against the manifest before programming the device. ```python device = session.devices.filter_by(family=DEVICE_FAMILY).get() if PROG_DEVICE: if not example_design.verify_device_idcode(device): raise RuntimeError("Device IDCODE does not match the manifest design.") example_design.program_device(device) ``` -------------------------------- ### Program Device with Example Design Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/usp/link_and_eye_scan_usp.ipynb Identifies the target device by family and programs it using the provided example design manifest. ```python # Typical case - one device on the board - get it using family from manifest. # DEVICE_FAMILY comes from the manifest: `virtexuplus` for VCU128 GTY, # `spartanu` for SCU200 GTH, etc. device = session.devices.filter_by(family=DEVICE_FAMILY).get() print(device) if PROG_DEVICE: if not example_design.verify_device_idcode(device): raise RuntimeError("Device IDCODE does not match the manifest design.") # example_design.program_device() handles flat vs. segmented programming # automatically based on the manifest's programming_flow setting. example_design.program_device(device, delay_after_program=10) ``` -------------------------------- ### Retrieve ChipScoPy Examples Source: https://github.com/xilinx/chipscopy/blob/master/docs/chipscopy_installation.md Executes the script to extract example Python code and designs to a user-specified directory. ```shell (venv) > chipscopy-get-examples The following examples will be delivered to `/home/user/chipscopy-examples`: - ddr_example.ipynb - ddr_example.py - basic_detect.py ... ``` -------------------------------- ### Program the device with the example design Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/program/program.ipynb Executes either a flat or segmented programming flow based on the design manifest. ```python device = session.devices.filter_by(family=DEVICE_FAMILY).get() if PROG_DEVICE: # Verify the connected device matches the manifest design before programming. if not example_design.verify_device_idcode(device): raise RuntimeError("Device IDCODE does not match the manifest design.") # This example shows the explicit flat / segmented programming flows so # users can see what each step looks like. In other notebooks we just # call `example_design.program_device(device)` which dispatches to the # correct flow based on the manifest. programming_file = example_design.programming_file programming_flow = ( design_manifest.design_info.programming_flow if design_manifest else "flat" ) if programming_flow == "flat": print(f"Programming with flat flow: {programming_file}") device.program(programming_file) print("Device programmed successfully (flat flow)") elif programming_flow == "segmented": # The design directory contains separate boot and PLD PDI files. # We find them using glob patterns from the design_manifest (or defaults). from pathlib import Path design_path = Path(programming_file).parent boot_pattern = ( design_manifest.design_info.boot_pdi_pattern or "*_boot.pdi" if design_manifest else "*_boot.pdi" ) boot_files = list(design_path.glob(boot_pattern)) if not boot_files: raise RuntimeError( f"Boot PDI not found with pattern '{boot_pattern}' in {design_path}" ) boot_pdi = str(boot_files[0]) pld_pattern = ( design_manifest.design_info.pld_pdi_pattern or "*_pld.pdi" if design_manifest else "*_pld.pdi" ) pld_files = list(design_path.glob(pld_pattern)) if not pld_files: raise RuntimeError( f"PLD PDI not found with pattern '{pld_pattern}' in {design_path}" ) pld_pdi = str(pld_files[0]) print(f"Programming with segmented flow:") print(f" Step 1 - Boot PDI: {boot_pdi}") device.program(boot_pdi) print(" Boot PDI programmed") print(f" Step 2 - PLD PDI: {pld_pdi} (skip_reset=True)") device.program(pld_pdi, skip_reset=True) print(" PLD PDI programmed") print("Device programmed successfully (segmented flow)") else: raise ValueError(f"Unknown programming_flow: '{programming_flow}'") else: print("Skipping programming") ``` -------------------------------- ### Discover and setup debug cores Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ila_and_vio/vio.ipynb Initializes debug cores on the ChipScoPy server using a specified LTX file. ```python device.discover_and_setup_cores(ltx_file=PROBES_FILE) print(f"Debug cores are set up and ready for use.") ``` -------------------------------- ### Configure and Start Eye Scans Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/versal_gtyp/cpm_decoupling.ipynb Initializes eye scan parameters and starts the scan process for the target links. ```python eye_scans = create_eye_scans(target_objs=[link for link in links]) for eye_scan in eye_scans: eye_scan.params[EYE_SCAN_HORZ_STEP].value = 2 eye_scan.params[EYE_SCAN_VERT_STEP].value = 2 eye_scan.params[EYE_SCAN_HORZ_RANGE].value = "-0.500 UI to 0.500 UI" eye_scan.params[EYE_SCAN_VERT_RANGE].value = "100%" eye_scan.params[EYE_SCAN_TARGET_BER].value = 1e-5 eye_scan.start() print(f"Started eye scan {eye_scan}") ``` -------------------------------- ### Discover and Setup IBERT Core on Board 1 Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/cross_link_debug/cross_link_debug.ipynb Performs debug core discovery and initializes the first available IBERT core and its GT groups. ```python device_1.discover_and_setup_cores(ibert_scan=True) print("--> Debug core discovery complete for board 1") if len(device_1.ibert_cores) == 0: print("No IBERT core found with board 1! Exiting...") exit() # Use the first available IBERT core from the device ibert_0 = device_1.ibert_cores.at(index=0) if len(ibert_0.gt_groups) == 0: print("No GT Groups available for use! Exiting...") exit() print(f"GT Groups available with Board 1 - {[gt_group_obj.name for gt_group_obj in ibert_0.gt_groups]}") ``` -------------------------------- ### Initialize ChipScoPy Imports Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/memory/memory_example.ipynb Import necessary modules for session management and example design resolution. ```python import os from chipscopy import create_session, report_versions, delete_session from chipscopy.examples.mesa import resolve_example_design ``` -------------------------------- ### ManifestRegistry.get_manifest Source: https://github.com/xilinx/chipscopy/blob/master/docs/mesa.md Retrieves a MESA manifest for a specific platform and optional example ID. ```APIDOC ## get_manifest(platform: str, example_id: str | None = None) ### Description Get MESA manifest for `platform` and optional `example_id`. Returns the first manifest whose `hw_platform` matches. ### Parameters - **platform** (str) - Required - The hardware platform to search for. - **example_id** (str) - Optional - The specific example ID to filter by. ### Returns - **Manifest | None** - The matching manifest object or None if no match is found. ``` -------------------------------- ### Configuring Design and MESA Setup Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ddr/ddr_example.ipynb Defines server URLs and platform parameters, then resolves the design files using MESA or direct paths. ```python # ============================================================ # USER CONFIGURATION - Edit these for your own setup / design # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "vck190") EXAMPLE_ID = "ddr_example" PROG_DEVICE = True # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") ``` -------------------------------- ### Configuring Hardware and MESA Design Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ddr/lpddr_example.ipynb Sets up connection URLs and hardware platform parameters, resolving the design manifest for the LPDDR example. ```python # ============================================================ # USER CONFIGURATION - Edit these for your own setup / design # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "scu200") EXAMPLE_ID = "lpddr_example" PROG_DEVICE = True # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") ``` -------------------------------- ### Configure NoC Monitors Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/noc_perfmon/noc_perfmon_basic.ipynb Starts metric data collection by configuring monitors with traffic classes and sample counts. ```python # Configure Monitors # # As a precaution, it's a good idea to validate the desired nodes are enabled for the design. # Using the set of nodes and the desired sampling periods it's time to ask the service to start pushing metric data. Two additional arguments are required to this API. # # Traffic class # # This is a bit-or field of the requested traffic classes. Note, One monitor is dedicated to read traffic classes and the other to write--so all read TCs will apply to one channel and all write TCs to the other. `Best effort` is a good place to start. # # Number of Samples # # The number of samples allows for a burst of measurements to be taken and then the underlying service will tear down the monitors and stop pumping data back to the client. `-1` denotes that sampling shall continue indefinitely. # total number of samples to capture per node. # A finite value runs a bounded burst: the server tears down the monitors # after the burst and the event loop below exits on its own. Use -1 for # continuous mode (the loop then runs until the kernel is stopped). num_samples = 50 print("Setting up monitors for: ") for node in enable_list: print(node) # When overflow occurs the precision of the monitors must be traded for range # See the server API for more information extended_monitor_config = {"NOC_NMU512_X0Y0": {"tslide": 0x3}} # or None noc.configure_monitors( enable_list, sampling_intervals, (TC_BEW | TC_BER), num_samples, None, extended_monitor_config ) ``` -------------------------------- ### Read VIO port data structure Source: https://github.com/xilinx/chipscopy/blob/master/docs/vio.md Example format of the dictionary returned by read_ports. ```default port_data = { probe_in0: {'value': 3, 'activity': 'RR'}, ... , probe_out0: {'value': 456}, ... } ``` -------------------------------- ### Program the device with the example design Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ddr/lpddr_example.ipynb Filters the session devices by family and programs the device if the IDCODE matches the manifest. ```python # On SCU200, the device alias used to program the part over JTAG belongs to # `family="spartanu"` (matches the manifest `family` field). We filter by # `DEVICE_FAMILY` (which is `spartanu` for SCU200) to pick that alias for # the program step. prog_device = session.devices.filter_by(family=DEVICE_FAMILY).get() if PROG_DEVICE: if not example_design.verify_device_idcode(prog_device): raise RuntimeError("Device IDCODE does not match the manifest design.") example_design.program_device(prog_device) else: print("Skipping programming") ``` -------------------------------- ### Discover and setup the IBERT GTM core Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/versal_gtm/yk_scan_example.ipynb Initializes debug cores and verifies that the YK scan feature is supported by the identified GTM core. ```python device.discover_and_setup_cores(ibert_scan=True) print("--> Debug core discovery complete") if len(device.ibert_cores) == 0: print("No IBERT core found! Exiting...") exit() # Verify yk_scan feature is available on the GTM core if design_manifest and not design_manifest.has_feature("ibert_gtm", "yk_scan"): raise RuntimeError( "YK scan feature not available on this platform's GTM core. " "This example requires a GTM IBERT core with yk_scan support." ) print(f"IBERT cores on device: {[f'{ibert.name}' for ibert in device.ibert_cores]}") print("yk_scan feature confirmed for ibert_gtm") ``` -------------------------------- ### Configure NoC Monitors Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/noc_perfmon/noc_perfmon.ipynb Starts the NoC performance monitoring service with specified nodes, intervals, and traffic classes. ```python # Configure Monitors # # As a precaution, it's a good idea to validate the desired nodes are enabled for the design. # Using the set of nodes and the desired sampling periods it's time to ask the service to start pushing metric data. Two additional arguments are required to this API. # # Traffic class # # This is a bit-or field of the requested traffic classes. Note, One monitor is dedicated to read traffic classes and the other to write--so all read TCs will apply to one channel and all write TCs to the other. `Best effort` is a good place to start. # # Number of Samples # # The number of samples allows for a burst of measurements to be taken and then the underlying service will tear down the monitors and stop pumping data back to the client. `-1` denotes that sampling shall continue indefinitely. # total number of samples to capture per node. # A finite value runs a bounded burst: the server tears down the monitors # after the burst and the event loop below exits on its own. Use -1 for # continuous mode (the loop then runs until the kernel is stopped). num_samples = 50 print("Setting up monitors for: ") for node in enable_list: print(node) # Extended monitor configuration for NMU extended_monitor_config = {"NOC_NMU512_X0Y0": {"tslide": 0x3}} noc.configure_monitors( enable_list, sampling_intervals, (TC_BEW | TC_BER), num_samples, None, extended_monitor_config ) ``` -------------------------------- ### chipscopy.examples.mesa.resolve_example_design Source: https://github.com/xilinx/chipscopy/blob/master/docs/mesa.md Resolves programming and probes files for an example notebook. Supports either direct mode (user-provided files) or MESA mode (manifest-based lookup). ```APIDOC ## chipscopy.examples.mesa.resolve_example_design(hw_platform: str, example_id: str, programming_file: str = '', probes_file: str = '', device_family: str = 'versal') ### Description Resolves programming and probes files for an example notebook. Two modes are supported: Direct mode (if programming_file is provided) or MESA mode (manifest lookup). ### Parameters - **hw_platform** (str) - Required - Hardware platform identifier. - **example_id** (str) - Required - Example ID requested by the notebook. - **programming_file** (str) - Optional - Path to the PDI/programming file. - **probes_file** (str) - Optional - Path to the LTX/probes file. - **device_family** (str) - Optional - Device family string (default: 'versal'). ### Returns - **ExampleDesign** - The resolved design object. ``` -------------------------------- ### Define design manifest structure Source: https://github.com/xilinx/chipscopy/blob/master/docs/mesa.md Example of a manifest.json file defining design metadata, hardware platform, and enabled debug cores. ```json { "extends": "_base/versal_standard_cores.json", "design_info": { "design_name": "chipscopy_ced", "description": "ChipScoPy CED for VCK190", "hw_platform": "vck190", "programming_flow": "flat", "design_path": "vck190/production/chipscopy_ced", "family": "versal", "device": "xcvc1902", "board": "VCK190", "idcode": "0x14CA8093" }, "debug_cores": { "ibert_gty": { "enabled": true, "quad_names": ["Quad_205", "Quad_204", "Quad_201", "Quad_105"] } }, "supported_examples": [ "ila_and_vio", "link_and_eye_scan", "ddr_example" ], "metadata": { "version": "1.0.0", "maintainer": "AMD ChipScoPy Team" } } ``` -------------------------------- ### Create Session and Connect Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/jtag/jtag_example.ipynb Establish a connection to the hardware server and report version information. ```python session = create_session(hw_server_url=HW_URL) report_versions(session) ``` -------------------------------- ### Start YK Scan Source: https://github.com/xilinx/chipscopy/blob/master/docs/ibert/yk_scan.md Initiate a YK scan. The start method is non-blocking. ```python yk_scan_0.start() ``` -------------------------------- ### Start Status Monitor Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ila_and_vio/ila_monitor_status.ipynb Defines a callback function for monitoring completion and starts the asynchronous status monitor. ```python def monitor_status_done(future): print("\nCallback function monitor_status_done() called.") if not future.error: # future.result holds an ILAStatus object. print_status(future.result) # Called asynchronously, with done callback function. # This thread will continue executing while monitoring of the ILA Status will happen in the event thread. future = ila.monitor_status( max_wait_minutes=0.5, progress=status_progress, done=monitor_status_done ) ``` -------------------------------- ### Install ChipScoPy plotting dependencies Source: https://github.com/xilinx/chipscopy/blob/master/docs/ibert/eye_scan.md Install the necessary packages to enable eye scan plotting functionality. ```default pip install chipscopy[core-addons] ``` -------------------------------- ### Install Specific ChipScoPy Version Source: https://github.com/xilinx/chipscopy/blob/master/docs/chipscopy_installation.md Installs a specific version of ChipScoPy, with syntax variations for Linux and Windows environments. ```shell # installs 2026.1 version of chipscopy (venv) > python -m pip install 'chipscopy==2026.1.*' ``` ```shell # installs 2026.1 version of chipscopy (venv) > python -m pip install chipscopy==2026.1.* ``` -------------------------------- ### discover_and_setup_cores Source: https://github.com/xilinx/chipscopy/blob/master/docs/device.md Scans the device for various debug cores such as ILA, VIO, IBERT, and others. ```APIDOC ## discover_and_setup_cores ### Description Scan the device for debug cores. This operation may take some time depending on the scope of the scan. ### Parameters - **hub_address_list** (List[int]) - Optional - List of debug hub addresses to scan - **ltx_file** (Path | str) - Optional - LTX file containing debug hub addresses - **ila_scan** (bool) - Optional - Scan device for ILAs - **vio_scan** (bool) - Optional - Scan device for VIOs - **ibert_scan** (bool) - Optional - Scan device for IBERTs - **pcie_scan** (bool) - Optional - Scan device for PCIEs - **noc_scan** (bool) - Optional - Scan device for NOC - **ddr_scan** (bool) - Optional - Scan device for DDRs - **hbm_scan** (bool) - Optional - Scan device for HBMs - **sysmon_scan** (bool) - Optional - Scan device for System Monitor - **setup_timeout** (int) - Optional - Maximum time in seconds to wait for core setup (default=10) ``` -------------------------------- ### Install Dependencies for (t)csh Users Source: https://github.com/xilinx/chipscopy/blob/master/docs/chipscopy_installation.md Installs optional support packages using escaped brackets for (t)csh shell compatibility. ```shell (venv) > python -m pip install "chipscopy[core-addons]" (venv) > python -m pip install "chipscopy[jupyter]" ``` -------------------------------- ### Session.setup_stimgen Source: https://github.com/xilinx/chipscopy/blob/master/docs/session/references.md Initializes StimGen support on the chipscope server. ```APIDOC ## setup_stimgen(params: dict = None) -> StimgenClient ### Description Configures StimGen support on the connected cs_server. ### Parameters - **params** (dict) - Optional - Configuration arguments. Includes 'sg4db' (str): Path to the .sg4db file. ### Returns - **StimgenClient** - An instance of the StimgenClient. ``` -------------------------------- ### Install specific ChipScoPy version Source: https://github.com/xilinx/chipscopy/blob/master/FAQ.md Use pip to install a specific version of ChipScoPy to match your Vivado tool version. ```bash pip install chipscopy==2022.1.* ``` -------------------------------- ### Create and Start Parallel Eye Scans Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/cross_link_debug/cross_link_debug.ipynb Initializes eye scan objects for multiple links and configures scan parameters before starting the process in parallel. ```python eye_scans = create_eye_scans(target_objs=[link for link in internal_loopback_board1_board2_CH0_links]) for eye_scan in eye_scans: eye_scan.params[EYE_SCAN_HORZ_STEP].value = 10 eye_scan.params[EYE_SCAN_VERT_STEP].value = 10 eye_scan.params[EYE_SCAN_HORZ_RANGE].value = "-0.500 UI to 0.500 UI" eye_scan.params[EYE_SCAN_VERT_RANGE].value = "100%" eye_scan.params[EYE_SCAN_TARGET_BER].value = 1e-5 eye_scan.start() print(f"Started eye scan {eye_scan}") ``` -------------------------------- ### Initialize Imports and Environment Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/sysmon/sysmon_example.ipynb Imports necessary modules and sets up the environment variables and design manifest for the target hardware. ```python import os import time from chipscopy import __version__, dm from chipscopy.examples.mesa import resolve_example_design from chipscopy import create_session, report_versions, delete_session ``` ```python # ============================================================ # USER CONFIGURATION - Edit these for your own setup / design # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "vck190") EXAMPLE_ID = "sysmon_example" PROG_DEVICE = True # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" # =========================================================== # --- MESA setup (no edits needed below) --- example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") ``` -------------------------------- ### Create a session using factory method Source: https://github.com/xilinx/chipscopy/blob/master/docs/session.md Initializes a session by connecting to the ChipScoPy and hardware servers. ```python from chipscopy import create_session CS_URL = "TCP:localhost:3042" HW_URL = "TCP:localhost:3121" session = create_session(cs_server_url=CS_URL, hw_server_url=HW_URL) ``` -------------------------------- ### Print Configuration Details Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ila_and_vio/ila_advanced_trigger.ipynb Outputs the current hardware and software configuration paths. ```python print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") print(f"PROGRAMMING_FILE: {PROGRAMMING_FILE}") print(f"PROBES_FILE: {PROBES_FILE}") ``` -------------------------------- ### get(property_names) Source: https://github.com/xilinx/chipscopy/blob/master/docs/ibert/property.md Fetches the value of a property or list of properties from the cs_server cache. ```APIDOC ## get(property_names) ### Description Fetches the value of the property from cs_server, which returns the value stored in the object. Note that this value is cached and may not reflect the current hardware state. ### Parameters - **property_names** (str or list) - Required - The name of the property or a list of property names to retrieve. ### Returns - **dict** - A dictionary containing the property names and their cached values. ``` -------------------------------- ### chipscopy.examples.mesa.get_all_platforms Source: https://github.com/xilinx/chipscopy/blob/master/docs/mesa.md Returns a list of all available platforms. ```APIDOC ## chipscopy.examples.mesa.get_all_platforms() ### Description Retrieves a list of all available hardware platforms. ### Returns - **List[str]** - A list of platform identifiers. ``` -------------------------------- ### Get Device from Session Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/memory/memory_example.ipynb Filters and retrieves a specific device from the active session. ```python versal_device = session.devices.filter_by(family=DEVICE_FAMILY).get() print(versal_device) ``` -------------------------------- ### Read VIO probe data structure Source: https://github.com/xilinx/chipscopy/blob/master/docs/vio.md Example format of the dictionary returned by read_probes. ```default port_data = { foo_probe: {'value': 3, 'activity': 'RR'}, ... , bar_probe: {'value': 456}, ... } ``` -------------------------------- ### Initialize Imports and Environment Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/noc_perfmon/noc_perfmon_basic.ipynb Import required ChipScoPy modules and configure environment variables for server URLs and hardware platform settings. ```python import os from time import sleep import matplotlib # for nbconvert'd script from chipscopy.api.noc import ( TC_BEW, TC_BER, NoCPerfMonNodeListener, ) from chipscopy.examples.mesa import resolve_example_design from chipscopy.api.noc.plotting_utils import MeasurementPlot from chipscopy import create_session, report_versions, delete_session ``` ```python # ============================================================ # USER CONFIGURATION - Edit these for your own setup / design # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "vck190") EXAMPLE_ID = "noc_perfmon_basic" PROG_DEVICE = True # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") ``` -------------------------------- ### Configure Hardware and Design Paths Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/noc_perfmon/noc_perfmon.ipynb Define server URLs and platform settings, or resolve design files using MESA. ```python # ============================================================ # USER CONFIGURATION - Edit these for your own setup / design # ============================================================ CS_URL = os.getenv("CS_SERVER_URL", "TCP:localhost:3042") HW_URL = os.getenv("HW_SERVER_URL", "TCP:localhost:3121") HW_PLATFORM = os.getenv("HW_PLATFORM", "vck190") EXAMPLE_ID = "noc_perfmon" PROG_DEVICE = True # Direct mode: set these to use your own design files (skips MESA). PROGRAMMING_FILE = "" PROBES_FILE = "" # ============================================================ # --- MESA setup (no edits needed below) --- example_design = resolve_example_design( HW_PLATFORM, EXAMPLE_ID, programming_file=PROGRAMMING_FILE, probes_file=PROBES_FILE, ) design_manifest = example_design.manifest # None in direct mode DEVICE_FAMILY = example_design.device_family PROGRAMMING_FILE = example_design.programming_file PROBES_FILE = example_design.probes_file example_design.print_summary() print(f"HW_URL: {HW_URL}") print(f"CS_URL: {CS_URL}") ``` -------------------------------- ### Create Session for Board 1 Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/cross_link_debug/cross_link_debug.ipynb Initializes a session for the first hardware server and reports version information. ```python session_1 = create_session(cs_server_url=CS_URL, hw_server_url=HW_URL_1) report_versions(session_1) ``` -------------------------------- ### Get Supported Sampling Periods Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/noc_perfmon/noc_perfmon.ipynb Retrieves the hardware-supported sampling periods for the NoC domains. ```python supported_periods = noc.get_supported_sampling_periods(100/3, {'DDRMC_X0Y0': 800.0}) print("Supported sampling periods:") for domain, periods in supported_periods.items(): print(f" {domain}:") for p in periods: print(f" {p:.0f}ms", end="") print() ``` -------------------------------- ### Initialize ChipScoPy Session Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ila_and_vio/ila_advanced_trigger.ipynb Establishes a connection to the hardware and chipscope servers and displays version information. ```python print(f"Using chipscopy api version: {chipscopy.__version__}") session = create_session(cs_server_url=CS_URL, hw_server_url=HW_URL) report_versions(session) ``` -------------------------------- ### Start an Eye Scan Source: https://github.com/xilinx/chipscopy/blob/master/docs/ibert/eye_scan.md Initiates an eye scan. The scan runs in a non-blocking manner by default. ```python eye_scan_0.start() ``` ```python eye_scan_0.start(show_progress_bar=False) ``` -------------------------------- ### Write VIO probe values Source: https://github.com/xilinx/chipscopy/blob/master/docs/vio.md Example usage of write_probes to set output probe values. ```default write_probes({'foo': 1000, 'bar': 0x100}) ``` -------------------------------- ### Initialize Imports Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/versal_gtyp/cpm_decoupling.ipynb Import necessary ChipScoPy modules and IBERT API constants for device interaction. ```python import os from chipscopy import create_session, delete_session, report_versions, report_hierarchy from chipscopy.examples.mesa import resolve_example_design from chipscopy.api.ibert.aliases import ( PATTERN, RX_LOOPBACK, EYE_SCAN_HORZ_STEP, EYE_SCAN_VERT_STEP, EYE_SCAN_HORZ_RANGE, EYE_SCAN_VERT_RANGE, EYE_SCAN_TARGET_BER, ) from chipscopy.api.ibert import create_links, create_eye_scans ``` -------------------------------- ### initialize(done: DoneHWCommand = None) Source: https://github.com/xilinx/chipscopy/blob/master/docs/noc-perfmon/references/noc.md Collects clocking information and refreshes the client's view of root node properties. Must be called before requesting clocking information. ```APIDOC ## initialize ### Description Collects clocking information for client use and refreshes the client's view of specific properties for the root node. This call must be invoked before clocking information is requested. ### Parameters - **done** (DoneHWCommand) - Optional - Command callback invoked when the response is received. ``` -------------------------------- ### Write VIO port values Source: https://github.com/xilinx/chipscopy/blob/master/docs/vio.md Example usage of write_ports to set output port values. ```default write_ports({'probe_out0': 1000, 'probe_out1': 0x100}) ``` -------------------------------- ### Discover and set up the VCU128 IBERT core Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ibert/cross_link_debug/cross_link_debug.ipynb Initializes debug cores and selects the first available IBERT core and GT group for further operations. ```python device_2.discover_and_setup_cores(ibert_scan=True) print("--> Debug core discovery complete for board 2") if len(device_2.ibert_cores) == 0: print("No IBERT core found with board 1! Exiting...") exit() # Use the first available IBERT core from the device ibert_2 = device_2.ibert_cores.at(index=1) if len(ibert_2.gt_groups) == 0: print("No GT Groups available for use! Exiting...") exit() print(f"GT Groups available with Board 1 - {[gt_group_obj.name for gt_group_obj in ibert_2.gt_groups]}") ``` -------------------------------- ### Get Supported Sampling Periods Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/noc_perfmon/noc_perfmon_basic.ipynb Retrieves hardware-supported sampling periods for the configured clock domains. ```python supported_periods = noc.get_supported_sampling_periods( 100/3, {'DDRMC_X0Y0': 800.0} ) print("Supported sampling periods:") for domain, periods in supported_periods.items(): print(f" {domain}:") for p in periods: print(f" {p:.0f}ms", end="") print() ``` -------------------------------- ### Initialize ILA and VIO instances Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ila_and_vio/ila_and_vio.ipynb Retrieves ILA and VIO core instances from the design manifest or defaults to the first available core. ```python # Get ILA instance from design_manifest if available, otherwise use first available if design_manifest and design_manifest.has_core("ila"): ila_config = design_manifest.debug_cores["ila"] if hasattr(ila_config, 'core_instances') and ila_config.core_instances: ila_name = ila_config.core_instances[0]["name"] ila = device.ila_cores.get(name=ila_name) print(f"Using ILA from design_manifest: {ila_name}") else: ila = device.ila_cores[0] if device.ila_cores else None print(f"Using first available ILA") else: ila = device.ila_cores[0] if device.ila_cores else None print(f"Using first available ILA") # Get VIO instance from design_manifest if available if design_manifest and design_manifest.has_core("vio"): vio_config = design_manifest.debug_cores["vio"] if hasattr(vio_config, 'core_instances') and vio_config.core_instances: vio_name = vio_config.core_instances[0]["name"] vio = device.vio_cores.get(name=vio_name) print(f"Using VIO from design_manifest: {vio_name}") else: vio = device.vio_cores[0] if device.vio_cores else None print(f"Using first available VIO") else: vio = device.vio_cores[0] if device.vio_cores else None print(f"Using first available VIO") if ila: print(f"ILA: {ila.core_info.uuid} {ila.name}") if vio: print(f"VIO: {vio.core_info.uuid} {vio.name}") ``` -------------------------------- ### Get Detailed Calibration Stages Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ddr/ddr_example.ipynb Retrieves and prints the detailed calibration stages for each selected DDR controller. ```python for entry in selected_ddrs: ddr = entry["ddr"] print(f"\n{'='*60}") print(f"DDRMC {ddr.mc_index} - Calibration Stages") print(f"{'='*60}") props = ddr.get_cal_stages() print(pprint.pformat(sorted(props.items()), indent=2)) ``` -------------------------------- ### Get Calibration PASS/FAIL Status Source: https://github.com/xilinx/chipscopy/blob/master/chipscopy/examples/ddr/ddr_example.ipynb Iterates through selected DDR controllers to print their overall calibration status. ```python for entry in selected_ddrs: ddr = entry["ddr"] print(f"\n{'='*60}") print(f"DDRMC {ddr.mc_index} ({ddr.name}) - Type: {entry['type']}") print(f"{'='*60}") print(f" Calibration status: {ddr.get_cal_status()}") ```