Hi Santilli,
    Thanks for your careful responses.

    My gem5 version is a branch (namely sve_beta1) downloaded from
    https://gitlab.com/arm-hpc/gem5/tree/sve/beta1, and the recent
    version is e9d0d6c5.  I am not sure whether this version (15f2736a
    for short)
    https://github.com/gem5/gem5/commit/6efe7e1abf9d289859eb23b52b3a319f15f2736a
    has been included in my local gem5 version.
    
    I have searched in branch sve_beta1 by the commit message "sim-se:
    Different HWCAP for ArmProcess32/64", but no relevant message has
    been found. It seems that the version 15f2736a has not been included
    in my local gem5 version sve_beta1.


    Actually, I want to do some research on vector explorations. I
    wander if hello program run better on the full
    system mode for branch sve_beta1 than SE mode ?
    I see that the commit "sim-se: Different HWCAP for
    ArmProcess32/64" only suits the SE mode.


在 2019-09-05 13:36:37,"Ciro Santilli" <ciro.santi...@gmail.com> 写道:





On Thu, Sep 5, 2019 at 3:58 AM 雷国庆 <lgxy1...@163.com> wrote:

Hi, 


Recently, I am interested in gem5 simulator. 
I have downloaded the gem5 from github, and want to run
simple programs (like "hello world") on gem5 just for the ARM
architecture, but I failed. I do not know why.


The error info is as follows:


   I have compile the "hello.c" file (in directory: tests/test-progs/hello/src) 
like this:


   aarch64-linux-gun-gcc hello.c -o hello -static


   and run gem5:


   ./build/ARM/gem5.debug configs/example/se.py -c 
tests/test-progs/hello/src/hello


   then, I found this error:


   ...
   panic: Attempted to execute unimplemented instructions 'mrs' (inst 
0x4d5380000)
   ...


   It shows that the mrs inst is not implemented in gem5. 


   Totally, I have three questions as follows:


   Question 1: In order to run hello program for ARM architecture, how to 
compile the hello source file to avoid "mrs" insts ?


This describes one working setup: 
https://stackoverflow.com/questions/53085048/how-to-compile-and-run-an-executable-in-gem5-syscall-emulation-mode-with-se-py/53085049#53085049


By decoding 0x4d5380000 with objdump (remove the top `4` which is some extra 
metadata on top of the actual encoding, we get "mrs x0, midr_el1" which appears 
to be solved at: 
https://github.com/gem5/gem5/commit/6efe7e1abf9d289859eb23b52b3a319f15f2736a 
What's your gem5 version?
 
   Question 2: How can I know whether the instruction (e.g. mrs) has been 
implemented in gem5 or not for ARM architecture ?


Either run the program and see it blows up with unimplemented instruction or 
grep and interpret the source code of the decode tree under src/arch/arm/isa/ 
:-)
 
   Question 3: If I choose armclang compiler, the error has been changed to 
like this:
               panic: Attempted to execute unimplemented instructions 'hlt' 
(inst 0x4d45e0000)
               So how to compile hello to avoid generating "hlt" using armclang 
compiler?




We haven't tested much with clang, but it would be good to try and get it 
working. I don't know why it emits HLT. I would just try to implement HLT as a 
NOP and see what happens.

Guoqing Lei







 

_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to