Hi all,
I want to load the memory data in the cache. So I modify the cacheController.cpp
file like this in CacheController::cache_insert_cb(void *arg)
int exception;
PageFaultErrorCode pfec;
W64 my_addr = queueEntry->request->get_virtual_address();
int my_id = queueEntry->request->get_threadid();
Context& ctx = contextof(my_id);
int mmio;
ctx.check_and_translate(my_addr, 1, 0, 0, exception, mmio, pfec);
if (exception == 0)
my_loadvirt(queueEntry->request);
However, my_loadvirt() errors when it was called.
my_loadvirt() function is defined in cacheController.h like this:
-------------------------------------
typedef struct {
W64 old_data[8];
W64 new_data[8];
} my_data;
void my_loadvirt(MemoryRequest* request) {
W64 my_addr = request->get_virtual_address();
int my_id = request->get_threadid();
my_data mydata;
mydata.old_data[0] = contextof(my_id).loadvirt(my_addr, 3);
my_data_cache[my_id].insert(std::pair<Waddr, my_data>(my_addr, mydata));
}
------------------------------------------
I have several problem related:
1. It is said that Context::loadphys() should *not* be used to load memory data
in QEMU, why? (Must I use loadvirt() so as to do this?)
2. I insert the virtual address to the request when it is initialized. Why it
errors when loadvirt() function is called?
3. loadvirt() can only load 8-byte data (W64), while a cache line is actually
64B, so I need to load 8 consecutive data. Assuming that the first 8B use
my_address, so the next 8B needed is (my_address + 8), am I right?
Sorry for such a long email, but I am newer to marss, and I am blocked here for
a long time.
Regards,
Shuchang
_______________________________________________
http://www.marss86.org
Marss86-Devel mailing list
[email protected]
https://www.cs.binghamton.edu/mailman/listinfo/marss86-devel