On Tue, 18 Dec 2012, Muhammad Shoaib bin altaf wrote:
Hey List,
I am running Full system X86 and the bigger picture is to integrate
accelerators (or co-processors) in gem5. I think starting with adding devices
will be a good starting point.
I have added a device "Hello device" in the system (similar to procedure
listed in ASPLOS tutorial). Since, SouthBridge.py assigns address to the
devices which are connected to the south bridge, so I have added these lines
in SouthBridge.py
========================================
_hello = HelloDevice(pio_addr=x86IOAddress(0x84))
hello = Param.HelloDevice(_hello,"test device")
....................................................................................
self.hello.pio = bus.master
========================================
But I can see that the device is connected to the system in m5out/config.ini.
=========================================
[system.pc.south_bridge]
type=SouthBridge
children=cmos dma1 *hello* ide int_lines0 int_lines1 int_lines2 int_lines3
int_lines4 int_lines5 int_lines6 io_apic keyboard pic1 pic2 pit speaker
cmos=system.pc.south_bridge.cmos
dma1=system.pc.south_bridge.dma1
*hello=system.pc.south_bridge.hello*
io_apic=system.pc.south_bridge.io_apic
keyboard=system.pc.south_bridge.keyboard
pic1=system.pc.south_bridge.pic1
pic2=system.pc.south_bridge.pic2
pit=system.pc.south_bridge.pit
platform=system.pc
speaker=system.pc.south_bridge.speaker
...................................................................................
*[system.pc.south_bridge.hello]*
type=HelloDevice
clock=1
pio_addr=9223372036854775940
pio_latency=100000
system=system
pio=system.iobus.master[11]
=========================================
So my question is, how am I suppose to access this device (either at boot
time or as a user). The ASPLOS tutorial mentioned about making some changes
in the ALPHA console for accessing device address at boot time, do I have to
make similar changes in linux kernel ?? Also in the documentation, it is
mentioned about 'BadDevice' which panics on an access; I am not sure who to
access that device either.
As a user, you should be able to access the device like you would access a
file. Try using open/close or mmap routines provide by glibc. These system
calls will invoke the routines in the device driver (which you will have
to provide). I am not quite confident on how the device driver works with
the device itself.
I dobut directly specifying the address of the device will work. I think
the processor will consider it to be a regular virtual address and try to
map it some physical address, which should fail and result in an error.
--
Nilay
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users