需要安装的软件有 mercurial scons swig gcc m4 python python-dev libgoogle-perftools-dev g++ libprotobuf-dev
创建ARM架构的模拟器:(参考网址 http://www.m5sim.org/Introduction )
1) 在gem5目录顶层,scons build/ARM/gem5.opt ,注意这里ARM要大写,创建成功后就出现一个./build文件夹
2)使用测试程序进行验证 build/ARM/gem5.opt configures/examples/se.py -c tests/test-progs/hello/bin/arm/linux/hello
创建X86架构的模拟器:(参考网址 http://www.m5sim.org/Introduction )
1)scons build/X86/gem5.prof 注意这里X86要大写
2)使用测试程序进行验证 build/X86/gem5.prof configures/examples/se.py -c tests/test-progs/hello/bin/x86/linux/hello
由于我的机子是X86架构的,因此我自己创建了一个测试程序,名称为hi.c 编译时要静态编译,不要使用任何动态库
gcc -static hi.c -o hi
测试验证 build/X86/gem5.prof configures/examples/se.py -c hi
结果输出正确