The hdlcd should be controlled by the kernel, not by a application as it won’t have a mapping for the physical addresses. If you download the latest kernels from the website they support the hdlcd.
Ali On Nov 27, 2014, at 3:05 AM, via gem5-users <[email protected]> wrote: > Hi,everyone: > > I would like to make the devices in arm architecture work in FS mode like the > hdlcd.I found the python code related to the hdlcd in src/dev/arm/RealView.py: > > hdlcd=HDLcd(pio_addr=0x2b000000,int_num=117) > > I think the address 0x2b000000 is the start address the device responds to, > to drive a device,we should configure its registers,so I wrote the C > application hdlcd.c to enable the hdlcd: > > > > int main() > > { volatile unsigned int *p=(volatile unsigned int*)0x2b000230;(the address of > the enable register of hdlcd) > > *p=0x00000001; > > Return 0; > > > } > > > > > Then I compiled the code above and created the script hdlcd.rcS in > gem5/configs/boot: > > > > #!/bin/sh > > #wait for system to calm down > > Sleep 10 > > #take a checkpoint in 100000ns > > m5 checkpoint 100000 > > #Reset the stats > > m5 reset stats > > #Run hdlcd > > /hdlcd > > #Exit the simulation > > > m5 exit > > > > Then I run the application in gem5 in FS mode. > > > Command line: > > ~/gem5$ sudo mount –o,loop,offset=32256 dist/disks/linux-arm-ael.img /mnt > > ~/gem5$ sudo cp hdlcd /mnt > > ~/gem5$ sudo umount /mnt > > > ~/gem5$ export LINUX_IMAGE=dist/disks/linux-arm-ael.img > > > ~/gem5$ ./build/ARM/gem5.opt configs/example/fs.py > --kernel=vmlinux-3.3-arm-vexpress-emm-pcie --disk=linux-arm-ael.img > --mem-size=512MB --machine-type=VExpress_EMM --script=./configs/boot/hdlcd.rcS > > gem5 Simulator System. http://gem5.org > > > … > > > Info:kernel located at:/dist/binaries/vmlinux-3.3-arm-vexpress-emm-pcie > > Listening for system connection on port 5900 > > Listening for system connection on port 3456 > > 0:system.cpu.isa:ISA system set to:0xd63b780 0xd63b780 > > > 0:system.remote_gdb.listener.Listening for remote gdb #0 on port 7000 > > Info:Using bootloader at address 0x10 > > > Info:Using kernel entry physical address at 0x80008000 > > > ****REAL SIMULATION**** > > > Info:Entering event [email protected] simulation… > > > … > > Writing checkpoint > > Info:Entering event queue @12607424867000.starting simulation… > > > Exiting@tick 12608849941000 because m5_exit instruction encountered > > > > Terminal > > > ~/gem5$ ./util/term/m5term 127.0.0.1 3456 > > > ====m5 slave terminal:Terminal 0==== > > > … > > > Starting Pid 576,tty “:’/etc/rc.d/rc.local’ > > > Warning:can’t open /etc/matlab:No such file or directory > > Thu Jan 1 00:00:02 UTC 2009 > > S:devpts > > Thu Jan 1 00:00:02 UTC 2009 > > Segmentation fault > > > > > It showed me a segmentation fault. > > > > > I used gdb to debug it.I set the debug flag “HDLcd”. > > > Command line: > > > ~/gem5$ gdb --args ./build/ARM/gem5.opt configs/example/fs.py > --kernel=vmlinux-3.3-arm-vexpress-emm-pcie --disk=linux-arm-ael.img > --mem-size=512MB --machine-type=VExpress_EMM --script=./configs/boot/hdlcd.rcS > > ... > > (gdb)call setDebugFlag(“HDLcd”) > > (gdb) continue > > continuing > > > gem5 Simulator System. http://gem5.org > > ... > > Writing checkpoint > > > 12607424274000:system.realview.hdlcd:Serializing ARM HDLCD > > Info:Entering event queue @12607424274000.starting simulation… > > > Exiting@tick 12608849456000 because m5_exit instruction encountered > > > > The “Serializing ARM HDLCD” is in HDLcd::serialize(std::ostream &os),it shows > the serialize() function is called,but I think if a device is enabled,its > read() or write() function should be called. > > So does anyone know how to call the read() or write() function of a device > and to make it work.I would appreciate any advice how should I drive a device. > > Thanks > > > > > Ran Luo > > > _______________________________________________ > gem5-users mailing list > [email protected] > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________ gem5-users mailing list [email protected] http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
