From d64e0d05342497c67280d02c18cfe88e9cfe8b68 Mon Sep 17 00:00:00 2001 From: Dean Liu Date: Mon, 30 Jan 2023 13:15:41 -0500 Subject: [PATCH] Remove ACL_CONTEXT_MSIM This is set by the flag CL_CONTEXT_MSIM_DEVICE_INTELFPGA, is unused and safe to remove. Detailed reasons: The MSIM flow is the original simulation flow that involves manually launching the simulator, and it is for internal-use-only. The introduction of MPSIM replaces the use of MSIM and is the public flow that users should use as of now. We as internal developers no longer use the MSIM flow, and based off the above two points, it is safe to remove support for the MSIM flow Tests Done: Runtime Unit Tests --- include/acl_globals.h | 1 - include/acl_hal.h | 6 ------ include/acl_types.h | 3 +-- src/acl_globals.cpp | 24 ------------------------ src/acl_platform.cpp | 7 ++----- 5 files changed, 3 insertions(+), 38 deletions(-) diff --git a/include/acl_globals.h b/include/acl_globals.h index bcc7e8ba..fa69c74a 100644 --- a/include/acl_globals.h +++ b/include/acl_globals.h @@ -53,7 +53,6 @@ cl_bool acl_init_from_hal_discovery(void); // Set *use_offline_ret_only = 0 #define ACL_CONTEXT_OFFLINE_AND_AUTODISCOVERY 0 #define ACL_CONTEXT_OFFLINE_ONLY 1 -#define ACL_CONTEXT_MSIM 3 #define ACL_CONTEXT_MPSIM 4 const char *acl_get_offline_device_user_setting(int *use_offline_only_ret); diff --git a/include/acl_hal.h b/include/acl_hal.h index 5c51373c..c0a4e87a 100644 --- a/include/acl_hal.h +++ b/include/acl_hal.h @@ -262,12 +262,6 @@ void acl_reset_hal(void); extern int debug_mode; int acl_print_debug_msg(const char *msg, ...); -#ifdef __linux__ -/// Each HAL must define this function even if it does nothing at all. -/// Assume that we'll only link to one HAL. -ACL_HAL_EXPORT const acl_hal_t * -acl_msim_get_system_definition(acl_system_def_t *system) WEAK; -#endif ACL_HAL_EXPORT const acl_hal_t * acl_mmd_get_system_definition(acl_system_def_t *system, acl_mmd_library_names_t *_libraries_to_load); diff --git a/include/acl_types.h b/include/acl_types.h index fd979d3b..5300ee5d 100644 --- a/include/acl_types.h +++ b/include/acl_types.h @@ -1575,8 +1575,7 @@ typedef struct _cl_platform_id // any. std::string offline_device; // Cache context offline mode specified by environment variables - // CL_CONTEXT_OFFLINE_DEVICE_INTELFPGA, CL_CONTEXT_MPSIM_DEVICE_INTELFPGA - // or CL_CONTEXT_MSIM_DEVICE_INTELFPGA + // CL_CONTEXT_OFFLINE_DEVICE_INTELFPGA or CL_CONTEXT_MPSIM_DEVICE_INTELFPGA int offline_mode; // Should we track and automatically release leaked objects? diff --git a/src/acl_globals.cpp b/src/acl_globals.cpp index 5c3f73bf..8d8ac887 100644 --- a/src/acl_globals.cpp +++ b/src/acl_globals.cpp @@ -117,22 +117,6 @@ const char *acl_get_offline_device_user_setting(int *use_offline_only_ret) { if (setting) { use_offline_only = ACL_CONTEXT_MPSIM; result = setting; - } else { - setting = acl_getenv("CL_CONTEXT_MSIM_DEVICE_INTELFPGA"); - setting_deprecated = acl_getenv("CL_CONTEXT_MSIM_DEVICE_ALTERA"); - if (!setting && setting_deprecated) { - setting = setting_deprecated; - if (0 == warn_depr3) { - fprintf(stderr, "[Runtime Warning]: CL_CONTEXT_MSIM_DEVICE_ALTERA " - "has been deprecated. Use " - "CL_CONTEXT_MSIM_DEVICE_INTELFPGA instead.\n"); - warn_depr3 = 1; - } - } - if (setting) { - use_offline_only = ACL_CONTEXT_MSIM; - result = 0; - } } } @@ -186,14 +170,6 @@ cl_bool acl_init_from_hal_discovery(void) { case ACL_CONTEXT_OFFLINE_ONLY: board_hal = acl_get_offline_hal(); break; -#ifdef __linux__ - case ACL_CONTEXT_MSIM: - if (&acl_msim_get_system_definition == NULL) { - return CL_FALSE; - } - board_hal = acl_msim_get_system_definition(&builtin_prog_def_value); - break; -#endif default: // Not a valid setting so don't know which HAL to load return CL_FALSE; diff --git a/src/acl_platform.cpp b/src/acl_platform.cpp index 46986cec..514c8642 100644 --- a/src/acl_platform.cpp +++ b/src/acl_platform.cpp @@ -390,9 +390,6 @@ void acl_init_platform(void) { // offline device, if it exists break; case ACL_CONTEXT_MPSIM: -#ifdef __linux__ - case ACL_CONTEXT_MSIM: -#endif acl_platform.num_devices = acl_platform.initial_board_def ->num_devices; // Simulator has its mmd, so it is loaded like an @@ -660,10 +657,10 @@ static void l_initialize_devices(const acl_system_def_t *present_board_def, // shipped_board_def populated earlier in l_initialize_offline_devices if (offline_mode == ACL_CONTEXT_OFFLINE_AND_AUTODISCOVERY || - offline_mode == ACL_CONTEXT_MSIM || offline_mode == ACL_CONTEXT_MPSIM) { + offline_mode == ACL_CONTEXT_MPSIM) { unsigned int num_platform_devices = acl_platform.num_devices; if (!acl_platform.offline_device.empty() && - offline_mode != ACL_CONTEXT_MSIM && offline_mode != ACL_CONTEXT_MPSIM) { + offline_mode != ACL_CONTEXT_MPSIM) { num_platform_devices -= 1; // In this case there's an extra offline devices at the end of the // list. Do not check it.