Computer Architecture project——simplescalar under Ubuntu/在Ubuntu10.04下安装simplescalar第四部分

来源:互联网 发布:租用阿里云vps 编辑:程序博客网 时间:2024/04/30 19:26

Testing

To test the simulator use these commands

1clear
2cd $IDIR
3$ gedit hello.c

Now in Gedit you can write your program like this (You may modify it)

[c]
#include<stdio.h>
main (void)
{
printf("My name is T.J. I'm a student in UFL. This is the first time sharing my knowledge. Hope this can be helpful!");
}
[/c]

Once you are done writing the code, use the following command to test it.

1$ $IDIR/bin/sslittle-na-sstrix-gcc -o hello hello.c
2$ $IDIR/simplesim-3.0/sim-safe hello

You would “hopefully” get an output similar to this

view source
print?
01sim: ** starting functional simulation **
02My name is T.J. I'm a student in UFL. This is the first time sharing my knowledge. Hope this can be helpful!
04 
05sim: ** simulation statistics **
06sim_num_insn                   9242 # total number of instructions executed
07sim_num_refs                   4328 # total number of loads and stores executed
08sim_elapsed_time                  1 # total simulation time in seconds
09sim_inst_rate             9242.0000 # simulation speed (in insts/sec)
10ld_text_base             0×00400000 # program text (code) segment base
11ld_text_size                  71968 # program text (code) size in bytes
12ld_data_base             0×10000000 # program initialized data segment base
13ld_data_size                   8528 # program init’ed `.data’ and uninit’ed `.bss’ size in bytes
14ld_stack_base            0×7fffc000 # program stack segment base (highest address in stack)
15ld_stack_size                 16384 # program initial stack size
16ld_prog_entry            0×00400140 # program entry point (initial PC)
17ld_environ_base          0×7fff8000 # program environment base address address
18ld_target_big_endian              0 # target executable endian-ness, non-zero if big endian
19mem.page_count                   26 # total number of pages allocated
20mem.page_mem                   104k # total size of memory pages allocated
21mem.ptab_misses                  26 # total first level page table misses
22mem.ptab_accesses            495046 # total page table accesses
23mem.ptab_miss_rate           0.0001 # first level page table miss rate

That's it! Congratulations! Hope my changes helpful

声明:此日志是转自他人,

来源http://blog.csdn.net/bluefly21/article/details/6869719  

0 0