Hi Andreas,

Thanks for your response. I have two follow up questions.

   1. Is the MIPS implementation of gem5 not maintained?
   2. Do you know what compiler was used for generating the MIPS binaries
   provided with gem5?

For anyone who also may be trying to run MIPS binaries on gem5, here are
the tools I tried. None of them really worked for me.

   - Codebench
      - Debian running on QEMU (MIPS Malta architecture emulation)
      - ELDK 5.6
      - mipsel-linux-gcc (pre-compiled Ubuntu package)
         - The hello world executable created by this one worked on gem5,
         however it used a syscall that was not implemented by the simulator.
      - Crosstool-ng
      - ELDK 4.1
         - After reading this post
         <https://www.mail-archive.com/[email protected]/msg06731.html> I
         installed this particular version of ELDK which generated a
hello world
         executable that ran successfully on gem5. However, when I compiled a
         program that was a little more complex (999.specrand
         <https://www.spec.org/cpu2006/Docs/999.specrand.html>), the
         resulting executable caused gem5 to crash with an "abort" message.

What I realized is that none of the tools above generated a binary that has
the same format as the MIPS binaries provided with gem5, i.e. "MIPS-I
version 1 (SYSV)". I had "MIPS-II version 1 (SYSV)", "MIPS32 version 1
(SYSV)", "MIPS-I version 1", but never a binary that had the exact same
format as the executables provided with gem5. I'm guessing this is the
problem. For some reason, none of the compilers I tested generated MIPS-I
code when I used "-march=mips1" option (except the one which by default
generated "MIPS-I version 1" binaries).



On Wed, Jun 1, 2016 at 6:36 PM, Andreas Hansson <[email protected]>
wrote:

> Hi Murat,
>
> gem5’s level of support for various ISAs varies greatly, and I merely want
> to make sure you are aware of the trade-off. MIPS is likely to be a rather
> painful first experience, at least compared to ARM and X86. If you’re happy
> to dig in a fix things along the way that’s great. Just be prepared.
>
> Again, it is entirely up to you, but I’d suggest to stick with ARM or X86:
> good support, modern tool chains, modern kernels etc.
>
> Andreas
>
> From: gem5-users <[email protected]> on behalf of Murat Koksal <
> [email protected]>
> Reply-To: gem5 users mailing list <[email protected]>
> Date: Tuesday, 31 May 2016 at 17:46
> To: gem5-users <[email protected]>
> Subject: [gem5-users] Problem running MIPS binaries
>
> Hello,
>
> I am having a problem running MIPS binaries I generated on MIPS
> implementation of gem5. The problem may not be necessarily caused by gem5
> since I am also making use of qemu or gcc. Etiher way, I would appreciate
> some help. Here is what I did:
>
> I compiled gem5.opt for MIPS, modified some configuration files (including
> se.py, CacheConfig.py, CpuConfig.py) and ran the provided hello world
> binary successfully. Then I installed the Debian wheezy image provided
> here <https://people.debian.org/~aurel32/qemu/mipsel/> on qemu to have a
> MIPS machine for compiling my own programs. I compiled and ran the hello
> world program on qemu successfully. However, when I copied the binary to
> the host machine and ran it on gem5, the simulator aborted with this
> message:
>
> gem5.opt: build/MIPS/cpu/o3/cpu.cc:877: void
> FullO3CPU<Impl>::removeThread(ThreadID) [with Impl = O3CPUImpl; ThreadID =
> short int]: Assertion `iew.ldstQueue.getCount(tid) == 0' failed.
>
> Running file command on the hello world binary provided with gem5 gave
> the following output:
> ELF 32-bit LSB executable, MIPS, *MIPS-I version 1 (SYSV)*, statically
> linked, for GNU/Linux 2.4.3, not stripped
>
> For the binary I created on qemu, I got the following output:
> ELF 32-bit LSB executable, MIPS, *MIPS-II version 1*, statically linked,
> for GNU/Linux 2.6.26,
> BuildID[sha1]=a8d4edac71e5018a8ffb3a1a4788737e52e54f5d, not stripped
>
> Based on above outputs, I am guessing that the one I compiled causes gem5
> to crash because it uses MIPS-II instruction set instead of MIPS-I. What I
> don't understand is how I ended up getting an executable for MIPS-II,
> because I compiled the program using the command gcc -static -march=mips1
> hello.c. I got the same result when I used -march=r2000 option for gcc
> (according to Wikipedia R2000 implements MIPS-I ISA). I am not sure if it
> has anything to do with the hardware I picked for emulation on qemu (Malta
> board). Here is the qemu command I used, just in case:
>
> qemu-system-mipsel -nographic -M malta -kernel vmlinux-3.2.0-4-4kc-malta
> -hda debian_wheezy_mipsel_standard.qcow2 -append "root=/dev/sda1
> console=ttyS0" -m 256
>
> My ultimate goal is to compile Spec 2006 benchmarks for MIPS and run them
> on gem5. Any help is appreciated.
>
> Thanks.
>
> IMPORTANT NOTICE: The contents of this email and any attachments are
> confidential and may also be privileged. If you are not the intended
> recipient, please notify the sender immediately and do not disclose the
> contents to any other person, use it for any purpose, or store or copy the
> information in any medium. Thank you.
>
> _______________________________________________
> 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

Reply via email to