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/] [lm32/] [verilog/] [src/] [lm32.v] - Blame information for rev 17

Go to most recent revision | Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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