资源简介
最全面的OpenRosc or1200解读资料,不仅包含书籍还附带关盘内容
代码片段和文件信息
/*
* Xiang Li olivercamel@gmail.com
* Lin Zuo superzuolin@gmail.com
* Last Revised: 2008/06/28
*
* This is a converter tool written in C which used to generate MIF
* format files from Intel-HEX format. MIF format is used in ALTERA
* Quartus to initialize on-chip RAM.
*
* The size of On-chip RAM is defined when it is created in Quartus.
* Before using this converter check if MIF_DEPTH and MIF_WIDTH
* match the target On-chip RAM. Unfortunatly so far only 32-bit
* MIF_WIDTH is supported.
*
* Usage: ihex2mif.exe -f input.ihex -o output.mif
*/
#define MIF_DEPTH 8192
#define MIF_WIDTH 32
#include
#include
char *option_invalid = NULL;
char *option_file_in = NULL;
char *option_file_out = NULL;
FILE *file_in_descriptor = NULL;
FILE *file_out_descriptor = NULL;
void help_info(void) {
printf(“\n“);
printf(“Binary to ModelSim mem.data Converter\n“);
printf(“\n“);
printf(“\n“);
printf(“Usage: Bin2Mem.exe [options] file ...\n“);
printf(“Options:\n“);
printf(“ -h Help: Display this information.\n“);
printf(“ -f Input: Specify an intput Binary file.\n“);
printf(“ -o Output: Specify an output mem.data file.\n“);
printf(“\n“);
printf(“Examples:\n“);
printf(“ ./Bin2Mem.exe -f input.bin -o mem.data\n“);
printf(“\n“);
}
void exception_handler(int code) {
switch (code) {
case 0:
break;
case 10001:
printf(“Error (10001): No option recognized.\n“);
printf(“Please specify at least one valid option.\n“);
printf(“Try ‘-h‘ for more information.\n“);
break;
case 10002:
printf(“Error (10002): Invalid option: %s\n“ option_invalid);
printf(“Try ‘-h‘ for more information.\n“);
break;
case 10003:
printf(“Error (10003): No input Binary file specified.\n“);
printf(“Try ‘-h‘ for more information.\n“);
break;
case 10004:
printf(“Error (10004): Cannot open file: %s\n“ option_file_in);
printf(“Try ‘-h‘ for more information.\n“);
break;
case 10005:
printf(“Error (10005): Cannot create file: %s\n“ option_file_out);
printf(“Try ‘-h‘ for more information.\n“);
break;
case 10006:
printf(“Error (10006): Binary file contains too much data to put into on-chip RAM.\n“);
break;
default:
break;
}
if (file_in_descriptor != NULL) {
fclose(file_in_descriptor);
}
if (file_out_descriptor != NULL) {
fclose(file_out_descriptor);
}
exit(0);
}
int main(int argc char **argv) {
int i=0j=0;
unsigned char temp1temp2temp3temp4;
unsigned int option_flag = 0;
while (argc > 0) {
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1499136 2011-07-20 15:20 软核处理器\autorun.exe
文件 47 2011-08-03 10:17 软核处理器\autorun.inf
文件 608448 2000-05-22 16:58 软核处理器\comctl32.ocx
文件 2737762 2006-02-07 14:48 软核处理器\phei.avi
文件 5182 2012-12-11 17:23 软核处理器\Project\Bin2Mem\Bin2Mem.c
文件 11829 2012-11-19 13:59 软核处理器\Project\Bin2Mem\Bin2Mem.exe
文件 11829 2012-12-11 17:23 软核处理器\Project\Chapter10\Code\Bin2Mem.exe
文件 16872 2013-02-01 00:11 软核处理器\Project\Chapter10\Code\Example.o
文件 24917 2013-02-01 00:11 软核处理器\Project\Chapter10\Code\Example.or32
文件 7178 2013-02-01 00:10 软核处理器\Project\Chapter10\Code\Example.S
文件 7144 2013-02-01 00:10 软核处理器\Project\Chapter10\Code\Example.S.bak
文件 564 2013-01-05 13:49 软核处理器\Project\Chapter10\Code\Makefile
文件 578 2013-01-04 16:16 软核处理器\Project\Chapter10\Code\Makefile.bak
文件 16404 2013-02-01 00:11 软核处理器\Project\Chapter10\Code\mem.bin
文件 36918 2013-02-01 00:11 软核处理器\Project\Chapter10\Code\mem.data
文件 1724 2012-11-18 10:40 软核处理器\Project\Chapter10\Code\ram.ld
文件 36918 2013-02-01 00:11 软核处理器\Project\Chapter10\mem.data
文件 10600 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_alu\verilog.prw
文件 111864 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_alu\verilog.psm
文件 7095 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_alu\_primary.dat
文件 15824 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_alu\_primary.dbs
文件 1053 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_alu\_primary.vhd
文件 1371 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_cfgr\verilog.prw
文件 9432 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_cfgr\verilog.psm
文件 3115 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_cfgr\_primary.dat
文件 16005 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_cfgr\_primary.dbs
文件 224 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_cfgr\_primary.vhd
文件 31716 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_cpu\verilog.prw
文件 79112 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_cpu\verilog.psm
文件 13974 2013-02-01 00:12 软核处理器\Project\Chapter10\min_or1200\or1200_cpu\_primary.dat
............此处省略8017个文件信息
评论
共有 条评论