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

Commit

Permalink
Complete migration doc. Add log file to track random issues with test…
Browse files Browse the repository at this point in the history
…_header_error_on_key and test_hdk_stability_on_programming
  • Loading branch information
xlz-jbleclere committed Sep 9, 2020
1 parent 8efa612 commit 2b5855d
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 3 deletions.
12 changes: 12 additions & 0 deletions doc/drm_hardware_integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,18 @@ the error codes can help to debug (see error table below).
.. image:: _static/behavior.png
:target: _static/behavior.png

The `drm_activator_0xVVVVLLLLNNNNVVVV_sim_pkg.(vhdl|sv)` contains parameters used
to tune the simulation configuration and behavior. In particular, it allows you
to use a DRM Controller BFM directly embedded in the DRM Activator to unlock the DRM Activator
without the need for an Internet connection to the Accelize License Web Server.
At the opposite, the BFM can be disabled, especially for co-simulation (using C application
testbench).

.. warning:: To run a cosimulation, you will need to:
- Disable the BFM
- Set the environment variable `DRM_CONTROLLER_TIMEOUT_IN_MICRO_SECONDS` to
1000000000 because of the slowness of the simulation execution.

Signals for Debug
-----------------

Expand Down
19 changes: 19 additions & 0 deletions doc/drm_migration_description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,26 @@ From v2.x to 3.x
From v3.x to 4.x
~~~~~~~~~~~~~~~~

- `common` folder:

- in the `common` folder there is now a specific source for xilinx simulator tool.

- `activator` folder:

- DRM Activator top-level files (VHDL and Verilog) have been prefixed with 'top_' and have been moved
to the `sim` et `syn` folder for the simulation and synthesis respectively.
- `simu` folder name has been replaced by `sim` and `rtl` has been replace by `core`.
- A DRM Controller BFM has been embedded directly in the Activator simulation model to unlock the IP without
the need for an Internet connection to the Accelize License Web Server.
- `drm_activator_0x1003000b00010001_sim_pkg.(vhdl|sv)` file has been created to configure the simulation
configuration and behavior. Parameters are detailed directly in the file.
- A `constraints.sdc` file has been added in the `core` folder. It is required when `drm_aclk` and `ip_core_aclk`
are different.

- `controller` folder:

- RTL source files have been moved to a `rtl` folder and split in 3 different sub-folders: `core` contains
the core of the IP, `sim` and `syn` contains the top level of the Controller IP in VHDL and SystemVerilog for
the simulation and synthesis respectively. Top level files are prefixed with 'top_'.
- `sdaccel` and `vitis` folders has been create: they contains the scirpt and makefile to generate the kernel
for those specific flows.
2 changes: 1 addition & 1 deletion tests/test_controller_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def test_configuration_file_empty_and_corrupted_product_id(accelize_drm, conf_js
driver.program_fpga(fpga_image_bkp)


@pytest.mark.skip(reason='Not supported')
@pytest.mark.skip(reason='Two concurrent objects on the same board is not supported')
def test_2_drm_manager_concurrently(accelize_drm, conf_json, cred_json, async_handler):
"""Test errors when 2 DrmManager instances are used."""

Expand Down
7 changes: 6 additions & 1 deletion tests/test_drm_license_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Test metering and floating behaviors of DRM Library.
"""
import pytest
from os import remove
from time import sleep
from random import randint
from datetime import datetime, timedelta
Expand All @@ -28,6 +29,10 @@ def test_header_error_on_key(accelize_drm, conf_json, cred_json, async_handler,

conf_json.reset()
conf_json['licensing']['url'] = request.url + 'test_header_error_on_key'
logpath = accelize_drm.create_log_path(whoami())
conf_json['settings']['log_file_verbosity'] = accelize_drm.create_log_level(0)
conf_json['settings']['log_file_type'] = 1
conf_json['settings']['log_file_path'] = logpath
conf_json.save()

drm_manager = accelize_drm.DrmManager(
Expand All @@ -48,7 +53,7 @@ def test_header_error_on_key(accelize_drm, conf_json, cred_json, async_handler,
assert async_handler.get_error_code(str(excinfo.value)) == accelize_drm.exceptions.DRMCtlrError.error_code
assert "License header check error" in str(excinfo.value)
async_cb.assert_NoError()

remove(logpath)


@pytest.mark.no_parallel
Expand Down
2 changes: 1 addition & 1 deletion tests/test_function_arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ def test_drm_manager_get_and_set_bad_arguments(accelize_drm, conf_json, cred_jso
def test_c_unittests(accelize_drm, exec_func):
"""Test errors when missing arguments are given to DRM Controller Constructor"""
driver = accelize_drm.pytest_fpga_driver[0]
if driver._name != 'aws':
if 'aws' not in accelize_drm..pytest_fpga_driver_name:
pytest.skip("C unit-tests are only supported with AWS driver.")

exec_lib = exec_func.load('unittests', driver._fpga_slot_id)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_hdk_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Test node-locked behavior of DRM Library.
"""
import pytest
from os import remove
from itertools import groupby
from re import match, search, IGNORECASE

Expand All @@ -15,6 +16,13 @@ def test_hdk_stability_on_programming(accelize_drm, conf_json, cred_json, async_
async_cb.reset()
drm_manager = None

conf_json.reset()
logpath = accelize_drm.create_log_path(whoami())
conf_json['settings']['log_file_verbosity'] = accelize_drm.create_log_level(0)
conf_json['settings']['log_file_type'] = 1
conf_json['settings']['log_file_path'] = logpath
conf_json.save()

nb_reset = 10
for i in range(nb_reset):
# Program FPGA with lastest HDK per major number
Expand All @@ -36,6 +44,7 @@ def test_hdk_stability_on_programming(accelize_drm, conf_json, cred_json, async_
drm_manager.deactivate()
assert not drm_manager.get('license_status')
async_cb.assert_NoError()
remove(logpath)


@pytest.mark.minimum
Expand Down
5 changes: 5 additions & 0 deletions tests/test_retry_mechanism.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_api_retry_disabled(accelize_drm, conf_json, cred_json, async_handler, l
log_content, IGNORECASE)
assert not search(r'attempt', log_content, IGNORECASE)
async_cb.assert_NoError()
remove(logpath)


@pytest.mark.no_parallel
Expand Down Expand Up @@ -101,6 +102,7 @@ def test_api_retry_enabled(accelize_drm, conf_json, cred_json, async_handler, li
nb_attempts_expected = retry_duration / retry_sleep
assert nb_attempts_expected - 1 <= nb_attempts <= nb_attempts_expected + 1
async_cb.assert_NoError()
remove(logpath)


@pytest.mark.no_parallel
Expand Down Expand Up @@ -228,3 +230,6 @@ def test_retry_on_no_connection(accelize_drm, conf_json, cred_json, async_handle
attempts_list = [int(e) for e in findall(r'Attempt #(\d+) to obtain a new License failed with message', log_content)]
assert len(attempts_list) == nb_retry
assert sorted(list(attempts_list)) == list(range(1,nb_retry+1))
async_cb.assert_NoError()
remove(logpath)

0 comments on commit 2b5855d

Please sign in to comment.