OpenCores
URL https://opencores.org/ocsvn/an-fpga-implementation-of-low-latency-noc-based-mpsoc/an-fpga-implementation-of-low-latency-noc-based-mpsoc/trunk

Subversion Repositories an-fpga-implementation-of-low-latency-noc-based-mpsoc

[/] [an-fpga-implementation-of-low-latency-noc-based-mpsoc/] [trunk/] [mpsoc/] [src_processor/] [new_lm32/] [rtl/] [lm32.v] - Blame information for rev 48

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 48 alirezamon
 
2
`include "lm32_config.v"
3
`include "lm32_include.v"
4
 
5
module lm32 #(
6
    parameter INTR_NUM=32,
7
    parameter CFG_PL_MULTIPLY= "ENABLED", //"ENABLED","DISABLED"
8
    parameter CFG_PL_BARREL_SHIFT= "ENABLED",
9
    parameter CFG_SIGN_EXTEND="ENABLED",
10
    parameter CFG_MC_DIVIDE="DISABLED"
11
 
12
)(
13
    // ----- Inputs -------
14
    clk_i,
15
    rst_i,
16
    interrupt,
17
     en_i,
18
     // Instruction Wishbone master
19
    I_DAT_I,
20
    I_ACK_I,
21
    I_ERR_I,
22
    I_RTY_I,
23
    I_DAT_O,
24
    I_ADR_O,
25
    I_CYC_O,
26
    I_SEL_O,
27
    I_STB_O,
28
    I_WE_O,
29
    I_CTI_O,
30
    //I_LOCK_O,
31
    I_BTE_O,
32
 
33
    // Data Wishbone master
34
    D_DAT_I,
35
    D_ACK_I,
36
    D_ERR_I,
37
    D_RTY_I,
38
    D_DAT_O,
39
    D_ADR_O,
40
    D_CYC_O,
41
    D_SEL_O,
42
    D_STB_O,
43
    D_WE_O,
44
    D_CTI_O,
45
    //D_LOCK_O,
46
    D_BTE_O
47
 
48
);
49
 
50
 
51
 
52
input clk_i;                                    // Clock
53
input rst_i;                                    // Reset
54
input en_i;
55
 
56
 
57
wire reset;
58
 
59
assign reset = rst_i | ~ en_i;
60
 
61
//`ifdef CFG_INTERRUPTS_ENABLED
62
input [`LM32_INTERRUPT_RNG] interrupt;          // Interrupt pins
63
//`endif
64
 
65
`ifdef CFG_USER_ENABLED
66
input [`LM32_WORD_RNG] user_result;             // User-defined instruction result
67
input user_complete;                            // Indicates the user-defined instruction result is valid
68
`endif
69
 
70
`ifdef CFG_IWB_ENABLED
71
input [`LM32_WORD_RNG] I_DAT_I;                 // Instruction Wishbone interface read data
72
input I_ACK_I;                                  // Instruction Wishbone interface acknowledgement
73
input I_ERR_I;                                  // Instruction Wishbone interface error
74
input I_RTY_I;                                  // Instruction Wishbone interface retry
75
`endif
76
 
77
 
78
 
79
`ifdef CFG_USER_ENABLED
80
output user_valid;                              // Indicates that user_opcode and user_operand_* are valid
81
wire   user_valid;
82
output [`LM32_USER_OPCODE_RNG] user_opcode;     // User-defined instruction opcode
83
reg    [`LM32_USER_OPCODE_RNG] user_opcode;
84
output [`LM32_WORD_RNG] user_operand_0;         // First operand for user-defined instruction
85
wire   [`LM32_WORD_RNG] user_operand_0;
86
output [`LM32_WORD_RNG] user_operand_1;         // Second operand for user-defined instruction
87
wire   [`LM32_WORD_RNG] user_operand_1;
88
`endif
89
 
90
 
91
 
92
 
93
 
94
`ifdef CFG_IWB_ENABLED
95
output [`LM32_WORD_RNG] I_DAT_O;                // Instruction Wishbone interface write data
96
wire   [`LM32_WORD_RNG] I_DAT_O;
97
output [`LM32_WORD_RNG] I_ADR_O;                // Instruction Wishbone interface address
98
wire   [`LM32_WORD_RNG] I_ADR_O;
99
output I_CYC_O;                                 // Instruction Wishbone interface cycle
100
wire   I_CYC_O;
101
output [`LM32_BYTE_SELECT_RNG] I_SEL_O;         // Instruction Wishbone interface byte select
102
wire   [`LM32_BYTE_SELECT_RNG] I_SEL_O;
103
output I_STB_O;                                 // Instruction Wishbone interface strobe
104
wire   I_STB_O;
105
output I_WE_O;                                  // Instruction Wishbone interface write enable
106
wire   I_WE_O;
107
output [`LM32_CTYPE_RNG] I_CTI_O;               // Instruction Wishbone interface cycle type 
108
wire   [`LM32_CTYPE_RNG] I_CTI_O;
109
//output I_LOCK_O;                                // Instruction Wishbone interface lock bus
110
//wire   I_LOCK_O;
111
output [`LM32_BTYPE_RNG] I_BTE_O;               // Instruction Wishbone interface burst type 
112
wire   [`LM32_BTYPE_RNG] I_BTE_O;
113
`endif
114
 
115
 
116
input [`LM32_WORD_RNG] D_DAT_I;                 // Data Wishbone interface read data
117
input D_ACK_I;                                  // Data Wishbone interface acknowledgement
118
input D_ERR_I;                                  // Data Wishbone interface error
119
input D_RTY_I;                                  // Data Wishbone interface retry
120
 
121
 
122
output [`LM32_WORD_RNG] D_DAT_O;                // Data Wishbone interface write data
123
wire   [`LM32_WORD_RNG] D_DAT_O;
124
output [`LM32_WORD_RNG] D_ADR_O;                // Data Wishbone interface address
125
wire   [`LM32_WORD_RNG] D_ADR_O;
126
output D_CYC_O;                                 // Data Wishbone interface cycle
127
wire   D_CYC_O;
128
output [`LM32_BYTE_SELECT_RNG] D_SEL_O;         // Data Wishbone interface byte select
129
wire   [`LM32_BYTE_SELECT_RNG] D_SEL_O;
130
output D_STB_O;                                 // Data Wishbone interface strobe
131
wire   D_STB_O;
132
output D_WE_O;                                  // Data Wishbone interface write enable
133
wire   D_WE_O;
134
output [`LM32_CTYPE_RNG] D_CTI_O;               // Data Wishbone interface cycle type 
135
wire   [`LM32_CTYPE_RNG] D_CTI_O;
136
//output D_LOCK_O;                                // Date Wishbone interface lock bus
137
//wire   D_LOCK_O;
138
output [`LM32_BTYPE_RNG] D_BTE_O;               // Data Wishbone interface burst type 
139
wire   [`LM32_BTYPE_RNG] D_BTE_O;
140
 
141
 
142
wire [31:0] iadr_o,dadr_o;
143
 
144
lm32_top  the_lm32_top(
145
        .clk_i(clk_i),
146
        .rst_i(reset ),
147
        .interrupt(interrupt),
148
        .I_DAT_I(I_DAT_I),
149
        .I_ACK_I(I_ACK_I),
150
        .I_ERR_I(I_ERR_I),
151
        .I_RTY_I(I_RTY_I),
152
        .D_DAT_I(D_DAT_I),
153
        .D_ACK_I(D_ACK_I),
154
        .D_ERR_I(D_ERR_I),
155
        .D_RTY_I(D_RTY_I),
156
        .I_DAT_O(I_DAT_O),
157
        .I_ADR_O(iadr_o),
158
        .I_CYC_O(I_CYC_O),
159
        .I_SEL_O(I_SEL_O),
160
        .I_STB_O(I_STB_O),
161
        .I_WE_O(I_WE_O),
162
        .I_CTI_O(I_CTI_O),
163
        .I_LOCK_O(),
164
        .I_BTE_O(I_BTE_O),
165
        .D_DAT_O(D_DAT_O),
166
        .D_ADR_O(dadr_o),
167
        .D_CYC_O(D_CYC_O),
168
        .D_SEL_O(D_SEL_O),
169
        .D_STB_O(D_STB_O),
170
        .D_WE_O(D_WE_O),
171
        .D_CTI_O(D_CTI_O),
172
        .D_LOCK_O(),
173
        .D_BTE_O(D_BTE_O)
174
);
175
 
176
        assign D_ADR_O= {2'b00,dadr_o[31:2]};
177
        assign I_ADR_O= {2'b00,iadr_o[31:2]};
178
      //  assign iwb_dat_o = 0;
179
       // assign iwb_tag_o = 3'b000;  // clasic wishbone without  burst 
180
       // assign dwb_tag_o = 3'b000;  // clasic wishbone without  burst 
181
      //  assign iwb_adr_o[31:30]  =   2'b00;
182
       // assign dwb_adr_o[31:30]  =   2'b00;
183
 
184
endmodule
185
 
186
 

powered by: WebSVN 2.1.0

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