关于OpenMips

来源:互联网 发布:流水账记账软件 编辑:程序博客网 时间:2024/06/17 03:37
1、编译,参见《自己动手写CPU》P97
mips-linux-as.exe -mips32 inst_rom.s -o inst_rom.o

2、如何查看Section信息,参见《自己动手写CPU》P99
mips-linux-readelf.exe -S inst_rom.o

3、链接
mips-linux-ld.exe -T  ram.ld inst_rom.o -o inst_rom.om

4、分析.om文件
只读取ELF header
mips-linux-readelf.exe -h inst_rom.om
列出Program header信息
mips-linux-readelf.exe -l inst_rom.om

5、得到.bin文件
mips-linux-objcopy.exe -O binary inst_rom.om inst_rom.bin


6、将.bin文件转化为ModelSim中存储器初始化文件格式
Bin2Mem.exe -f inst_rom.bin -o inst_rom.data
0 0
原创粉丝点击