Skip to content

Commit 5eb553a

Browse files
committed
Change autodiscovery format
------------------------------------ Now the autodiscovery format is changed to num_device_global num_field_in_device_global [(dev_global_name, dev_global_addr, devl_global_size), (dev_global_name, dev_global_addr, devl_global_size), ...] This is because each device global will have same number of field anyways, so itis not necessary ot keep a number of field for each device global
1 parent c767c31 commit 5eb553a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/acl_auto_configure.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -501,15 +501,15 @@ bool acl_load_device_def_from_str(const std::string &config_str,
501501
read_uint_counters(config_str, curr_pos, num_device_global, counters);
502502
devdef.num_device_global = num_device_global;
503503

504+
// read total number of fields in device global
505+
int total_fields_device_global = 0;
506+
if (result) {
507+
result = read_int_counters(config_str, curr_pos,
508+
total_fields_device_global, counters);
509+
}
510+
504511
for (auto i = 0U; result && (i < num_device_global);
505512
i++) { // device_global_memories
506-
// read total number of fields in global_memories
507-
int total_fields_device_global = 0;
508-
if (counters.back() > 0) {
509-
result = read_int_counters(config_str, curr_pos,
510-
total_fields_device_global, counters);
511-
}
512-
513513
counters.emplace_back(total_fields_device_global);
514514

515515
// read device global name

test/acl_auto_configure_test.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ TEST(auto_configure, simple) {
3636
#define VERSIONIDSTRINGIFY(x) #x
3737
#define VERSIONIDTOSTR(x) VERSIONIDSTRINGIFY(x)
3838
#define DEVICE_FIELDS " 23"
39-
#define DEVICE_FIELDS_DEV_GLOBAL " 32"
39+
#define DEVICE_FIELDS_DEV_GLOBAL " 30"
4040
#define DEVICE_FIELDS_OLD " 18"
4141
#define BOARDNAME "de4_gen2x4_swdimm"
4242
#define BOARDNAME2 "pcie385_a7"
@@ -110,8 +110,7 @@ TEST(auto_configure, simple) {
110110
VERSIONIDTOSTR(ACL_AUTO_CONFIGURE_VERSIONID)
111111
DEVICE_FIELDS_DEV_GLOBAL RANDOM_HASH
112112
" " BOARDNAME IS_NOT_BIG_ENDIAN MEM HOSTPIPE KERNEL_ARG_INFO_NONE
113-
NUM_DEV_GLOBAL NUM_DEV_GLOBAL_FIELD DEV_GLOBAL_1 NUM_DEV_GLOBAL_FIELD
114-
DEV_GLOBAL_2
113+
NUM_DEV_GLOBAL NUM_DEV_GLOBAL_FIELD DEV_GLOBAL_1 DEV_GLOBAL_2
115114
" 1 82 foo" KERNEL_CRA KERNEL_FAST_LAUNCH_DEPTH KERNEL_PERF_MON
116115
KERNEL_WORKGROUP_VARIANT KERNEL_WORKITEM_VARIANT
117116
KERNEL_NUM_VECTOR_LANES1 KERNEL_PROFILE_SCANCHAIN_LENGTH

0 commit comments

Comments
 (0)