From: Michael Nolan Date: Wed, 25 Mar 2020 17:23:16 +0000 (-0400) Subject: Add qemu test directory X-Git-Tag: div_pipeline~1635 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=128519f377bd5204ed5e38ce327ddf0f93858ac2;p=soc.git Add qemu test directory --- diff --git a/src/soc/simulator/qemu_test/.gitignore b/src/soc/simulator/qemu_test/.gitignore new file mode 100644 index 00000000..416ab3a3 --- /dev/null +++ b/src/soc/simulator/qemu_test/.gitignore @@ -0,0 +1,4 @@ +*.bin +*.elf +*.o +*~ diff --git a/src/soc/simulator/qemu_test/Makefile b/src/soc/simulator/qemu_test/Makefile new file mode 100644 index 00000000..8c258b6f --- /dev/null +++ b/src/soc/simulator/qemu_test/Makefile @@ -0,0 +1,15 @@ +TOOLCHAIN=powerpc64-linux-gnu +CC=$(TOOLCHAIN)-gcc +AS=$(TOOLCHAIN)-as +AFLAGS=-mpwr9 + +all: kernel.bin + +kernel.elf: test.o + $(TOOLCHAIN)-ld $^ -o $@ -T memmap + +kernel.bin: kernel.elf + $(TOOLCHAIN)-objcopy $< -O binary $@ + +%.o: %.s + $(AS) $(AFLAGS) -c $< -o $@ diff --git a/src/soc/simulator/qemu_test/gdbscript b/src/soc/simulator/qemu_test/gdbscript new file mode 100644 index 00000000..1337e6a7 --- /dev/null +++ b/src/soc/simulator/qemu_test/gdbscript @@ -0,0 +1,4 @@ +target remote localhost:1234 +layout asm +b *0x20000000 +c diff --git a/src/soc/simulator/qemu_test/memmap b/src/soc/simulator/qemu_test/memmap new file mode 100644 index 00000000..8cc1a16e --- /dev/null +++ b/src/soc/simulator/qemu_test/memmap @@ -0,0 +1,11 @@ + +MEMORY +{ + ram : ORIGIN = 0x20000000, LENGTH = 128M +} + +SECTIONS +{ + .text : { *(.text*) } > ram + .bss : { *(.text*) } > ram +} diff --git a/src/soc/simulator/qemu_test/test.s b/src/soc/simulator/qemu_test/test.s new file mode 100644 index 00000000..fb2ec156 --- /dev/null +++ b/src/soc/simulator/qemu_test/test.s @@ -0,0 +1,6 @@ + lis 1, 0xdead + ori 1, 1, 0xbeef + lis 2, 0x2000 + ori 2, 2, 0x0100 + std 1, 0(2) + lhz 1, 4(2)