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/] [noc_top.sv] - Blame information for rev 48

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

Line No. Rev Author Line
1 48 alirezamon
// synthesis translate_off
2
`timescale 1ns / 1ps
3
// synthesis translate_on
4
 
5
 
6
/**********************************************************************
7
**    File:  noc_top.sv
8
**
9
**    Copyright (C) 2014-2017  Alireza Monemi
10
**
11
**    This file is part of ProNoC
12
**
13
**    ProNoC ( stands for Prototype Network-on-chip)  is free software:
14
**    you can redistribute it and/or modify it under the terms of the GNU
15
**    Lesser General Public License as published by the Free Software Foundation,
16
**    either version 2 of the License, or (at your option) any later version.
17
**
18
**     ProNoC is distributed in the hope that it will be useful, but WITHOUT
19
**     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20
**     or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
21
**     Public License for more details.
22
**
23
**     You should have received a copy of the GNU Lesser General Public
24
**     License along with ProNoC. If not, see .
25
**
26
**
27
**    Description:
28
**    the NoC top module.
29
**
30
**************************************************************/
31
 
32
 
33
 
34
module  noc_top
35
        import pronoc_pkg::*;
36
(
37
        reset,
38
        clk,
39
        chan_in_all,
40
        chan_out_all
41
);
42
 
43
 
44
        input   clk,reset;
45
        //local ports
46
        input   smartflit_chanel_t chan_in_all  [NE-1 : 0];
47
        output  smartflit_chanel_t chan_out_all [NE-1 : 0];
48
 
49
 
50
 
51
 
52
 
53
        generate
54
        /* verilator lint_off WIDTH */
55
        if (TOPOLOGY ==    "MESH" || TOPOLOGY ==    "FMESH" || TOPOLOGY ==  "TORUS" || TOPOLOGY == "RING" || TOPOLOGY == "LINE") begin : tori_noc
56
        /* verilator lint_on WIDTH */
57
                mesh_torus_noc_top noc_top (
58
                        .reset         (reset        ),
59
                        .clk           (clk          ),
60
                        .chan_in_all   (chan_in_all  ),
61
                        .chan_out_all  (chan_out_all )
62
                );
63
 
64
 
65
    end else if (TOPOLOGY == "FATTREE") begin : fat_
66
 
67
        fattree_noc_top noc_top (
68
                        .reset         (reset        ),
69
                        .clk           (clk          ),
70
                        .chan_in_all   (chan_in_all  ),
71
                        .chan_out_all  (chan_out_all )
72
        );
73
 
74
 
75
    end else if (TOPOLOGY == "TREE") begin : tree_
76
        tree_noc_top  noc_top (
77
                .reset         (reset        ),
78
                .clk           (clk          ),
79
                .chan_in_all   (chan_in_all  ),
80
                .chan_out_all  (chan_out_all )
81
        );
82
    end else if (TOPOLOGY == "STAR") begin : star_
83
        star_noc_top  noc_top (
84
                        .reset         (reset        ),
85
                        .clk           (clk          ),
86
                        .chan_in_all   (chan_in_all  ),
87
                        .chan_out_all  (chan_out_all )
88
                );
89
 
90
    end else begin :custom_
91
 
92
        custom_noc_top noc_top (
93
                        .reset         (reset        ),
94
                        .clk           (clk          ),
95
                        .chan_in_all   (chan_in_all  ),
96
                        .chan_out_all  (chan_out_all )
97
                );
98
 
99
    end
100
    endgenerate
101
endmodule
102
 
103
 
104
 
105
 
106
 
107
 
108
/**********************************
109
The noc top module that can be caled in Verilog module.
110
 
111
***********************************/
112
 
113
module  noc_top_v
114
   import pronoc_pkg::*;
115
   (
116
    flit_out_all,
117
    flit_out_wr_all,
118
    credit_in_all,
119
    flit_in_all,
120
    flit_in_wr_all,
121
    credit_out_all,
122
    reset,
123
    clk
124
 );
125
 
126
 
127
        input   clk,reset;
128
        output [NEFw-1 : 0] flit_out_all;
129
    output [NE-1 : 0] flit_out_wr_all;
130
    input  [NEV-1 : 0] credit_in_all;
131
    input  [NEFw-1 : 0] flit_in_all;
132
    input  [NE-1 : 0] flit_in_wr_all;
133
    output [NEV-1 : 0] credit_out_all;
134
 
135
 
136
        //struct typed array ports which cannot be caled in verilog
137
        smartflit_chanel_t chan_in_all  [NE-1 : 0];
138
        smartflit_chanel_t chan_out_all [NE-1 : 0];
139
 
140
        noc_top the_top(
141
                .reset(reset),
142
                .clk(clk),
143
                .chan_in_all(chan_in_all),
144
                .chan_out_all(chan_out_all)
145
        );
146
 
147
 
148
 
149
 
150
        genvar i;
151
        generate
152
        for (i=0; i
153
                assign chan_in_all[i].flit_chanel.flit    = flit_in_all [Fw*(i+1)-1 : Fw*i];
154
                assign chan_in_all[i].flit_chanel.credit  = credit_in_all [V*(i+1)-1 : V*i];
155
                assign chan_in_all[i].flit_chanel.flit_wr  = flit_in_wr_all[i];
156
 
157
                assign flit_out_all [Fw*(i+1)-1 : Fw*i] = chan_out_all[i].flit_chanel.flit;
158
                assign credit_out_all [V*(i+1)-1 : V*i] = chan_out_all[i].flit_chanel.credit;
159
                assign flit_out_wr_all[i] = chan_out_all[i].flit_chanel.flit_wr;
160
 
161
        end
162
        endgenerate
163
 
164
endmodule
165
 

powered by: WebSVN 2.1.0

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