Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
tinebp committed Sep 1, 2024
1 parent 8215089 commit 32636fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
3 changes: 1 addition & 2 deletions runtime/opae/vortex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ class vx_device {

int get_caps(uint32_t caps_id, uint64_t * value) {
uint64_t _value;

switch (caps_id) {
case VX_CAPS_VERSION:
_value = (dev_caps_ >> 0) & 0xff;
Expand All @@ -227,7 +226,7 @@ class vx_device {
_value = global_mem_size_;
break;
case VX_CAPS_LOCAL_MEM_SIZE:
_value = 1ull << ((dev_caps_ >> 48) & 0xff);
_value = 1ull << ((dev_caps_ >> 40) & 0xff);
break;
case VX_CAPS_ISA_FLAGS:
_value = isa_caps_;
Expand Down
14 changes: 7 additions & 7 deletions runtime/xrt/vortex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,15 @@ class vx_device {
uint32_t num_banks = 1 << platform_.lg2_num_banks;
uint64_t bank_size = 1ull << platform_.lg2_bank_size;

// adjust memory bank size to architecture limit
// adjust memory banks allocation to architecture limit
int isa_arch = VX_ISA_ARCH(isa_caps_);
if (isa_arch == 32) {
uint64_t max_mem_size = 1ull << 32;
uint64_t need_bank_size = max_mem_size / num_banks;
if (bank_size > need_bank_size) {
printf("info: adjusted bank size from 0x%lx to 0x%lx bytes.\n", bank_size, need_bank_size);
bank_size = need_bank_size;
platform_.lg2_bank_size = log2ceil(bank_size);
uint32_t need_num_banks = max_mem_size / bank_size;
if (num_banks > need_num_banks) {
printf("info: adjusted number of banks from %d to %d.\n", num_banks, need_num_banks);
num_banks = need_num_banks;
platform_.lg2_num_banks = log2ceil(num_banks);
}
}

Expand Down Expand Up @@ -416,7 +416,7 @@ class vx_device {
_value = global_mem_size_;
break;
case VX_CAPS_LOCAL_MEM_SIZE:
_value = 1ull << ((dev_caps_ >> 48) & 0xff);
_value = 1ull << ((dev_caps_ >> 40) & 0xff);
break;
case VX_CAPS_ISA_FLAGS:
_value = isa_caps_;
Expand Down

0 comments on commit 32636fa

Please sign in to comment.