I get the physical address with this function:
physical_address_t getDataTranslation(physical_address_t
virtual_address, int thread, int proc_no)
{
int page_offset = virtual_address % g_PAGE_SIZE_BYTES;
physical_address_t virtual_page = virtual_address - page_offset;
physical_address_t physical_address;
physical_address_t temp_address = SIMICS_translate_data_address(
proc_no, Address(virtual_page));
if (temp_address == 0){
return 0;
} else {
physical_address = temp_address + page_offset;
}
return physical_address;
}
I receive the segmentation fault when do the first write from ruby to
simics.
Is this OK ? Does Someone known how to do this?
Thanks a lot
Lois
Lois Orosa Nogueira escribió:
Hi list,
I'm trying to save in ruby part of the Versions of data in
Transactions . I read from simics some blocks in this way:
for (int i = 0; i < g_DATA_BLOCK_BYTES; i += 4){
entry[i/4] = SIMICS_read_physical_memory(
proc,physicalAddress.getAddress() + i, 4);
}
and then, I write from ruby to simics in this way (to the same address):
for (int i = 0; i < g_DATA_BLOCK_BYTES; i+=4){
SIMICS_write_physical_memory(proc, physicalAddress.getAddress() +
i, entry[i/4], 4);
}
Which is the error? I receive a Segmentation fault from simics when I
do the first Write
Thanks a lot
Lois
|