Skip to content

Commit 3ba60c6

Browse files
committed
globals: parse simulation project directory environment variable when CL_CONTEXT_MPSIM_DEVICE_INTELFPGA is not set to force simulation flow
1 parent 10107c3 commit 3ba60c6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/acl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ typedef struct {
266266

267267
/* Must match definition in aoc.pl */
268268
#define ACL_MPSIM_DEVICE_NAME "SimulatorDevice"
269+
/* Specifies which device simulator should simulate */
270+
#define INTELFPGA_SIM_DEVICE_SPEC_DIR "INTELFPGA_SIM_DEVICE_SPEC_DIR"
269271

270272
#define ACL_RAND_HASH_SIZE 40
271273

src/acl_globals.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,11 @@ const char *acl_get_offline_device_user_setting(int *use_offline_only_ret) {
109109
} else {
110110
// Look for multi-process simulator before old simulator.
111111
setting = acl_getenv("CL_CONTEXT_MPSIM_DEVICE_INTELFPGA");
112+
// Check if simulation board spec directory is set, which implies
113+
// CL_CONTEXT_MPSIM_DEVICE_INTELFPGA if that is not set
114+
if (!setting && acl_getenv(INTELFPGA_SIM_DEVICE_SPEC_DIR)) {
115+
setting = "1"; // Use 1 simulator device by default
116+
}
112117
if (setting) {
113118
use_offline_only = ACL_CONTEXT_MPSIM;
114119
result = setting;

0 commit comments

Comments
 (0)