yxymit / banshee

7 stars 7 forks source link

storing page to mc dram #1

Open kingshukmajumder opened 6 years ago

kingshukmajumder commented 6 years ago

Hi, I was looking at the banshee paper and associated code for a class project. I have the following doubts/questions. In mc.cpp line 422, the whole page is written to a single mcdram (i.e _mcdram[mc_dram_select]). Since the mcdram_select is the lower bits of "address / 64", shouldn't the page (4kb or more) be distributed among all of the mcdrams per mc instead of just _mcdram[mc_dram_select]?

Also, the mc_address of the original request is directly used for writing the page (i.e creating the insert_req request). Since insert_req is to store the whole page, shouldn't its address be ((address / _granularity)*_granularity)/ 64 / _mcdram_per_mc * 64 ?

yxymit commented 6 years ago

Hi,

The address in mc.cpp is not the byte address, but the cacheline number. Therefore, address/64 is the page number (we assume 64B cachelines and 4KB pages). I think this also answers your second question: both address and mc_address are cacheline numbers, so mc_address is calculated in the following way (mc.cpp : 224).

Address mc_address = (address / 64 / _mcdram_per_mc * 64) | (address % 64);