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/] [rtl/] [src_noc/] [combined_vc_sw_alloc.sv] - Blame information for rev 54

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

Line No. Rev Author Line
1 54 alirezamon
`include "pronoc_def.v"
2
/**********************************************************************
3
**      File: combined_vc_sw_alloc.v
4
**
5
**      Copyright (C) 2014-2017  Alireza Monemi
6
**
7
**      This file is part of ProNoC
8
**
9
**      ProNoC ( stands for Prototype Network-on-chip)  is free software:
10
**      you can redistribute it and/or modify it under the terms of the GNU
11
**      Lesser General Public License as published by the Free Software Foundation,
12
**      either version 2 of the License, or (at your option) any later version.
13
**
14
**      ProNoC is distributed in the hope that it will be useful, but WITHOUT
15
**      ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16
**      or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
17
**      Public License for more details.
18
**
19
**      You should have received a copy of the GNU Lesser General Public
20
**      License along with ProNoC. If not, see .
21
**
22
**
23
**      Description:
24
**      combined VC/SW allocator. VC allocation is done in parallel with swich allocator
25
**      for header flits which are successfully get sw grant
26
*************************************/
27
 
28
 
29
module combined_vc_sw_alloc
30
        import pronoc_pkg::*;
31
#(
32
    parameter P = 5 //port number
33
)
34
(
35
    ivc_info,
36
    dest_port_all,
37
    masked_ovc_request_all,
38
    ovc_allocated_all,
39
    granted_ovc_num_all,
40
    ivc_num_getting_ovc_grant,
41
    ivc_num_getting_sw_grant,
42
    spec_first_arbiter_granted_ivc_all,
43
    nonspec_first_arbiter_granted_ivc_all,
44
    granted_dest_port_all,
45
    nonspec_granted_dest_port_all,
46
    spec_granted_dest_port_all,
47
    any_ivc_sw_request_granted_all,
48
    any_ovc_granted_in_outport_all,
49
    spec_ovc_num_all,
50
    vc_weight_is_consumed_all,
51
    iport_weight_is_consumed_all,
52
    granted_dst_is_from_a_single_flit_pck,
53
    clk,
54
    reset
55
 
56
);
57
 
58
 
59
    localparam
60
        PV = V * P,
61
        PVV = PV * V,
62
        P_1 = (SELF_LOOP_EN == "NO")? P-1 : P,
63
        PP_1 = P_1 * P,
64
        PVP_1 = PV * P_1;
65
 
66
 
67
    input  ivc_info_t ivc_info [P-1 : 0][V-1 : 0];
68
    input  [PVP_1-1 : 0] dest_port_all;
69
    input  [PVV-1 :  0] masked_ovc_request_all;
70
 
71
 
72
 
73
    output [PV-1 : 0] ovc_allocated_all;
74
    output [PVV-1 : 0] granted_ovc_num_all;
75
    output [PV-1 : 0] ivc_num_getting_ovc_grant;
76
    output [PV-1 : 0] ivc_num_getting_sw_grant;
77
    output [PV-1 : 0] nonspec_first_arbiter_granted_ivc_all;
78
    output [PV-1 : 0] spec_first_arbiter_granted_ivc_all;
79
    output [P-1 : 0] any_ivc_sw_request_granted_all;
80
    output [P-1 :  0] any_ovc_granted_in_outport_all;
81
    output [PP_1-1 : 0] granted_dest_port_all;
82
    output [PP_1-1 : 0] nonspec_granted_dest_port_all;
83
    output [PP_1-1 : 0] spec_granted_dest_port_all;
84
    output [PVV-1 : 0] spec_ovc_num_all;
85
  //  input  [PVP_1-1 :  0] lk_destination_all;
86
    input  [PV-1 :  0] vc_weight_is_consumed_all;
87
    input  [P-1 :  0] iport_weight_is_consumed_all;
88
 
89
    output [P-1 : 0] granted_dst_is_from_a_single_flit_pck;
90
 
91
    input clk,reset;
92
 
93
    wire  [PV-1 : 0] ivc_request_all;
94
    wire  [PV-1 : 0] assigned_ovc_not_full_all;
95
    wire  [PV-1 : 0] ovc_is_assigned_all;
96
    wire  [PV-1 : 0] pck_is_single_flit_all;
97
 
98
    genvar i;
99
    generate
100
        for (i=0; i
101
 
102
                localparam  C_PORT  = i/V;
103
 
104
                assign ivc_request_all[i] = ivc_info[C_PORT][i%V].ivc_req;
105
                assign assigned_ovc_not_full_all[i] = ivc_info[C_PORT][i%V].assigned_ovc_not_full;
106
                assign ovc_is_assigned_all[i] = ivc_info[C_PORT][i%V].ovc_is_assigned;
107
                assign pck_is_single_flit_all[i] =ivc_info[C_PORT][i%V].single_flit_pck;
108
 
109
    end//for
110
 
111
 
112
 
113
    /* verilator lint_off WIDTH */
114
    if(COMBINATION_TYPE    ==    "BASELINE") begin : canonical_comb_gen
115
    /* verilator lint_on WIDTH */
116
        baseline_allocator #(
117
            .V(V),
118
            .P(P),
119
            .TREE_ARBITER_EN(1),
120
            .DEBUG_EN(DEBUG_EN),
121
            .SWA_ARBITER_TYPE (SWA_ARBITER_TYPE),
122
            .SELF_LOOP_EN(SELF_LOOP_EN)
123
        )
124
        the_base_line
125
        (
126
            .dest_port_all(dest_port_all),
127
            .masked_ovc_request_all(masked_ovc_request_all),
128
            .ovc_is_assigned_all(ovc_is_assigned_all),
129
            .ivc_request_all(ivc_request_all),
130
            .assigned_ovc_not_full_all(assigned_ovc_not_full_all),
131
            .ovc_allocated_all(ovc_allocated_all),
132
            .granted_ovc_num_all(granted_ovc_num_all),
133
            .ivc_num_getting_ovc_grant(ivc_num_getting_ovc_grant),
134
            .ivc_num_getting_sw_grant(ivc_num_getting_sw_grant),
135
            .spec_first_arbiter_granted_ivc_all(spec_first_arbiter_granted_ivc_all),
136
            .nonspec_first_arbiter_granted_ivc_all(nonspec_first_arbiter_granted_ivc_all),
137
            .granted_dest_port_all(granted_dest_port_all),
138
            .nonspec_granted_dest_port_all(nonspec_granted_dest_port_all),
139
            .spec_granted_dest_port_all(spec_granted_dest_port_all),
140
            .any_ivc_sw_request_granted_all(any_ivc_sw_request_granted_all),
141
            .spec_ovc_num_all(spec_ovc_num_all),
142
            .vc_weight_is_consumed_all(vc_weight_is_consumed_all),
143
            .iport_weight_is_consumed_all(iport_weight_is_consumed_all),
144
            .clk(clk),
145
            .reset(reset)
146
 
147
        );
148
    /* verilator lint_off WIDTH */
149
    end else if(COMBINATION_TYPE    ==    "COMB_SPEC1") begin : spec1
150
    /* verilator lint_on WIDTH */
151
        comb_spec1_allocator #(
152
            .V(V),
153
            .P(P),
154
            .DEBUG_EN(DEBUG_EN),
155
            .SWA_ARBITER_TYPE (SWA_ARBITER_TYPE),
156
            .MIN_PCK_SIZE(MIN_PCK_SIZE),
157
            .SELF_LOOP_EN(SELF_LOOP_EN)
158
 
159
        )
160
        the_comb_spec1
161
        (
162
            .dest_port_all(dest_port_all),
163
            .masked_ovc_request_all(masked_ovc_request_all),
164
            .ovc_is_assigned_all(ovc_is_assigned_all),
165
            .ivc_request_all(ivc_request_all),
166
            .assigned_ovc_not_full_all(assigned_ovc_not_full_all),
167
            .ovc_allocated_all(ovc_allocated_all),
168
            .granted_ovc_num_all(granted_ovc_num_all),
169
            .ivc_num_getting_ovc_grant(ivc_num_getting_ovc_grant),
170
            .ivc_num_getting_sw_grant(ivc_num_getting_sw_grant),
171
            .spec_first_arbiter_granted_ivc_all(spec_first_arbiter_granted_ivc_all),
172
            .nonspec_first_arbiter_granted_ivc_all(nonspec_first_arbiter_granted_ivc_all),
173
            .granted_dest_port_all(granted_dest_port_all),
174
            .nonspec_granted_dest_port_all(nonspec_granted_dest_port_all),
175
            .any_ivc_sw_request_granted_all(any_ivc_sw_request_granted_all),
176
            .vc_weight_is_consumed_all(vc_weight_is_consumed_all),
177
            .iport_weight_is_consumed_all(iport_weight_is_consumed_all),
178
            .pck_is_single_flit_all(pck_is_single_flit_all),
179
            .granted_dst_is_from_a_single_flit_pck(granted_dst_is_from_a_single_flit_pck),
180
            .clk(clk),
181
            .reset(reset)
182
        );
183
 
184
        assign spec_granted_dest_port_all = {PP_1{1'bx}};
185
        assign spec_ovc_num_all = {PVV{1'bx}};
186
    /* verilator lint_off WIDTH */
187
    end else if (COMBINATION_TYPE    == "COMB_SPEC2") begin :spec2
188
    /* verilator lint_on WIDTH */
189
            comb_spec2_allocator #(
190
                .V(V),
191
                .P(P),
192
                .DEBUG_EN(DEBUG_EN),
193
                .SWA_ARBITER_TYPE (SWA_ARBITER_TYPE),
194
                .MIN_PCK_SIZE(MIN_PCK_SIZE),
195
                .SELF_LOOP_EN(SELF_LOOP_EN)
196
            )
197
            the_comb_spec2
198
            (
199
                .dest_port_all(dest_port_all),
200
                .masked_ovc_request_all(masked_ovc_request_all),
201
                .ovc_is_assigned_all(ovc_is_assigned_all),
202
                .ivc_request_all(ivc_request_all),
203
                .assigned_ovc_not_full_all(assigned_ovc_not_full_all),
204
                .ovc_allocated_all(ovc_allocated_all),
205
                .granted_ovc_num_all(granted_ovc_num_all),
206
                .ivc_num_getting_ovc_grant(ivc_num_getting_ovc_grant),
207
                .ivc_num_getting_sw_grant(ivc_num_getting_sw_grant),
208
                .spec_first_arbiter_granted_ivc_all(spec_first_arbiter_granted_ivc_all),
209
                .nonspec_first_arbiter_granted_ivc_all(nonspec_first_arbiter_granted_ivc_all),
210
                .granted_dest_port_all(granted_dest_port_all),
211
                .nonspec_granted_dest_port_all(nonspec_granted_dest_port_all),
212
                .any_ivc_sw_request_granted_all(any_ivc_sw_request_granted_all),
213
                .vc_weight_is_consumed_all(vc_weight_is_consumed_all),
214
                .iport_weight_is_consumed_all(iport_weight_is_consumed_all),
215
                .pck_is_single_flit_all(pck_is_single_flit_all),
216
                .granted_dst_is_from_a_single_flit_pck(granted_dst_is_from_a_single_flit_pck),
217
                .clk(clk),
218
                .reset(reset)
219
            );
220
 
221
            assign spec_granted_dest_port_all = {PP_1{1'bx}};
222
            assign spec_ovc_num_all = {PVV{1'bx}};
223
 
224
 
225
    end else begin :   nonspec
226
        if(V>7)begin :cmb_v2
227
 
228
             comb_nonspec_v2_allocator #(
229
                .V(V),
230
                .P(P),
231
                .FIRST_ARBITER_EXT_P_EN(FIRST_ARBITER_EXT_P_EN),
232
                .SWA_ARBITER_TYPE (SWA_ARBITER_TYPE),
233
                .MIN_PCK_SIZE(MIN_PCK_SIZE),
234
                .SELF_LOOP_EN(SELF_LOOP_EN)
235
            )
236
            nonspec_comb
237
            (
238
                .dest_port_all(dest_port_all),
239
                .masked_ovc_request_all(masked_ovc_request_all),
240
                .ovc_is_assigned_all(ovc_is_assigned_all),
241
                .ivc_request_all(ivc_request_all),
242
                .assigned_ovc_not_full_all(assigned_ovc_not_full_all),
243
                .ovc_allocated_all(ovc_allocated_all),
244
                .granted_ovc_num_all(granted_ovc_num_all),
245
                .ivc_num_getting_ovc_grant(ivc_num_getting_ovc_grant),
246
                .ivc_num_getting_sw_grant(ivc_num_getting_sw_grant),
247
                .nonspec_first_arbiter_granted_ivc_all(nonspec_first_arbiter_granted_ivc_all),
248
                .granted_dest_port_all(granted_dest_port_all),
249
                .any_ivc_sw_request_granted_all(any_ivc_sw_request_granted_all),
250
                .any_ovc_granted_in_outport_all(any_ovc_granted_in_outport_all),
251
                .vc_weight_is_consumed_all(vc_weight_is_consumed_all),
252
                .iport_weight_is_consumed_all(iport_weight_is_consumed_all),
253
                .pck_is_single_flit_all(pck_is_single_flit_all),
254
                .granted_dst_is_from_a_single_flit_pck(granted_dst_is_from_a_single_flit_pck),
255
                .clk(clk),
256
                .reset(reset)
257
            );
258
 
259
        end else begin :cmb_v1
260
 
261
            comb_nonspec_allocator #(
262
               .P(P)
263
            )
264
            nonspec_comb
265
            (
266
                .ivc_info(ivc_info),
267
                .dest_port_all(dest_port_all),
268
                .masked_ovc_request_all(masked_ovc_request_all),
269
                .ovc_allocated_all(ovc_allocated_all),
270
                .granted_ovc_num_all(granted_ovc_num_all),
271
                .ivc_num_getting_ovc_grant(ivc_num_getting_ovc_grant),
272
                .ivc_num_getting_sw_grant(ivc_num_getting_sw_grant),
273
                .nonspec_first_arbiter_granted_ivc_all(nonspec_first_arbiter_granted_ivc_all),
274
                .granted_dest_port_all(granted_dest_port_all),
275
                .any_ivc_sw_request_granted_all(any_ivc_sw_request_granted_all),
276
                .any_ovc_granted_in_outport_all(any_ovc_granted_in_outport_all),
277
                .vc_weight_is_consumed_all(vc_weight_is_consumed_all),
278
                .iport_weight_is_consumed_all(iport_weight_is_consumed_all),
279
                .pck_is_single_flit_all(pck_is_single_flit_all),
280
                .granted_dst_is_from_a_single_flit_pck(granted_dst_is_from_a_single_flit_pck),
281
                .clk(clk),
282
                .reset(reset)
283
            );
284
        end
285
 
286
        assign nonspec_granted_dest_port_all      = granted_dest_port_all;
287
        assign spec_granted_dest_port_all         = {PP_1{1'bx}};
288
        assign spec_ovc_num_all                      = {PVV{1'bx}};
289
        assign spec_first_arbiter_granted_ivc_all =  nonspec_first_arbiter_granted_ivc_all ;
290
    end
291
endgenerate
292
endmodule

powered by: WebSVN 2.1.0

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