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

Subversion Repositories noc

[/] [noc/] [src/] [photonic_sw.cc] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 imori
/*
2
 * =====================================================================================
3
 *
4
 *       Filename:  photonic_sw.cc
5
 *
6
 *    Description:
7
 *
8
 *        Version:  1.0
9
 *        Created:  04/14/2009 02:20:24 PM
10
 *       Revision:  none
11
 *       Compiler:  gcc
12
 *
13
 *         Author:  Soontea Kwon (), Kwonst@skku.edu
14
 *        Company:  Mobile Electronics Lab
15
 *
16
 * =====================================================================================
17
 */
18
 
19
#include "photonic_sw.h"
20
 
21
void photonic_sw :: sw_control()
22
{
23
        sc_uint<16> contr_temp = 0;
24
        unsigned short temp = 0;
25
 
26
        while(true){
27
                if(!reset_n.read()){
28
 
29
                }
30
                else{
31
                        contr_temp = oi_control.read();
32
                        temp = contr_temp;
33
                        if(contr_temp & EAST_TO_CORE){
34
                                c_oi_out.write(e_oi_in.read());
35
                        }
36
                        else if(contr_temp & EAST_TO_SOUTH){
37
                                s_oi_out.write(e_oi_in.read());
38
                        }
39
                        else if(contr_temp & EAST_TO_NORTH){
40
                                n_oi_out.write(e_oi_in.read());
41
                        }
42
                        else if(!(contr_temp & (SOUTH_TO_WEST|NORTH_TO_WEST|CORE_TO_WEST))){
43
                                w_oi_out.write(e_oi_in.read());
44
                        }
45
 
46
                        if(contr_temp & WEST_TO_CORE){
47
                                c_oi_out.write(w_oi_in.read());
48
                        }
49
                        else if(contr_temp & WEST_TO_SOUTH){
50
                                s_oi_out.write(w_oi_in.read());
51
                        }
52
                        else if(contr_temp & WEST_TO_NORTH){
53
                                n_oi_out.write(w_oi_in.read());
54
                        }
55
                        else if(!(contr_temp &(SOUTH_TO_EAST|NORTH_TO_EAST|CORE_TO_EAST))){
56
                                e_oi_out.write(w_oi_in.read());
57
                        }
58
 
59
                        if(contr_temp & SOUTH_TO_CORE){
60
                                c_oi_out.write(s_oi_in.read());
61
                        }
62
                        else if(contr_temp & SOUTH_TO_EAST){
63
                                e_oi_out.write(s_oi_in.read());
64
                        }
65
                        else if(contr_temp & SOUTH_TO_WEST){
66
                                w_oi_out.write(s_oi_in.read());
67
                        }
68
                        else if(!(contr_temp & (EAST_TO_NORTH|WEST_TO_NORTH|CORE_TO_NORTH))){
69
                                n_oi_out.write(s_oi_in.read());
70
                        }
71
 
72
                        if(contr_temp & NORTH_TO_CORE){
73
                                c_oi_out.write(n_oi_in.read());
74
                        }
75
                        else if(contr_temp & NORTH_TO_EAST){
76
                                e_oi_out.write(n_oi_in.read());
77
                        }
78
                        else if(contr_temp & NORTH_TO_WEST){
79
                                w_oi_out.write(n_oi_in.read());
80
                        }
81
                        else if(!(contr_temp & (EAST_TO_SOUTH|WEST_TO_SOUTH|CORE_TO_SOUTH))){
82
                                s_oi_out.write(n_oi_in.read());
83
                        }
84
 
85
                        if(contr_temp & CORE_TO_EAST){
86
                                e_oi_out.write(c_oi_in.read());
87
                        }
88
                        else if(contr_temp & CORE_TO_WEST){
89
                                w_oi_out.write(c_oi_in.read());
90
                        }
91
                        else if(contr_temp & CORE_TO_SOUTH){
92
                                s_oi_out.write(c_oi_in.read());
93
                        }
94
                        else if(contr_temp & CORE_TO_NORTH){
95
                                n_oi_out.write(c_oi_in.read());
96
                        }
97
                }
98
                wait();
99
        }
100
}

powered by: WebSVN 2.1.0

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