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
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