OpenCores
URL https://opencores.org/ocsvn/lwrisc/lwrisc/trunk

Subversion Repositories lwrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 6 to Rev 7
    Reverse comparison

Rev 6 → Rev 7

/trunk/BENCH/test1/alt_mem_set.h
0,0 → 1,4
`define ALT_MEM_WIDTHAD 7
`define ALT_MEM_NUMWORDS 128
`define MIF_NAME init_file.mif
 
/trunk/BENCH/test1/test1.c
0,0 → 1,27
#include <16c57.h>//the is no 16f57.h file in the my version of ccs.so using it instered
 
#byte DISP = 100
 
disp_byte(char c){
switch (c){
case 0:DISP ='0';break;
case 1:DISP ='1';break;
case 2:DISP ='2';break;
case 3:DISP ='3';break;
case 4:DISP ='4';break;
case 5:DISP ='5';break;
case 6:DISP ='6';break;
case 7:DISP ='7';break;
case 8:DISP ='8';break;
case 9:DISP ='9';break;
}
}
 
main(){
char i=0,j=0;
while(1){
i=++i%10;
disp_byte(i);
}
}
 
/trunk/BENCH/test1/Dasm.txt
0,0 → 1,118
0000 : GOTO 101
0001 : GOTO 3
0002 : GOTO 26
0003 : MOVFW 0x0e
0004 : CLRF 0x09
0005 : SUBWFW 0x0d
0006 : BTFSC STATUS [0]
0007 : GOTO 11
0008 : MOVFW 0x0d
0009 : MOVWF 0x08
0010 : GOTO 23
0011 : CLRF 0x08
0012 : MOVLW 8
0013 : MOVWF 0x0f
0014 : RLFF 0x0d
0015 : RLFF 0x08
0016 : MOVFW 0x0e
0017 : SUBWFW 0x08
0018 : BTFSC STATUS [0]
0019 : MOVWF 0x08
0020 : RLFF 0x09
0021 : DECFSZF 0x0f [7]
0022 : GOTO 14
0023 : BCF STATUS [5]
0024 : BCF STATUS [6]
0025 : GOTO 110
0026 : MOVFW 0x0d
0027 : MOVWF 0x08
0028 : MOVFF 0x08
0029 : BTFSC STATUS [2]
0030 : GOTO 68
0031 : MOVLW 1
0032 : SUBWFW 0x08
0033 : BTFSC STATUS [2]
0034 : GOTO 71
0035 : MOVLW 2
0036 : SUBWFW 0x08
0037 : BTFSC STATUS [2]
0038 : GOTO 74
0039 : MOVLW 3
0040 : SUBWFW 0x08
0041 : BTFSC STATUS [2]
0042 : GOTO 77
0043 : MOVLW 4
0044 : SUBWFW 0x08
0045 : BTFSC STATUS [2]
0046 : GOTO 80
0047 : MOVLW 5
0048 : SUBWFW 0x08
0049 : BTFSC STATUS [2]
0050 : GOTO 83
0051 : MOVLW 6
0052 : SUBWFW 0x08
0053 : BTFSC STATUS [2]
0054 : GOTO 86
0055 : MOVLW 7
0056 : SUBWFW 0x08
0057 : BTFSC STATUS [2]
0058 : GOTO 89
0059 : MOVLW 8
0060 : SUBWFW 0x08
0061 : BTFSC STATUS [2]
0062 : GOTO 92
0063 : MOVLW 9
0064 : SUBWFW 0x08
0065 : BTFSC STATUS [2]
0066 : GOTO 95
0067 : GOTO 98
0068 : MOVLW 48
0069 : MOVWF 0x1f
0070 : GOTO 98
0071 : MOVLW 49
0072 : MOVWF 0x1f
0073 : GOTO 98
0074 : MOVLW 50
0075 : MOVWF 0x1f
0076 : GOTO 98
0077 : MOVLW 51
0078 : MOVWF 0x1f
0079 : GOTO 98
0080 : MOVLW 52
0081 : MOVWF 0x1f
0082 : GOTO 98
0083 : MOVLW 53
0084 : MOVWF 0x1f
0085 : GOTO 98
0086 : MOVLW 54
0087 : MOVWF 0x1f
0088 : GOTO 98
0089 : MOVLW 55
0090 : MOVWF 0x1f
0091 : GOTO 98
0092 : MOVLW 56
0093 : MOVWF 0x1f
0094 : GOTO 98
0095 : MOVLW 57
0096 : MOVWF 0x1f
0097 : GOTO 98
0098 : BCF STATUS [5]
0099 : BCF STATUS [6]
0100 : GOTO 115
0101 : CLRF FSR
0102 : CLRF 0x0b
0103 : CLRF 0x0c
0104 : INCFF 0x0b
0105 : MOVFW 0x0b
0106 : MOVWF 0x0d
0107 : MOVLW 10
0108 : MOVWF 0x0e
0109 : GOTO 1
0110 : MOVFW 0x08
0111 : MOVWF 0x0b
0112 : MOVFW 0x0b
0113 : MOVWF 0x0d
0114 : GOTO 2
0115 : GOTO 104
0116 : NOP
2047 : GOTO 0
/trunk/BENCH/test1/test1.HEX
0,0 → 1,18
:10000000650A030A1A0A0E0269008D0003060B0A2C
:100010000D022800170A6800080C2F006D03680302
:100020000E028800030628006903EF020E0AA304EB
:10003000C3046E0A0D02280028024306440A010C7C
:1000400088004306470A020C880043064A0A030C4C
:10005000880043064D0A040C88004306500A050C2C
:1000600088004306530A060C88004306560A070C0C
:1000700088004306590A080C880043065C0A090CEC
:10008000880043065F0A620A300C3F00620A310CA6
:100090003F00620A320C3F00620A330C3F00620AE2
:1000A000340C3F00620A350C3F00620A360C3F00F8
:1000B000620A370C3F00620A380C3F00620A390CB2
:1000C0003F00620AA304C304730A64006B006C005F
:1000D000AB020B022D000A0C2E00010A08022B00B5
:0A00E0000B022D00020A680A03005B
:020FFE00000AE7
:00000001FF
;PIC16C57
/trunk/BENCH/test1/sim_rom.v
0,0 → 1,278
//This file was created by a tool wrietten with C.
module sim_rom (
address,
clock,
q);
input [10:0] address;
input clock;
output [11:0] q;
reg [10:0] address_latched;
// Instantiate the memory array itself.
reg [11:0] mem[0:2048-1];
initial begin
mem[0000] = 12'b101001100101;
mem[0001] = 12'b101000000011;
mem[0002] = 12'b101000011010;
mem[0003] = 12'b001000001110;
mem[0004] = 12'b000001101001;
mem[0005] = 12'b000010001101;
mem[0006] = 12'b011000000011;
mem[0007] = 12'b101000001011;
mem[0008] = 12'b001000001101;
mem[0009] = 12'b000000101000;
mem[0010] = 12'b101000010111;
mem[0011] = 12'b000001101000;
mem[0012] = 12'b110000001000;
mem[0013] = 12'b000000101111;
mem[0014] = 12'b001101101101;
mem[0015] = 12'b001101101000;
mem[0016] = 12'b001000001110;
mem[0017] = 12'b000010001000;
mem[0018] = 12'b011000000011;
mem[0019] = 12'b000000101000;
mem[0020] = 12'b001101101001;
mem[0021] = 12'b001011101111;
mem[0022] = 12'b101000001110;
mem[0023] = 12'b010010100011;
mem[0024] = 12'b010011000011;
mem[0025] = 12'b101001101110;
mem[0026] = 12'b001000001101;
mem[0027] = 12'b000000101000;
mem[0028] = 12'b001000101000;
mem[0029] = 12'b011001000011;
mem[0030] = 12'b101001000100;
mem[0031] = 12'b110000000001;
mem[0032] = 12'b000010001000;
mem[0033] = 12'b011001000011;
mem[0034] = 12'b101001000111;
mem[0035] = 12'b110000000010;
mem[0036] = 12'b000010001000;
mem[0037] = 12'b011001000011;
mem[0038] = 12'b101001001010;
mem[0039] = 12'b110000000011;
mem[0040] = 12'b000010001000;
mem[0041] = 12'b011001000011;
mem[0042] = 12'b101001001101;
mem[0043] = 12'b110000000100;
mem[0044] = 12'b000010001000;
mem[0045] = 12'b011001000011;
mem[0046] = 12'b101001010000;
mem[0047] = 12'b110000000101;
mem[0048] = 12'b000010001000;
mem[0049] = 12'b011001000011;
mem[0050] = 12'b101001010011;
mem[0051] = 12'b110000000110;
mem[0052] = 12'b000010001000;
mem[0053] = 12'b011001000011;
mem[0054] = 12'b101001010110;
mem[0055] = 12'b110000000111;
mem[0056] = 12'b000010001000;
mem[0057] = 12'b011001000011;
mem[0058] = 12'b101001011001;
mem[0059] = 12'b110000001000;
mem[0060] = 12'b000010001000;
mem[0061] = 12'b011001000011;
mem[0062] = 12'b101001011100;
mem[0063] = 12'b110000001001;
mem[0064] = 12'b000010001000;
mem[0065] = 12'b011001000011;
mem[0066] = 12'b101001011111;
mem[0067] = 12'b101001100010;
mem[0068] = 12'b110000110000;
mem[0069] = 12'b000000111111;
mem[0070] = 12'b101001100010;
mem[0071] = 12'b110000110001;
mem[0072] = 12'b000000111111;
mem[0073] = 12'b101001100010;
mem[0074] = 12'b110000110010;
mem[0075] = 12'b000000111111;
mem[0076] = 12'b101001100010;
mem[0077] = 12'b110000110011;
mem[0078] = 12'b000000111111;
mem[0079] = 12'b101001100010;
mem[0080] = 12'b110000110100;
mem[0081] = 12'b000000111111;
mem[0082] = 12'b101001100010;
mem[0083] = 12'b110000110101;
mem[0084] = 12'b000000111111;
mem[0085] = 12'b101001100010;
mem[0086] = 12'b110000110110;
mem[0087] = 12'b000000111111;
mem[0088] = 12'b101001100010;
mem[0089] = 12'b110000110111;
mem[0090] = 12'b000000111111;
mem[0091] = 12'b101001100010;
mem[0092] = 12'b110000111000;
mem[0093] = 12'b000000111111;
mem[0094] = 12'b101001100010;
mem[0095] = 12'b110000111001;
mem[0096] = 12'b000000111111;
mem[0097] = 12'b101001100010;
mem[0098] = 12'b010010100011;
mem[0099] = 12'b010011000011;
mem[0100] = 12'b101001110011;
mem[0101] = 12'b000001100100;
mem[0102] = 12'b000001101011;
mem[0103] = 12'b000001101100;
mem[0104] = 12'b001010101011;
mem[0105] = 12'b001000001011;
mem[0106] = 12'b000000101101;
mem[0107] = 12'b110000001010;
mem[0108] = 12'b000000101110;
mem[0109] = 12'b101000000001;
mem[0110] = 12'b001000001000;
mem[0111] = 12'b000000101011;
mem[0112] = 12'b001000001011;
mem[0113] = 12'b000000101101;
mem[0114] = 12'b101000000010;
mem[0115] = 12'b101001101000;
mem[0116] = 12'b000000000011;
mem[2047] = 12'b101000000000;
end
// Latch address
always @(posedge clock)
address_latched <= address;
// READ
assign q = mem[address_latched];
 
endmodule
 
/*
0000: GOTO 101
0001: GOTO 3
0002: GOTO 26
0003: MOVFW 0x0e
0004: CLRF 0x09
0005: SUBWFW 0x0d
0006: BTFSC STATUS [0]
0007: GOTO 11
0008: MOVFW 0x0d
0009: MOVWF 0x08
0010: GOTO 23
0011: CLRF 0x08
0012: MOVLW 8
0013: MOVWF 0x0f
0014: RLFF 0x0d
0015: RLFF 0x08
0016: MOVFW 0x0e
0017: SUBWFW 0x08
0018: BTFSC STATUS [0]
0019: MOVWF 0x08
0020: RLFF 0x09
0021: DECFSZF 0x0f [7]
0022: GOTO 14
0023: BCF STATUS [5]
0024: BCF STATUS [6]
0025: GOTO 110
0026: MOVFW 0x0d
0027: MOVWF 0x08
0028: MOVFF 0x08
0029: BTFSC STATUS [2]
0030: GOTO 68
0031: MOVLW 1
0032: SUBWFW 0x08
0033: BTFSC STATUS [2]
0034: GOTO 71
0035: MOVLW 2
0036: SUBWFW 0x08
0037: BTFSC STATUS [2]
0038: GOTO 74
0039: MOVLW 3
0040: SUBWFW 0x08
0041: BTFSC STATUS [2]
0042: GOTO 77
0043: MOVLW 4
0044: SUBWFW 0x08
0045: BTFSC STATUS [2]
0046: GOTO 80
0047: MOVLW 5
0048: SUBWFW 0x08
0049: BTFSC STATUS [2]
0050: GOTO 83
0051: MOVLW 6
0052: SUBWFW 0x08
0053: BTFSC STATUS [2]
0054: GOTO 86
0055: MOVLW 7
0056: SUBWFW 0x08
0057: BTFSC STATUS [2]
0058: GOTO 89
0059: MOVLW 8
0060: SUBWFW 0x08
0061: BTFSC STATUS [2]
0062: GOTO 92
0063: MOVLW 9
0064: SUBWFW 0x08
0065: BTFSC STATUS [2]
0066: GOTO 95
0067: GOTO 98
0068: MOVLW 48
0069: MOVWF 0x1f
0070: GOTO 98
0071: MOVLW 49
0072: MOVWF 0x1f
0073: GOTO 98
0074: MOVLW 50
0075: MOVWF 0x1f
0076: GOTO 98
0077: MOVLW 51
0078: MOVWF 0x1f
0079: GOTO 98
0080: MOVLW 52
0081: MOVWF 0x1f
0082: GOTO 98
0083: MOVLW 53
0084: MOVWF 0x1f
0085: GOTO 98
0086: MOVLW 54
0087: MOVWF 0x1f
0088: GOTO 98
0089: MOVLW 55
0090: MOVWF 0x1f
0091: GOTO 98
0092: MOVLW 56
0093: MOVWF 0x1f
0094: GOTO 98
0095: MOVLW 57
0096: MOVWF 0x1f
0097: GOTO 98
0098: BCF STATUS [5]
0099: BCF STATUS [6]
0100: GOTO 115
0101: CLRF FSR
0102: CLRF 0x0b
0103: CLRF 0x0c
0104: INCFF 0x0b
0105: MOVFW 0x0b
0106: MOVWF 0x0d
0107: MOVLW 10
0108: MOVWF 0x0e
0109: GOTO 1
0110: MOVFW 0x08
0111: MOVWF 0x0b
0112: MOVFW 0x0b
0113: MOVWF 0x0d
0114: GOTO 2
0115: GOTO 104
0116: NOP
2047: GOTO 0
*/
/*
covered instructions:
 
GOTO
MOVFW
CLRF
SUBWFW
BTFSC
MOVWF
MOVLW
RLFF
DECFSZF
BCF
MOVFF
INCFF
NOP
*/
/trunk/BENCH/test1/tested_instructions.txt
0,0 → 1,14
 
GOTO
MOVFW
CLRF
SUBWFW
BTFSC
MOVWF
MOVLW
RLFF
DECFSZF
BCF
MOVFF
INCFF
NOP
/trunk/BENCH/test1/init_file.mif
0,0 → 1,126
WIDTH=12;
DEPTH=2048;
 
ADDRESS_RADIX=HEX;
DATA_RADIX=HEX;
 
CONTENT BEGIN
0 : A65;
1 : A03;
2 : A1A;
3 : 20E;
4 : 69;
5 : 8D;
6 : 603;
7 : A0B;
8 : 20D;
9 : 28;
A : A17;
B : 68;
C : C08;
D : 2F;
E : 36D;
F : 368;
10 : 20E;
11 : 88;
12 : 603;
13 : 28;
14 : 369;
15 : 2EF;
16 : A0E;
17 : 4A3;
18 : 4C3;
19 : A6E;
1A : 20D;
1B : 28;
1C : 228;
1D : 643;
1E : A44;
1F : C01;
20 : 88;
21 : 643;
22 : A47;
23 : C02;
24 : 88;
25 : 643;
26 : A4A;
27 : C03;
28 : 88;
29 : 643;
2A : A4D;
2B : C04;
2C : 88;
2D : 643;
2E : A50;
2F : C05;
30 : 88;
31 : 643;
32 : A53;
33 : C06;
34 : 88;
35 : 643;
36 : A56;
37 : C07;
38 : 88;
39 : 643;
3A : A59;
3B : C08;
3C : 88;
3D : 643;
3E : A5C;
3F : C09;
40 : 88;
41 : 643;
42 : A5F;
43 : A62;
44 : C30;
45 : 3F;
46 : A62;
47 : C31;
48 : 3F;
49 : A62;
4A : C32;
4B : 3F;
4C : A62;
4D : C33;
4E : 3F;
4F : A62;
50 : C34;
51 : 3F;
52 : A62;
53 : C35;
54 : 3F;
55 : A62;
56 : C36;
57 : 3F;
58 : A62;
59 : C37;
5A : 3F;
5B : A62;
5C : C38;
5D : 3F;
5E : A62;
5F : C39;
60 : 3F;
61 : A62;
62 : 4A3;
63 : 4C3;
64 : A73;
65 : 64;
66 : 6B;
67 : 6C;
68 : 2AB;
69 : 20B;
6A : 2D;
6B : C0A;
6C : 2E;
6D : A01;
6E : 208;
6F : 2B;
70 : 20B;
71 : 2D;
72 : A02;
73 : A68;
74 : 3;
7FF : A00;
ND;
/trunk/BENCH/test1/tov.bat
0,0 → 1,7
path;
path=..\..\ctool
hexdasm test1.hex
copy *.mif ..\..\rtl
copy *.h ..\..\rtl
copy *.v ..\..\rtl
copy *.h ..\..\sim
/trunk/CTOOL/hexdasm.exe Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
trunk/CTOOL/hexdasm.exe Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/CTOOL/hexdasm.c =================================================================== --- trunk/CTOOL/hexdasm.c (nonexistent) +++ trunk/CTOOL/hexdasm.c (revision 7) @@ -0,0 +1,965 @@ +#include "stdlib.h" +#include "stdio.h" +#include "string.h" + +int func1(int in) +{ +const int table[]={1,2,4,8,16,32,64,128,256,512,1024,2048}; +int i =0; +if (in>=2048)return -1; +for(;;i++) +if ((in>table[i])&&(in=8) goto else + if(p!=NULL) + strcpy(__hex,p); + else + { + __hex[0]='0' ; + __hex[1]='x' ; + __hex[2]=hex[t/16]; + __hex[3]=hex[t%16]; + __hex[4]=0 ; + } + return __hex ; +} + +char _temp[100]; +//get file reg adderss from instruction! +char*gen_ins_fa(char*ins) +{//gen_ins_in( + strcpy(_temp,ins); + return bs2hs(&_temp[7]); +} + +//get bit data from instruction! +unsigned int gen_ins_bd(char*ins) +{ +//1111_1111_1111 + unsigned int t=0 ; + if(ins[5+1]=='1')t+=1 ; + if(ins[4+1]=='1')t+=2 ; + if(ins[3+1]=='1')t+=4 ; + return t ; +} + +//get goto(and call) address data from instruction! +unsigned int gen_ins_goto(char*ins) +{ +//000_111111001 + unsigned int t=0 ; + if(ins[11-0]=='1')t+=1; + if(ins[11-1]=='1')t+=2 ; + if(ins[11-2]=='1')t+=4; + if(ins[11-3]=='1')t+=8 ; + if(ins[11-4]=='1')t+=16;//1<<4 ; + if(ins[11-5]=='1')t+=32;//1<<5 ; + if(ins[11-6]=='1')t+=64;//1<<6 ; + if(ins[11-7]=='1')t+=128;//1<<7 ; + if(ins[11-8]=='1')t+=256;//1<<8 ; + return t ; +} + +//get instant data from instruction! +unsigned int gen_ins_in(char*ins) +{ + unsigned int t=0 ; + if(ins[11-0]=='1')t+=1; + if(ins[11-1]=='1')t+=2 ; + if(ins[11-2]=='1')t+=4;//1<<3 ; + if(ins[11-3]=='1')t+=8;//1<<4 ; + if(ins[11-4]=='1')t+=16;//1<<4 ; + if(ins[11-5]=='1')t+=32;//1<<5 ; + if(ins[11-6]=='1')t+=64;//1<<6 ; + if(ins[11-7]=='1')t+=128;//1<<7 ; + // if(ins[11-8]=='1')t+=1<<8 ; + return t ; +} + + +unsigned int inscmp(char*src,char*dst) +{ + unsigned int i ; + for(i=0;i<=9;i++) + { + if(src[i]=='X')continue ; + else if(src[i]!=dst[i])return 0 ; + } + return 1 ; +} + + +unsigned int str2u12(char*str) +{ + unsigned int ret=0 ; + unsigned int i ; + for(i=0;i<=11;++i) + { + if(str[i]==0)return ret ; + ret=ret*10+str[i]-'0' ; + } + return ret ; +} +/* +unsigned int getfno(char *ins,unsigned char start, +unsigned char len) +{ +unsigned int data = str2u12(ins); + unsigned int tmp1=0xffff<>start ; + unsigned int ret ; + tmp1=~tmp1 ; + ret=tmp1&tmp2 ; + ret=ret&0xffff ; + return ret ; + +unsigned int i,ret=0; +for(i=11-start;i%s<\n",ins);getchar(); +strcpy(ins_tsted[index],ins); +} + +int main(int argc,char*argv[]) +{ + + + int i ; + int addr_wdt,wd_no; + int max=0; + init1(); + + if(argc==2)strcpy(fin,argv[1]); + else + { + // printf("\nThe Synthetic PIC --- Intel HEX File to Altera memory file"); + // printf("\nUsage: hex2mif "); + // printf("\n"); + getchar(); + return 0 ; + printf("Input Hex file name:"); + scanf("%s",fin); + printf("Input Mif file name:"); + scanf("%s",mif_fn); + } + + + + /* Open input HEX file */ + fpi=fopen(argv[1],"r"); + if(!fpi) + { + printf("\nCan't open input file %s.\n",argv[1]); + return 1 ; + } + + /* Read in the HEX file */ + /* */ + /* !! Note, that things are a little strange for us, because the PIC is */ + /* a 12-bit instruction, addresses are 16-bit, and the hex format is */ + /* 8-bit oriented!! */ + /* */ + nMemoryCount=0 ; + while(!feof(fpi)) + { + /* Get one Intel HEX line */ + fgets(szLine,80,fpi); + if(strlen(szLine)>=10) + { + /* This is the PIC, with its 12-bit "words". We're interested in these */ + /* words and not the bytes. Read 4 hex digits at a time for each */ + /* address. */ + /* */ + sscanf(&szLine[1],"%2x%4x",&ndata_bytes,&start_address); + if(start_address>=0&&start_address<=20000&&ndata_bytes>0) + { + /* Suck up data bytes starting at 9th byte. */ + i=9 ; + + /* Words.. not bytes.. */ + ndata_words=ndata_bytes/2 ; + start_address=start_address/2 ; + + /* Spit out all the data that is supposed to be on this line. */ + for(address=start_address;address>8)&0x00ff)|((data<<8)&0xff00); + i+=4 ; + + /* Store in our memory buffer */ + Memory[nMemoryCount].nAddress=address ; + Memory[nMemoryCount].byData=data ; + nMemoryCount++; + } + } + } + } + fclose(fpi); + + /* + for(i=0;;++i) + { + mif_fn[i]=fin[i]; + if(mif_fn[i]=='.') + { + mif_fn[i+1]='m' ; + mif_fn[i+2]='i' ; + mif_fn[3+i]='f' ; + mif_fn[4+i]=0 ; + break ; + } + } + */ + + strcpy(mif_fn,"init_file.mif"); + + fpi=fopen(mif_fn,"w"); + if(NULL==fpi)return ; + /* Now output the Verilog $readmemh format! */ + /* */ + + /* Now output the Verilog $readmemh format! */ + /* */ + fprintf(fpi,"WIDTH=12;\nDEPTH=2048;\n\nADDRESS_RADIX=HEX;\nDATA_RADIX=HEX;\n\nCONTENT BEGIN\n"); + printf("WIDTH=8;\nDEPTH=256;\n\nADDRESS_RADIX=HEX;\nDATA_RADIX=HEX;\n\nCONTENT BEGIN\n"); + printf("Email:McuPro@163.com\n"); + + for(i=0;imax) max=Memory[i].nAddress; + // Memory[i].nAddressfprintf(fpi,"%04d:%s\n",Memory[i].nAddress,ins12tostr(Memory[i].byData)); + // sprintf(Memory[i].ins,"%s",ins12tostr(Memory[i].byData)); + //fprintf(fpi,"%04d : %s\n",Memory[i].nAddress,branch_ins(ins12tostr(Memory[i].byData))); + // fprintf(fpi,"mem[%d] = %d;\n",Memory[i].nAddress,Memory[i].byData); + // fprintf(fpi,"mem[%d] = %d;\n", + } + addr_wdt = func1(max); + fprintf(fpi,"`define ALT_MEM_WIDTHAD %d\n",addr_wdt); + fprintf(fpi,"`define ALT_MEM_NUMWORDS %d\n",1< 500 megabyte memory footprint). Default is disabled. +; Specify number of megabytes to lock. +; LockedMemory = 1000 + +; HP-UX 11.00 ONLY - Use /usr/lib/libCsup_v2.sl for shared object loading. +; This is necessary when C++ files have been compiled with aCC's -AA option. +; The default behavior is to use /usr/lib/libCsup.sl. +; UseCsupV2 = 1 + +; Turn on (1) or off (0) WLF file compression. +; The default is 1 (compress WLF file). +; WLFCompress = 0 + +; Specify whether to save all design hierarchy (1) in the WLF file +; or only regions containing logged signals (0). +; The default is 0 (log only regions with logged signals). +; WLFSaveAllRegions = 1 + +; WLF file time limit. Limit WLF file by time, as closely as possible, +; to the specified amount of simulation time. When the limit is exceeded +; the earliest times get truncated from the file. +; If both time and size limits are specified the most restrictive is used. +; UserTimeUnits are used if time units are not specified. +; The default is 0 (no limit). Example: WLFTimeLimit = {100 ms} +; WLFTimeLimit = 0 + +; WLF file size limit. Limit WLF file size, as closely as possible, +; to the specified number of megabytes. If both time and size limits +; are specified then the most restrictive is used. +; The default is 0 (no limit). +; WLFSizeLimit = 1000 + +; Specify whether or not a WLF file should be deleted when the +; simulation ends. A value of 1 will cause the WLF file to be deleted. +; The default is 0 (do not delete WLF file when simulation ends). +; WLFDeleteOnQuit = 1 + +; Specify whether or not a WLF file should be optimized during +; simulation. If set to 0, the WLF file will not be optimized. +; The default is 1, optimize the WLF file. +; WLFOptimize = 0 + +; Specify the name of the WLF file. +; The default is vsim.wlf +; WLFFilename = vsim.wlf + +; Specify whether or not integer arrays will appear as memories. +; The default is 1 (display integer arrays as memories). +; ShowIntMem = 0 + +; Specify whether or not enumerated type arrays (other than std_logic-based) +; will appear as memories. +; The default is 1 (display enumerated type arrays as memories). +; ShowEnumMem = 0 + +; Specify whether or not arrays of 3 or more dimensions will appear as memories. +; The default is 1 (display 3D+ type arrays as memories). +; Show3DMem = 0 + +; Turn on/off undebuggable SystemC type warnings. Default is on. +; ShowUndebuggableScTypeWarning = 0 + +; Turn on/off unassociated SystemC name warnings. Default is off. +; ShowUnassociatedScNameWarning = 1 + +; Turn on/off PSL assertion pass enable. Default is off. +; AssertionPassEnable = 1 + +; Turn on/off PSL assertion fail enable. Default is on. +; AssertionFailEnable = 0 + +; Set PSL assertion pass limit. Default is 1. +; Any positive integer, -1 for infinity. +; AssertionPassLimit = -1 + +; Set PSL assertion fail limit. Default is 1. +; Any positive integer, -1 for infinity. +; AssertionFailLimit = -1 + +; Turn on/off PSL assertion pass log. Default is on. +; AssertionPassLog = 0 + +; Turn on/off PSL assertion fail log. Default is on. +; AssertionFailLog = 0 + +; Set action type for PSL assertion fail action. Default is continue. +; 0 = Continue 1 = Break 2 = Exit +; AssertionFailAction = 1 + +; Check vsim plusargs. Default is 0 (off). +; 0 = Don't check plusargs +; 1 = Warning on unrecognized plusarg +; 2 = Error and exit on unrecognized plusarg +; CheckPlusargs = 1 + +[lmc] +; ModelSim's interface to Logic Modeling's SmartModel SWIFT software +libsm = $MODEL_TECH/libsm.sl +; ModelSim's interface to Logic Modeling's SmartModel SWIFT software (Windows NT) +; libsm = $MODEL_TECH/libsm.dll +; Logic Modeling's SmartModel SWIFT software (HP 9000 Series 700) +; libswift = $LMC_HOME/lib/hp700.lib/libswift.sl +; Logic Modeling's SmartModel SWIFT software (IBM RISC System/6000) +; libswift = $LMC_HOME/lib/ibmrs.lib/swift.o +; Logic Modeling's SmartModel SWIFT software (Sun4 Solaris) +; libswift = $LMC_HOME/lib/sun4Solaris.lib/libswift.so +; Logic Modeling's SmartModel SWIFT software (Windows NT) +; libswift = $LMC_HOME/lib/pcnt.lib/libswift.dll +; Logic Modeling's SmartModel SWIFT software (Linux) +; libswift = $LMC_HOME/lib/x86_linux.lib/libswift.so + +; ModelSim's interface to Logic Modeling's hardware modeler SFI software +libhm = $MODEL_TECH/libhm.sl +; ModelSim's interface to Logic Modeling's hardware modeler SFI software (Windows NT) +; libhm = $MODEL_TECH/libhm.dll +; Logic Modeling's hardware modeler SFI software (HP 9000 Series 700) +; libsfi = /lib/hp700/libsfi.sl +; Logic Modeling's hardware modeler SFI software (IBM RISC System/6000) +; libsfi = /lib/rs6000/libsfi.a +; Logic Modeling's hardware modeler SFI software (Sun4 Solaris) +; libsfi = /lib/sun4.solaris/libsfi.so +; Logic Modeling's hardware modeler SFI software (Windows NT) +; libsfi = /lib/pcnt/lm_sfi.dll +; Logic Modeling's hardware modeler SFI software (Linux) +; libsfi = /lib/linux/libsfi.so +[Project] +Project_Version = 5 +Project_DefaultLib = work +Project_SortMethod = unused +Project_Files_Count = 7 +Project_File_0 = D:/LWRISC/RTL/test.v +Project_File_P_0 = vlog_protect 0 file_type Verilog group_id 0 vlog_1995compat 0 vlog_nodebug 0 folder {Top Level} last_compile 0 vlog_noload 0 vlog_disableopt 0 vlog_hazard 0 vlog_showsource 0 ood 1 vlog_options {} vlog_upper 0 compile_to work compile_order 6 dont_compile 0 cover_stmt 1 +Project_File_1 = D:/LWRISC/SIM/clairisc_def.h +Project_File_P_1 = compile_order 2 last_compile 0 folder {Top Level} dont_compile 0 group_id 0 file_type SystemC ood 1 compile_to work +Project_File_2 = D:/LWRISC/RTL/risc_core.v +Project_File_P_2 = vlog_protect 0 file_type Verilog group_id 0 vlog_1995compat 0 vlog_nodebug 0 folder {Top Level} last_compile 0 vlog_noload 0 vlog_disableopt 0 vlog_hazard 0 vlog_showsource 0 ood 1 vlog_options {} vlog_upper 0 compile_to work compile_order 4 dont_compile 0 cover_stmt 1 +Project_File_3 = D:/LWRISC/RTL/memory.v +Project_File_P_3 = vlog_protect 0 file_type Verilog group_id 0 vlog_1995compat 0 vlog_nodebug 0 folder {Top Level} last_compile 0 vlog_noload 0 vlog_disableopt 0 vlog_hazard 0 vlog_showsource 0 ood 1 vlog_options {} vlog_upper 0 compile_to work compile_order 3 dont_compile 0 cover_stmt 1 +Project_File_4 = D:/LWRISC/SIM/rom_set.h +Project_File_P_4 = compile_order 1 last_compile 0 folder {Top Level} dont_compile 0 group_id 0 file_type SystemC ood 1 compile_to work +Project_File_5 = D:/LWRISC/RTL/sim_rom.v +Project_File_P_5 = vlog_protect 0 file_type Verilog group_id 0 vlog_1995compat 0 vlog_nodebug 0 folder {Top Level} last_compile 0 vlog_noload 0 vlog_disableopt 0 vlog_hazard 0 vlog_showsource 0 ood 1 vlog_options {} vlog_upper 0 compile_to work compile_order 5 dont_compile 0 cover_stmt 1 +Project_File_6 = D:/LWRISC/RTL/mem_man.v +Project_File_P_6 = vlog_protect 0 file_type Verilog group_id 0 vlog_1995compat 0 vlog_nodebug 0 folder {Top Level} last_compile 0 vlog_noload 0 vlog_disableopt 0 vlog_hazard 0 vlog_showsource 0 ood 1 vlog_options {} vlog_upper 0 compile_to work compile_order 0 dont_compile 0 cover_stmt 1 +Project_Sim_Count = 0 +Project_Folder_Count = 0 +Echo_Compile_Output = 0 +Save_Compile_Report = 1 +VHDL_DoubleClick = Edit +VERILOG_DoubleClick = Edit +SYSTEMC_DoubleClick = Edit +TCL_DoubleClick = Edit +TEXT_DoubleClick = Edit +VHDL_CustomDoubleClick = +VERILOG_CustomDoubleClick = +SYSTEMC_CustomDoubleClick = +TCL_CustomDoubleClick = +TEXT_CustomDoubleClick = +ForceSoftPaths = 0 Index: trunk/SIM/transcript =================================================================== --- trunk/SIM/transcript (nonexistent) +++ trunk/SIM/transcript (revision 7) @@ -0,0 +1,11 @@ +# Reading C:/Modeltech_5.8e/tcl/vsim/pref.tcl +# // ModelSim SE 5.8e Aug 28 2004 +# // +# // Copyright Model Technology, a Mentor Graphics Corporation company, 2004 +# // All Rights Reserved. +# // UNPUBLISHED, LICENSED SOFTWARE. +# // CONFIDENTIAL AND PROPRIETARY INFORMATION WHICH IS THE +# // PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS. +# // +# OpenFile "D:/LWRISC/SIM/SIM_ClaiRISC.mpf" +# Loading project SIM_ClaiRISC Index: trunk/SIM/SIM_ClaiRISC.cr.mti =================================================================== --- trunk/SIM/SIM_ClaiRISC.cr.mti (nonexistent) +++ trunk/SIM/SIM_ClaiRISC.cr.mti (revision 7) @@ -0,0 +1 @@ + Index: trunk/SIM/clairisc_def.h =================================================================== --- trunk/SIM/clairisc_def.h (nonexistent) +++ trunk/SIM/clairisc_def.h (revision 7) @@ -0,0 +1,69 @@ +`define SIM + + + + +`define MUXA_W 0 +`define MUXA_BD 1 + +`define MUXB_EK 0 +`define MUXB_REG 1 + +`define BRC_NOP 0 +`define BRC_ZERO 1 +`define BRC_NZERO 2 + +`define BG_ZERO 1 +`define BG_NZERO 2 +`define BG_IGN 0 +`define BG_NOP 0 + +`define PC_NOP 0 +`define PC_BRC 1 +`define PC_GOTO 2 +`define PC_CALL 2 +`define PC_INS 2 +`define PC_RET 3 +`define PC_NEXT 4 + +`define MUXB_IGN 1'BX +`define MUXA_IGN 1'BX + +`define R1_LEN 1 +`define R2_LEN 2 +`define R3_LEN 3 +`define R4_LEN 4 +`define R5_LEN 5 +`define R8_LEN 8 +`define R9_LEN 9 +`define R11_LEN 11 +`define R12_LEN 12 + +`define ALU_NOP 0 +`define ALU_ADD 1 +`define ALU_SUB 2 +`define ALU_AND 3 +`define ALU_OR 4 +`define ALU_XOR 5 +`define ALU_COM 6 +`define ALU_ROR 7 +`define ALU_ROL 8 +`define ALU_SWAP 9 +`define ALU_BSF 10 +`define ALU_BCF 11 +`define ALU_ZERO 12 +`define ALU_DEC 13 +`define ALU_INC 14 +`define ALU_PB 15 +`define ALU_PA 16 +`define ALU_BTFSC 17 +`define ALU_BTFSS 18 + +`define STK_PSH 1 +`define STK_POP 2 +`define STK_NOP 0 + +`define EN 1 +`define DIS 0 + +//`define TTE_MTHD1 Index: trunk/SIM/rom_set.h =================================================================== --- trunk/SIM/rom_set.h (nonexistent) +++ trunk/SIM/rom_set.h (revision 7) @@ -0,0 +1 @@ +`define ROM_TYPE rom128x12 Index: trunk/SYN/syntmp.msg =================================================================== Index: trunk/SYN/ClaiRISC_core.prd =================================================================== --- trunk/SYN/ClaiRISC_core.prd (nonexistent) +++ trunk/SYN/ClaiRISC_core.prd (revision 7) @@ -0,0 +1,13 @@ +#-- Synplicity, Inc. +#-- Version Synplify Pro 8.1 +#-- Project file D:\LWRISC\SYN\ClaiRISC_core.prd +#-- Written on Mon Mar 10 17:43:02 2008 + +# +### Watch Implementation type ### +# +watch_impl -all +# +### Watch Implementation properties ### +# +watch_prop -clear Index: trunk/SYN/ClaiRISC_core.prj =================================================================== --- trunk/SYN/ClaiRISC_core.prj (nonexistent) +++ trunk/SYN/ClaiRISC_core.prj (revision 7) @@ -0,0 +1,76 @@ +#-- Synplicity, Inc. +#-- Version Synplify Pro 8.1 +#-- Project file D:\LWRISC\SYN\ClaiRISC_core.prj +#-- Written on Mon Mar 10 17:43:02 2008 + + +#add_file options +add_file -verilog "../RTL/sim_rom.v" +add_file -verilog "../RTL/test.v" +add_file -_include "../RTL/clairisc_def.h" +add_file -verilog "../RTL/mem_man.v" +add_file -verilog "../RTL/memory.v" +add_file -verilog "../RTL/risc_core.v" +add_file -_include "../RTL/rom_set.h" +add_file -verilog "../RTL/altera/rom512x12.v" +add_file -verilog "../RTL/altera/rom1024x12.v" +add_file -verilog "../RTL/altera/rom2048x12.v" +add_file -verilog "../RTL/altera/ram128x8.v" +add_file -verilog "../RTL/altera/rom32x12.v" +add_file -verilog "../RTL/altera/rom64x12.v" +add_file -verilog "../RTL/altera/rom128x12.v" +add_file -verilog "../RTL/altera/rom256x12.v" + + +#implementation: "rev_1" +impl -add rev_1 + +#device options +set_option -technology CYCLONE +set_option -part EP1C6 +set_option -package QC240 +set_option -speed_grade -6 + +#compilation/mapping options +set_option -default_enum_encoding onehot +set_option -symbolic_fsm_compiler 1 +set_option -resource_sharing 1 +set_option -use_fsm_explorer 0 +set_option -top_module "ClaiRISC_core" + +#map options +set_option -frequency auto +set_option -run_prop_extract 0 +set_option -fanout_limit 30 +set_option -disable_io_insertion 0 +set_option -verification_mode 0 +set_option -pipe 1 +set_option -update_models_cp 0 +set_option -retiming 1 +set_option -fixgatedclocks 0 +set_option -no_sequential_opt 0 + +#simulation options +set_option -write_verilog 0 +set_option -write_vhdl 0 + +#VIF options +set_option -write_vif 1 + +#automatic place and route (vendor) options +set_option -write_apr_constraint 1 + +#set result format/file last +project -result_file "rev_1/ClaiRISC_core.vqm" + +# +#implementation attributes + +set_option -vlog_std v2001 +set_option -dup 0 +set_option -project_relative_includes 1 + +#par_1 attributes +set_option -job par_1 -add par +set_option -job par_1 -option run_backannotation 0 +impl -active "rev_1"

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.