Skip to content

Commit

Permalink
samples/cxl_mem_tg: 16GB memory support is added for MEM_TG (#3058)
Browse files Browse the repository at this point in the history
Problem/Feature : In code only 48KB support is available for MEM_TG
Fix/Workaround :  Extended it to 16GB.
Changes made : 1.samples/cxl_mem_tg/cxl_mem_tg.h and samples/cxl_mem_tg/cxl_tg_test.h are
               updated accordingly.
               2. Review comments from Ananda are added in samples/cxl_mem_tg/cxl_tg_test.h.

Signed-off-by: Lakshmiravikanth Pammi <lakshmiravikanth.pammi@intel.com>
Co-authored-by: Ananda Ravuri <33236856+anandaravuri@users.noreply.github.com>
  • Loading branch information
pl-ravikanth and anandaravuri authored Dec 14, 2023
1 parent 9637c6b commit 5307b57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion samples/cxl_mem_tg/cxl_mem_tg.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ union tg_mem_size {
enum { offset = MEM_SIZE };
uint64_t value;
struct {
uint64_t total_mem_size : 32;
uint64_t hdm_mem_size : 32;
uint64_t total_mem_size : 32;
};
};

Expand Down
6 changes: 3 additions & 3 deletions samples/cxl_mem_tg/cxl_tg_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ class cxl_tg_test : public test_command {
tg_mem_size mem_size;
mem_size.value = tg_exe_->read64(MEM_SIZE);

uint64_t value = mem_size.total_mem_size;
uint64_t value = mem_size.total_mem_size * MB / CL;
tg_exe_->logger_->debug("Total hardware memory size:{}", value);
value = mem_size.hdm_mem_size;
value = mem_size.hdm_mem_size * MB / CL;
tg_exe_->logger_->debug("HDM memory size:{0:d}", value);

if (mem_size.hdm_mem_size != 0)
tg_exe_->hdm_size_ = mem_size.hdm_mem_size;
tg_exe_->hdm_size_ = (mem_size.total_mem_size - mem_size.hdm_mem_size) * MB / CL;

cout << "HDM memory cache line size:" << dec << tg_exe_->hdm_size_ << endl;

Expand Down

0 comments on commit 5307b57

Please sign in to comment.