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/] [pck_injector_test.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/1ns
3
 
4
 
5
module pck_injector_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
        );
31
 
32
        reg [NEw-1 : 0] dest_id [NE-1 : 0];
33
        wire [NEw-1: 0] current_e_addr [NE-1 : 0];
34
 
35
        genvar i;
36
        generate
37
        for(i=0; i< NE; i=i+1) begin : endpoints
38
 
39
                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]));
40
 
41
                packet_injector pck_inj(
42
                        //general
43
                        .current_e_addr(current_e_addr[i]),
44
                        .reset(reset),
45
                        .clk(clk),
46
                        //noc port
47
                        .chan_in(chan_out_all[i]),
48
                        .chan_out(chan_in_all[i]),
49
                        //control interafce
50
                        .pck_injct_in(pck_injct_in[i]),
51
                        .pck_injct_out(pck_injct_out[i])
52
                );
53
 
54
 
55
                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));
56
 
57
 
58
           reg [31:0]k;
59
 
60
                initial begin
61
                        reset = 1'b1;
62
                        k=0;
63
                        pck_injct_in[i].data =0;
64
                        #10
65
                        pck_injct_in[i].class_num=0;
66
                        pck_injct_in[i].init_weight=1;
67
                        pck_injct_in[i].vc=1;
68
                        pck_injct_in[i].pck_wr=1'b0;
69
                        #100
70
                        @(posedge clk) #1;
71
                        reset=1'b0;
72
                        #100
73
                        @(posedge clk) #1;
74
                        if(i==1) begin
75
                                repeat(10) begin
76
                                        while (pck_injct_out[i].ready[0] == 1'b0) @(posedge clk)   #1;
77
 
78
                                        pck_injct_in[i].data='h123456789ABCDEFEDCBA987654321+k;
79
                                        pck_injct_in[i].size=3+(k%18);
80
                                        dest_id[i]=0;
81
                                        pck_injct_in[i].pck_wr=1'b1;
82
                                        @(posedge clk)  #1 k++;
83
                                        pck_injct_in[i].pck_wr=1'b0;
84
                                        @(posedge clk)  #1 k++;
85
 
86
                                end
87
 
88
                                #8000
89
                        @(posedge clk) $stop;
90
 
91
                        end
92
 
93
 
94
 
95
 
96
 
97
 
98
                end
99
 
100
                always @(posedge clk) begin
101
                        if(pck_injct_out[i].pck_wr) begin
102
                                $display ("%t:pck_inj(%d) got a packet: source=%d, size=%d, data=%h",$time,i,
103
                                                pck_injct_out[i].endp_addr,pck_injct_out[i].size,pck_injct_out[i].data);
104
                        end
105
 
106
                end
107
 
108
 
109
 
110
        end//for
111
        endgenerate
112
 
113
 
114
 
115
 
116
 
117
 
118
 
119
 
120
 
121
 
122
 
123
endmodule
124
// synthesis translate_on
125
 

powered by: WebSVN 2.1.0

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