On Tue, Jun 22, 2010 at 5:37 PM, Malek Musleh <malek.mus...@gmail.com> wrote: > I couldn't get the xgcc command to work as it I got a not found error, > nor could I find in either the Linux OS package list or the Alpha > precompiled cross Compiler directory.
I used 'xgcc' to indicate 'alphaev67-unknown-linux-gnu-gcc'. It should be picked up from the same path as your assembler (alphaev67-unknown-linux-gnu-as) earlier. > > I ended up using the the Makefile in util/m5 (makefile.alpha) and > setting the path of CrossCompile to the Alpha precompiled cross > compiler obtained from the M5 wiki: > > http://www.m5sim.org/dist/current/alphaev67-unknown-linux-gnu-x86-32.tar.bz2 > > and changed the name of assembly file to have a .S suffix. > > There really is no harm in using a .S suffix right, so my approach > should be fine in the long run? > > My other question is as follows: > > When running it, I get the following output: > > Global frequency set at 1000000000000 ticks per second > 0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000 > **** REAL SIMULATION **** > info: Entering event queue @ 0. Starting simulation... > info: Increasing stack size by one page. > hack: be nice to actually delete the event here > Exiting @ cycle 1699000 because halt instruction encountered > > Instead of getting the previous error, I get the simulation to > complete, and I believe it's working because it seems to encounter the > 'halt' instruction in the test01.S file, but is there a way I can > check the program correctness of it, by somehow printing out the value > stored in a specific register? For example, add the values of some > registers to together, and then print the value stored resulting > destination location? There is a small test program, 'hello.c', in tests/test-progs/hello/src directory in the M5 tree that just outputs "Hello world!" on the standard output. If you compile that program and simulate its executable, you'll be able to verify if the program is being simulated correctly or not. Various precompiled binaries for that source program are already present in the tests/test-progs/hello/bin directory. > > Malek > -Soumyaroop > On Tue, Jun 22, 2010 at 4:56 PM, Gabriel Michael Black > <gbl...@eecs.umich.edu> wrote: >> You're probably confusing our loader which is likely making more assumptions >> than it should about how a binary is put together. You may make it happy by >> putting your code in the text section by adding a .text directive. >> >> Gabe >> >> Quoting soumyaroop roy <s...@cse.usf.edu>: >> >>> Hello Malek: >>> >>> How are you generating the executable a.out? Seems like the problem is >>> in the executable format. >>> >>> Use (xgcc is the cross compiler gcc): >>> xgcc -o <output_file> <assembly_file> -static >>> >>> or >>> >>> xgcc -o <output_file> -x assembler <assembly_file> -static >>> >>> >>> if your assembly file does not have a '.s' suffix (which is the case >>> in your example). >>> >>> -Soumyaroop >>> >>> >>> On Tue, Jun 22, 2010 at 3:16 PM, Malek Musleh <malek.mus...@gmail.com> >>> wrote: >>>> >>>> Hello, >>>> >>>> I am trying to run an alpha assembly program in M5. I just wrote a few >>>> line asm program (test01.asm) and tried to compile it with the alpha >>>> cross compiler: >>>> >>>> >>>> crosscompilers/ALPHA/alphaev67-unknown-linux-gnu/bin/alphaev67-unknown-linux-gnu-as >>>> >>>> >>>> It is able to compile without any warnings or errors, but when I try >>>> running in using Alpha_SE/m5.opt I get the following error: >>>> >>>> m5.opt: build/ALPHA_SE/base/loader/elf_object.cc:351: >>>> ElfObject::ElfObject(const std::string&, int, size_t, uint8_t*, >>>> ObjectFile::Arch, ObjectFile::OpSys): Assertion `text.size != 0' >>>> failed. >>>> Program aborted at cycle 0 >>>> Aborted >>>> >>>> >>>> My command line is: command line: ./build/ALPHA_SE/m5.opt >>>> ./configs/example/se.py -c ../alpha_programs/asm/a.out >>>> >>>> My test program is as follows: >>>> >>>> test01.asm: >>>> >>>> >>>> .align 4 >>>> .file 1 "test01.asm" >>>> .loc 1 2 >>>> .globl main >>>> .ent main >>>> >>>> main: >>>> >>>> lda $4, 15($31) # $31 is 0, 0xF >>>> addl $4, 1, $1 >>>> and $4, 0XFF >>>> halt >>>> .end main >>>> >>>> Do I need to modify the config script to run asm binaries, or is there >>>> something else that I am missing? >>>> >>>> Thanks. >>>> >>>> Malek >>>> _______________________________________________ >>>> m5-users mailing list >>>> m5-users@m5sim.org >>>> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users >>>> >>> >>> >>> >>> -- >>> Soumyaroop Roy >>> Ph.D. Candidate >>> Department of Computer Science and Engineering >>> University of South Florida, Tampa >>> http://www.csee.usf.edu/~sroy >>> _______________________________________________ >>> m5-users mailing list >>> m5-users@m5sim.org >>> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users >> >> >> _______________________________________________ >> m5-users mailing list >> m5-users@m5sim.org >> http://m5sim.org/cgi-bin/mailman/listinfo/m5-users > -- Soumyaroop Roy Ph.D. Candidate Department of Computer Science and Engineering University of South Florida, Tampa http://www.csee.usf.edu/~sroy _______________________________________________ m5-users mailing list m5-users@m5sim.org http://m5sim.org/cgi-bin/mailman/listinfo/m5-users