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_modelsim/] [multicast_test.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
// synthesis translate_off
2
`timescale   1ns/1ns
3
 
4
 
5
module multicast_test;
6
 
7
        import pronoc_pkg::*;
8
 
9
        reg     reset ,clk;
10
 
11
        initial begin
12
                clk = 1'b0;
13
                forever clk = #10 ~clk;
14
        end
15
 
16
 
17
        smartflit_chanel_t chan_in_all  [NE-1 : 0];
18
        smartflit_chanel_t chan_out_all [NE-1 : 0];
19
 
20
        pck_injct_t pck_injct_in [NE-1 : 0];
21
        pck_injct_t pck_injct_out[NE-1 : 0];
22
 
23
 
24
        noc_top         the_noc
25
        (
26
                .reset(reset),
27
                .clk(clk),
28
                .chan_in_all(chan_in_all),
29
                .chan_out_all(chan_out_all),
30
                .router_event( )
31
        );
32
 
33
        reg [NEw-1 : 0] dest_id [NE-1 : 0];
34
        wire [NEw-1: 0] current_e_addr [NE-1 : 0];
35
 
36
        genvar i;
37
        generate
38
        for(i=0; i< NE; i=i+1) begin : endpoints
39
 
40
                endp_addr_encoder #( .TOPOLOGY(TOPOLOGY), .T1(T1), .T2(T2), .T3(T3), .EAw(EAw),  .NE(NE)) encode1 ( .id(i[NEw-1 :0]), .code(current_e_addr[i]));
41
 
42
                multicast_injector pck_inj(
43
                        //general
44
                        .current_e_addr(current_e_addr[i]),
45
                        .reset(reset),
46
                        .clk(clk),
47
                        //noc port
48
                        .chan_in(chan_out_all[i]),
49
                        .chan_out(chan_in_all[i]),
50
                        //control interafce
51
                        .pck_injct_in(pck_injct_in[i]),
52
                        .pck_injct_out(pck_injct_out[i])
53
                );
54
 
55
 
56
                endp_addr_encoder #( .TOPOLOGY(TOPOLOGY), .T1(T1), .T2(T2), .T3(T3), .EAw(EAw),  .NE(NE)) encode2 ( .id(dest_id[i]), .code(pck_injct_in[i].endp_addr[EAw-1 : 0]));
57
 
58
 
59
           reg [31:0]k;
60
 
61
                initial begin
62
                        reset = 1'b1;
63
                        k=0;
64
                        pck_injct_in[i].data =0;
65
                        #10
66
                        pck_injct_in[i].class_num=0;
67
                        pck_injct_in[i].init_weight=1;
68
                        pck_injct_in[i].vc=1;
69
                        pck_injct_in[i].pck_wr=1'b0;
70
                        #100
71
                        @(posedge clk) #1;
72
                        reset=1'b0;
73
                        #100
74
                        @(posedge clk) #1;
75
                        //if(i==1) begin
76
                        //      repeat(10) begin
77
                                        while (pck_injct_out[i].ready[0] == 1'b0) @(posedge clk)   #1;
78
 
79
                                        pck_injct_in[i].data='h123456789ABCDEFEDCBA987654321+k;
80
                                        pck_injct_in[i].size=3+(k%18);
81
                                        dest_id[i]=0;
82
                                        pck_injct_in[i].pck_wr=1'b1;
83
                                        @(posedge clk)  #1 k++;
84
                                        pck_injct_in[i].pck_wr=1'b0;
85
                                        @(posedge clk)  #1 k++;
86
 
87
                        //      end
88
 
89
                                #10000
90
                        @(posedge clk) $stop;
91
 
92
                        //end
93
 
94
 
95
 
96
 
97
 
98
 
99
                end
100
 
101
                always @(posedge clk) begin
102
                        if(pck_injct_out[i].pck_wr) begin
103
                                $display ("%t:pck_inj(%d) got a packet: source=%d, size=%d, data=%h",$time,i,
104
                                                pck_injct_out[i].endp_addr,pck_injct_out[i].size,pck_injct_out[i].data);
105
                        end
106
 
107
                end
108
 
109
 
110
 
111
        end//for
112
        endgenerate
113
 
114
 
115
 
116
 
117
 
118
 
119
 
120
 
121
 
122
 
123
 
124
endmodule
125
// synthesis translate_on
126
 

powered by: WebSVN 2.1.0

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