From 2b5855d268101e9a9e88e1df7a1f05748ac7de3b Mon Sep 17 00:00:00 2001 From: jbleclere Date: Wed, 9 Sep 2020 16:43:51 +0000 Subject: [PATCH] Complete migration doc. Add log file to track random issues with test_header_error_on_key and test_hdk_stability_on_programming --- doc/drm_hardware_integration.rst | 12 ++++++++++++ doc/drm_migration_description.rst | 19 +++++++++++++++++++ tests/test_controller_memory.py | 2 +- tests/test_drm_license_error.py | 7 ++++++- tests/test_function_arguments.py | 2 +- tests/test_hdk_compatibility.py | 9 +++++++++ tests/test_retry_mechanism.py | 5 +++++ 7 files changed, 53 insertions(+), 3 deletions(-) diff --git a/doc/drm_hardware_integration.rst b/doc/drm_hardware_integration.rst index 0fafa47c..e3e7960b 100644 --- a/doc/drm_hardware_integration.rst +++ b/doc/drm_hardware_integration.rst @@ -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 ----------------- diff --git a/doc/drm_migration_description.rst b/doc/drm_migration_description.rst index fe13a37e..dd87a3b3 100644 --- a/doc/drm_migration_description.rst +++ b/doc/drm_migration_description.rst @@ -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. diff --git a/tests/test_controller_memory.py b/tests/test_controller_memory.py index aeb61e3f..bb3c02e5 100644 --- a/tests/test_controller_memory.py +++ b/tests/test_controller_memory.py @@ -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.""" diff --git a/tests/test_drm_license_error.py b/tests/test_drm_license_error.py index 2ee29ca9..a8c7892b 100644 --- a/tests/test_drm_license_error.py +++ b/tests/test_drm_license_error.py @@ -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 @@ -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( @@ -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 diff --git a/tests/test_function_arguments.py b/tests/test_function_arguments.py index d53e4951..ce2278e7 100644 --- a/tests/test_function_arguments.py +++ b/tests/test_function_arguments.py @@ -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) diff --git a/tests/test_hdk_compatibility.py b/tests/test_hdk_compatibility.py index 14d66421..099818d6 100644 --- a/tests/test_hdk_compatibility.py +++ b/tests/test_hdk_compatibility.py @@ -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 @@ -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 @@ -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 diff --git a/tests/test_retry_mechanism.py b/tests/test_retry_mechanism.py index 53cc0343..101ab29b 100644 --- a/tests/test_retry_mechanism.py +++ b/tests/test_retry_mechanism.py @@ -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 @@ -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 @@ -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) +