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

Subversion Repositories async_sdm_noc

[/] [async_sdm_noc/] [trunk/] [sdm/] [tb/] [node_top.v] - Blame information for rev 61

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

Line No. Rev Author Line
1 32 wsong0210
/*
2
 Asynchronous SDM NoC
3
 (C)2011 Wei Song
4
 Advanced Processor Technologies Group
5
 Computer Science, the Univ. of Manchester, UK
6
 
7
 Authors:
8
 Wei Song     wsong83@gmail.com
9
 
10
 License: LGPL 3.0 or later
11
 
12
 A network node including a router, a NI and a processing element.
13
 
14
 History:
15
 03/03/2011  Initial version. <wsong83@gmail.com>
16
 30/05/2011  Clean up for opensource. <wsong83@gmail.com>
17
 
18
*/
19
 
20
// the router structure definitions
21
`include "define.v"
22
 
23
module node_top(/*AUTOARG*/
24
   // Outputs
25
   so0, so1, so2, so3, wo0, wo1, wo2, wo3, no0, no1, no2, no3, eo0,
26
   eo1, eo2, eo3, sia, wia, nia, eia, so4, wo4, no4, eo4,
27
   // Inputs
28
   si0, si1, si2, si3, wi0, wi1, wi2, wi3, ni0, ni1, ni2, ni3, ei0,
29
   ei1, ei2, ei3, si4, wi4, ni4, ei4, soa, woa, noa, eoa, rst_n
30
   );
31
   parameter DW = 32;
32
   parameter VCN = 1;
33
   parameter x = 0;
34
   parameter y = 0;
35
   parameter SCN = DW/2;
36
 
37
   input [VCN*SCN-1:0]   si0, si1, si2, si3;
38
   input [VCN*SCN-1:0]   wi0, wi1, wi2, wi3;
39
   input [VCN*SCN-1:0]   ni0, ni1, ni2, ni3;
40
   input [VCN*SCN-1:0]   ei0, ei1, ei2, ei3;
41
   output [VCN*SCN-1:0]  so0, so1, so2, so3;
42
   output [VCN*SCN-1:0]  wo0, wo1, wo2, wo3;
43
   output [VCN*SCN-1:0]  no0, no1, no2, no3;
44
   output [VCN*SCN-1:0]  eo0, eo1, eo2, eo3;
45
   wire [VCN*SCN-1:0]     li0, li1, li2, li3;
46
   wire [VCN*SCN-1:0]     lo0, lo1, lo2, lo3;
47
`ifdef ENABLE_CHANNEL_SLICING
48
   input [VCN*SCN-1:0]    si4, wi4, ni4, ei4;
49
   output [VCN*SCN-1:0]  sia, wia, nia, eia;
50
   output [VCN*SCN-1:0]  so4, wo4, no4, eo4;
51
   input [VCN*SCN-1:0]    soa, woa, noa, eoa;
52
   wire [VCN*SCN-1:0]     li4, lia, lo4, loa;
53
`else
54
   input [VCN-1:0]        si4, wi4, ni4, ei4;
55
   output [VCN-1:0]       sia, wia, nia, eia;
56
   output [VCN-1:0]       so4, wo4, no4, eo4;
57
   input [VCN-1:0]        soa, woa, noa, eoa;
58
   wire [VCN-1:0]         li4, lia, lo4, loa;
59
`endif // !`ifdef ENABLE_CHANNEL_SLICING
60
 
61
   input                 rst_n;
62
 
63
 
64
   // the network node
65
   NetNode #(.DW(DW), .VCN(VCN), .x(x), .y(y))
66
   Node (
67
         .dia   ( lia   ),
68
         .do4   ( lo4   ),
69
         .doa   ( loa   ),
70
         .di4   ( li4   ),
71
         .do0   ( lo0   ),
72
         .do1   ( lo1   ),
73
         .do2   ( lo2   ),
74
         .do3   ( lo3   ),
75
         .di0   ( li0   ),
76
         .di1   ( li1   ),
77
         .di2   ( li2   ),
78
         .di3   ( li3   ),
79
         .rst_n ( rst_n )
80
         );
81
 
82
 
83
   // router wrapper
84
   router_hdl #(.DW(DW), .VCN(VCN))
85
   RTN (
86
        .so0(so0), .so1(so1), .so2(so2), .so3(so3), .so4(so4), .soa(soa),
87
        .wo0(wo0), .wo1(wo1), .wo2(wo2), .wo3(wo3), .wo4(wo4), .woa(woa),
88
        .no0(no0), .no1(no1), .no2(no2), .no3(no3), .no4(no4), .noa(noa),
89
        .eo0(eo0), .eo1(eo1), .eo2(eo2), .eo3(eo3), .eo4(eo4), .eoa(eoa),
90
        .lo0(lo0), .lo1(lo1), .lo2(lo2), .lo3(lo3), .lo4(lo4), .loa(loa),
91
        .si0(si0), .si1(si1), .si2(si2), .si3(si3), .si4(si4), .sia(sia),
92
        .wi0(wi0), .wi1(wi1), .wi2(wi2), .wi3(wi3), .wi4(wi4), .wia(wia),
93
        .ni0(ni0), .ni1(ni1), .ni2(ni2), .ni3(ni3), .ni4(ni4), .nia(nia),
94
        .ei0(ei0), .ei1(ei1), .ei2(ei2), .ei3(ei3), .ei4(ei4), .eia(eia),
95
        .li0(li0), .li1(li1), .li2(li2), .li3(li3), .li4(li4), .lia(lia),
96
        .addrx (b2chain(x)),
97
        .addry (b2chain(y)),
98
        .rst_n (rst_n)
99
   );
100
 
101
 
102
   // binary to 1-of-4 (Chain) converter
103
   function [7:0] b2chain;
104
      input [3:0]         data;
105
      begin
106
         b2chain[0] = (data[1:0] == 2'b00);
107
         b2chain[1] = (data[1:0] == 2'b01);
108
         b2chain[2] = (data[1:0] == 2'b10);
109
         b2chain[3] = (data[1:0] == 2'b11);
110
         b2chain[4] = (data[3:2] == 2'b00);
111
         b2chain[5] = (data[3:2] == 2'b01);
112
         b2chain[6] = (data[3:2] == 2'b10);
113
         b2chain[7] = (data[3:2] == 2'b11);
114
      end
115
   endfunction
116
 
117
endmodule // node_top

powered by: WebSVN 2.1.0

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