Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Debug vitis exec
Browse files Browse the repository at this point in the history
  • Loading branch information
xlz-jbleclere committed Feb 19, 2021
1 parent aa6abe7 commit 3b7bc56
Showing 1 changed file with 85 additions and 8 deletions.
93 changes: 85 additions & 8 deletions tests/test_other_refdesign.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,67 +141,144 @@ def test_vitis_2activator_vhdl_250_125(pytestconfig, conf_json, cred_json, async
"""
driver_name = 'xilinx_xrt'
design_name = 'vitis_2activator_vhdl_250_125'
drmclk_freq_ref = 125
axiclk_freq_ref = 250
# Create test objects
drm_manager, activators = create_objects(driver_name, design_name, pytestconfig,
conf_json, cred_json, async_handler, basic_log_file)
# Run test
run_basic_test(drm_manager, activators)
# Check result
log_content = basic_log_file.read()
assert search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = 250 MHz', log_content)
assert search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = 125 MHz', log_content)
drmclk_match = search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
drmclk_freq = int(drmclk_match.group(1))
assert drmclk_freq_ref*0.9 < drmclk_freq < drmclk_freq_ref*1.1
axiclk_match = search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
axiclk_freq = int(axiclk_match.group(1))
assert axiclk_freq_ref*0.9 < axiclk_freq < axiclk_freq_ref*1.1
basic_log_file.remove()


@pytest.mark.skip
def test_vitis_2activator_50_125(pytestconfig, conf_json, cred_json, async_handler, basic_log_file):
"""
Test a vitis configuration: dual clock kernels with AXI clock < DRM clock
"""
driver_name = 'xilinx_xrt'
design_name = 'vitis_2activator_50_125'
drmclk_freq_ref = 125
axiclk_freq_ref = 50
# Create test objects
drm_manager, activators = create_objects(driver_name, design_name, pytestconfig,
conf_json, cred_json, async_handler, basic_log_file)
# Run test
run_basic_test(drm_manager, activators)
# Check result
log_content = basic_log_file.read()
assert search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = 50 MHz', log_content)
assert search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = 125 MHz', log_content)
drmclk_match = search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
drmclk_freq = int(drmclk_match.group(1))
assert drmclk_freq_ref*0.9 < drmclk_freq < drmclk_freq_ref*1.1
axiclk_match = search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
axiclk_freq = int(axiclk_match.group(1))
assert axiclk_freq_ref*0.9 < axiclk_freq < axiclk_freq_ref*1.1
basic_log_file.remove()


@pytest.mark.skip
def test_vitis_2activator_slr_250_125(pytestconfig, conf_json, cred_json, async_handler, basic_log_file):
"""
Test a vitis configuration: SLR crossing with dual clock kernels
"""
driver_name = 'xilinx_xrt'
design_name = 'vitis_2activator_slr_250_125'
drmclk_freq_ref = 125
axiclk_freq_ref = 250
# Create test objects
drm_manager, activators = create_objects(driver_name, design_name, pytestconfig,
conf_json, cred_json, async_handler, basic_log_file)
# Run test
run_basic_test(drm_manager, activators)
# Check result
log_content = basic_log_file.read()
assert search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = 250 MHz', log_content)
assert search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = 125 MHz', log_content)
drmclk_match = search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
drmclk_freq = int(drmclk_match.group(1))
assert drmclk_freq_ref*0.9 < drmclk_freq < drmclk_freq_ref*1.1
axiclk_match = search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
axiclk_freq = int(axiclk_match.group(1))
assert axiclk_freq_ref*0.9 < axiclk_freq < axiclk_freq_ref*1.1
basic_log_file.remove()


@pytest.mark.skip
def test_vitis_2activator_125_125(pytestconfig, conf_json, cred_json, async_handler, basic_log_file):
"""
Test a vitis configuration: dual clock kernels with AXI clock = DRM clock
"""
driver_name = 'xilinx_xrt'
design_name = 'vitis_2activator'
drmclk_freq_ref = 125
axiclk_freq_ref = 125
# Create test objects
drm_manager, activators = create_objects(driver_name, design_name, pytestconfig,
conf_json, cred_json, async_handler, basic_log_file)
# Run test
run_basic_test(drm_manager, activators)
# Check result
log_content = basic_log_file.read()
assert search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = 125 MHz', log_content)
assert search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = 125 MHz', log_content)
drmclk_match = search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
drmclk_freq = int(drmclk_match.group(1))
assert drmclk_freq_ref*0.9 < drmclk_freq < drmclk_freq_ref*1.1
axiclk_match = search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
axiclk_freq = int(axiclk_match.group(1))
assert axiclk_freq_ref*0.9 < axiclk_freq < axiclk_freq_ref*1.1
basic_log_file.remove()


@pytest.mark.skip
def test_vitis_5activator(pytestconfig, conf_json, cred_json, async_handler, basic_log_file):
"""
Test a vitis configuration: 5 activator and high density design
"""
driver_name = 'xilinx_xrt'
design_name = 'vitis_5activator'
drmclk_freq_ref = 125
axiclk_freq_ref = 125
# Create test objects
drm_manager, activators = create_objects(driver_name, design_name, pytestconfig,
conf_json, cred_json, async_handler, basic_log_file)
# Run test
run_basic_test(drm_manager, activators)
# Check result
log_content = basic_log_file.read()
drmclk_match = search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
drmclk_freq = int(drmclk_match.group(1))
assert drmclk_freq_ref*0.9 < drmclk_freq < drmclk_freq_ref*1.1
axiclk_match = search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
axiclk_freq = int(axiclk_match.group(1))
assert axiclk_freq_ref*0.9 < axiclk_freq < axiclk_freq_ref*1.1
basic_log_file.remove()


@pytest.mark.skip
def test_vitis_2activator_350_350(pytestconfig, conf_json, cred_json, async_handler, basic_log_file):
"""
Test a vitis configuration: 2 activators and high frequency
"""
driver_name = 'xilinx_xrt'
design_name = 'vitis_5activator'
drmclk_freq_ref = 350
axiclk_freq_ref = 350
# Create test objects
drm_manager, activators = create_objects(driver_name, design_name, pytestconfig,
conf_json, cred_json, async_handler, basic_log_file)
# Run test
run_basic_test(drm_manager, activators)
# Check result
log_content = basic_log_file.read()
drmclk_match = search(r'Frequency detection of drm_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
drmclk_freq = int(drmclk_match.group(1))
assert drmclk_freq_ref*0.9 < drmclk_freq < drmclk_freq_ref*1.1
axiclk_match = search(r'Frequency detection of s_axi_aclk counter after .+ => estimated frequency = (\d+) MHz', log_content)
axiclk_freq = int(axiclk_match.group(1))
assert axiclk_freq_ref*0.9 < axiclk_freq < axiclk_freq_ref*1.1
basic_log_file.remove()

0 comments on commit 3b7bc56

Please sign in to comment.