URL
https://opencores.org/ocsvn/mips789/mips789/trunk
Subversion Repositories mips789
Compare Revisions
- This comparison shows the changes necessary to convert path
/mips789/branches/avendor/tools
- from Rev 2 to Rev 51
- ↔ Reverse comparison
Rev 2 → Rev 51
/GENSIM.EXE
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
GENSIM.EXE
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: gensim.c
===================================================================
--- gensim.c (nonexistent)
+++ gensim.c (revision 51)
@@ -0,0 +1,107 @@
+#include "stdio.h"
+main(int file_no,char*file_name[])
+{
+ int j=4,i=0 ;
+ int cntr=0 ;
+ char str1[100],str2[111];
+ FILE*ff=fopen(file_name[1],"r");
+ FILE*ft=fopen(file_name[2],"w");
+ for(j=0;j<4;++j)
+ {
+ fprintf(ft,"module sim_syn_ram%d(\n",j);
+ fprintf(ft," data,\n");
+ fprintf(ft," wraddress,\n");
+ fprintf(ft," rdaddress_a,\n");
+ fprintf(ft," rdaddress_b,\n");
+ fprintf(ft," wren,\n");
+ fprintf(ft," clock,\n");
+ fprintf(ft," qa,\n");
+ fprintf(ft," qb);\n\n");
+ fprintf(ft," input [7:0] data;\n");
+ fprintf(ft," input [10:0] wraddress;\n");
+ fprintf(ft," input [10:0] rdaddress_a;\n");
+ fprintf(ft," input [10:0] rdaddress_b;\n");
+ fprintf(ft," input wren;\n");
+ fprintf(ft," reg [7:0] r_data;\n");
+ fprintf(ft," reg [10:0] r_wraddress;\n");
+ fprintf(ft," reg [10:0] r_rdaddress_a;\n");
+ fprintf(ft," reg [10:0] r_rdaddress_b;\n");
+ fprintf(ft," reg r_wren;\n");
+ fprintf(ft," input clock;\n");
+ fprintf(ft," output [7:0] qa;\n");
+ fprintf(ft," output [7:0] qb;\n");
+ fprintf(ft," reg [7:0] mem_bank [0:2047] ;\n");
+
+ fprintf(ft," always @ (posedge clock) if (r_wren) mem_bank[r_wraddress]<=r_data;\n");
+ fprintf(ft," initial begin \n");
+ rewind(ff);
+ i=-1 ;
+
+ while(fgets(str2,100,ff))
+ {
+ ++i ;
+ if(3==j)
+ {
+ str2[2]=0 ;
+ fprintf(ft," mem_bank[%d] = 'h%s ;",i,&str2[0]);
+ ++cntr ;
+ if(!(cntr%10))
+ {
+ cntr==0 ;
+ fprintf(ft,"\n ");
+ }
+ }
+ else
+ if(2==j)
+ {
+ str2[4]=0 ;
+
+ fprintf(ft," mem_bank[%d] = 'h%s ;",i,&str2[2]);
+
+ ++cntr ;
+ if(!(cntr%10))
+ {
+ cntr==0 ;
+ fprintf(ft,"\n ");
+ }
+ }
+ else
+ if(1==j)
+ {
+ str2[6]=0 ;
+ fprintf(ft," mem_bank[%d] = 'h%s ;",i,&str2[4]);
+
+ ++cntr ;
+ if(!(cntr%10))
+ {
+ cntr==0 ;
+ fprintf(ft,"\n ");
+ }
+ }
+ else
+ if(0==j)
+ {
+ str2[8]=0 ;
+ fprintf(ft," mem_bank[%d] = 'h%s ;",i,&str2[6]);
+
+ ++cntr ;
+ if(!(cntr%10))
+ {
+ cntr==0 ;
+ fprintf(ft,"\n ");
+ }
+ }
+ }
+ fprintf(ft," \nend\n always @ (posedge clock)\n");
+ fprintf(ft," begin\n");
+ fprintf(ft," r_data<=data;\n");
+ fprintf(ft," r_wraddress<=wraddress;\n");
+ fprintf(ft," r_rdaddress_a<=rdaddress_a;\n");
+ fprintf(ft," r_rdaddress_b<=rdaddress_b;\n");
+ fprintf(ft," r_wren<=wren;\n");
+ fprintf(ft," end\n");
+ fprintf(ft," assign qa =mem_bank[r_rdaddress_a];\n");
+ fprintf(ft," assign qb =mem_bank[r_rdaddress_b];\n");
+ fprintf(ft,"endmodule\n\n\n\n");
+ }
+}
Index: GENMIF.EXE
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: GENMIF.EXE
===================================================================
--- GENMIF.EXE (nonexistent)
+++ GENMIF.EXE (revision 51)
GENMIF.EXE
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: genmif.c
===================================================================
--- genmif.c (nonexistent)
+++ genmif.c (revision 51)
@@ -0,0 +1,52 @@
+#include "stdio.h"
+void main(void)
+{
+ int j=4,i=0 ;
+ char str1[100],str2[111];
+ FILE*ff=fopen("code.txt","r");
+ FILE*ft ;
+ for(j=0;j<4;++j)
+ {
+ if(j==0)
+ ft=fopen("qu2_ram0.mif","w");
+ else if(j==1)
+ ft=fopen("qu2_ram1.mif","w");
+ else if(j==2)
+ ft=fopen("qu2_ram2.mif","w");
+ else if(j==3)
+ ft=fopen("qu2_ram3.mif","w");
+
+ fprintf(ft,"WIDTH=8;\n");
+ fprintf(ft,"DEPTH=1024;\n\n");
+ fprintf(ft,"ADDRESS_RADIX=HEX;\n");
+ fprintf(ft,"DATA_RADIX=HEX;\n\n");
+ fprintf(ft,"CONTENT BEGIN \n");
+ rewind(ff);
+ i=-1 ;
+ while(fgets(str2,100,ff))
+ {
+ ++i ;
+ if(3==j)
+ {
+ str2[2]=0 ;
+ fprintf(ft," %X : %s;\n",i,&str2[0]);
+ }
+ else if(2==j)
+ {
+ str2[4]=0 ;
+ fprintf(ft," %X : %s;\n",i,&str2[2]);
+ }
+ else if(1==j)
+ {
+ str2[6]=0 ;
+ fprintf(ft," %X : %s;\n",i,&str2[4]);
+ }
+ else if(0==j)
+ {
+ str2[8]=0 ;
+ fprintf(ft," %X : %s;\n",i,&str2[6]);
+ }
+ }
+ fprintf(ft,"END;");
+ }
+}
Index: iStyle.exe
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: iStyle.exe
===================================================================
--- iStyle.exe (nonexistent)
+++ iStyle.exe (revision 51)
iStyle.exe
Property changes :
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property