Hi Andreas, My guess is that for Method 1, the pointer is of a virtual address so there's a page fault there.
I'm not sure why the write() function wasn't invoked on Method 2. I got into the same problem recently where I used mmap() to write to a physical address, which should be handled by a Pio device. Even though the generated binary has a store instruction to that address, the write() function wasn't called. I solved that problem by using printf() to print the value at that physical address. I think using volatile keyword should have worked as well. I'm quite rusty on bare metal programming so I might be wrong :) Regards, Hoa Nguyen On Sat, Oct 23, 2021, 4:37 PM diavastos--- via gem5-users < gem5-users@gem5.org> wrote: > Hi all, > > I implemented a device using the BasicPioDevice class but I can't seem to > get the read() & write() calls to work. > I assigned a pioAddr=0x200000000 and a pioSize=4096 and I try to write to > the device directly using these two methods: > > Method 1: > ----------- > > uint32_t inp_params2 = 14; > uint64_t *driver = (uint64_t*)0x200000000; > *driver = inp_params2; > > Method 2: > ----------- > > asm volatile ( > "mov %0,0x200000000\n" > : > : "r" (inp_params2) > : > ); > > With the Method 2, the simulation completes with no error but the write() > is never called on the device, With Method 1 I get the following error: > panic: panic condition !handled occurred: Page table fault when accessing > virtual address 0x200000000 > > Any help would be greatly appreciated! > > Many Thanks, > andreas > _______________________________________________ > gem5-users mailing list -- gem5-users@gem5.org > To unsubscribe send an email to gem5-users-le...@gem5.org > %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s >
_______________________________________________ gem5-users mailing list -- gem5-users@gem5.org To unsubscribe send an email to gem5-users-le...@gem5.org %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s