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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [systemC/] [top_spw.h] - Blame information for rev 40

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 29 redbear
#ifndef TX_RX_SC_TOP_H
2
#define TX_RX_SC_TOP_H
3
 
4
#include "spw_fsm.h"
5
 
6
#include "tx_spw.h"
7
#include "tx_clock.h"
8
#include "link_sc.h"
9
 
10
#include "rx_spw.h"
11
#include "rx_spw_clock_recovery.h"
12
 
13
#include "send_module_sc.h"
14
 
15
class sc_TOP;
16
 
17
SC_MODULE(sc_TOP)
18
{
19
 
20
        /*FSM signal*/
21
        sc_in<bool> CLOCK;
22
        sc_in<bool> RESET;
23
        sc_in<bool> LINK_START;
24
        sc_in<bool> LINK_DISABLE;
25
        sc_in<bool> AUTO_START;
26
        sc_out<sc_uint<4> > FSM_SPW_OUT;
27
 
28
        /*Signal come from RX Receiver*/
29
        sc_signal<bool> GOT_FCT_RX;
30
        sc_signal<bool> GOT_TIMECODE_RX;
31
        sc_signal<bool> GOTNCHAR_RX;
32
        sc_signal<bool> GOTNULL_RX;
33
        sc_signal<bool> GOTBIT_RX;
34
        sc_signal<bool> CREDITERROR_RX;
35
        sc_signal<bool> RXERROR;
36
 
37
        /*Signal come from TX Transmit*/
38
        sc_signal<bool> ENABLE_TX;
39
        sc_signal<bool> SEND_NULL_TX;
40
        sc_signal<bool> SEND_FCT_TX;
41
        sc_signal<bool> SEND_NCHAR_TX;
42
        sc_signal<bool> SEND_TIME_CODE_TX;
43
 
44
        /*RESET TX / RX*/
45
        sc_signal<bool> RESET_TX;
46
 
47
        //sc_signal<bool> GOT_FCT_TX;
48
        //TX ONLY
49
        sc_signal<bool> TICKIN_TX;
50
        sc_signal<sc_uint<8> > TIMEIN_CONTROL_FLAG_TX;
51
 
52
        sc_signal<bool> SEND_FCT_NOW_TOP;
53
        sc_signal<bool> TXWRITE_TX_S;
54
        sc_signal<sc_uint<9> > TXDATA_FLAGCTRL_TX;
55
 
56
        sc_signal<bool> READY_TX;
57
        sc_signal<bool> READY_TICK;
58
 
59
        sc_signal<bool> CLOCK_TX_OUT;
60
 
61
        sc_out<uint> DOUT; //TROCAR PARA UINT QUANDO FOR PARA O VPI
62
        sc_out<uint> SOUT; //TROCAR PARA UINT QUANDO FOR PARA O VPI
63
 
64
        sc_out<sc_uint<4> > FSM_TX;
65
 
66
        //MODULE RX
67
        sc_in<uint>  DIN;
68
        sc_in<uint>  SIN;
69
 
70
        sc_signal<bool> ENABLE_RX;
71
        sc_signal<bool> RESET_RX;
72
 
73
        sc_signal<bool> RX_CLOCK_IN;
74
        sc_in<bool> BUFFER_READY;
75
        sc_out<sc_uint<9> > DATARX_FLAG;
76
        sc_out<bool> BUFFER_WRITE;
77
 
78
        sc_out<sc_uint<8> > TIME_OUT;
79
        sc_out<bool>    TICK_OUT;
80
        sc_out<bool>    CONTROL_FLAG_OUT;
81
 
82
        sc_in<sc_uint<10> > CLOCK_GEN;
83
        sc_in<bool> E_SEND_DATA;
84
 
85
        SPW_TX_SC DUT;
86
        SPW_TX_CLOCK_SC DUT1;
87
 
88
        SPW_RX_SC DUT2;
89
        SPW_RX_CLOCK_RECOVERY_SC DUT3;
90
 
91
        SPW_FSM_SC DUT4;
92
 
93
        SPW_TX_SEND_DATA DUT5;
94
 
95
        SC_CTOR(sc_TOP) : DUT("DUT"),DUT1("DUT1"),DUT2("DUT2"),DUT3("DUT3"),DUT4("DUT4"),DUT5("DUT5")
96
        {
97
                DUT1.CLOCK_GEN(CLOCK_GEN);
98
                DUT1.RESET(RESET);
99
                DUT1.CLOCK_TX_OUT(CLOCK_TX_OUT);
100
 
101
                DUT.CLOCK_TX(CLOCK_TX_OUT);
102
                DUT.CLOCK_SYS(CLOCK);
103
                DUT.RESET_TX(RESET_TX);
104
                DUT.TICKIN_TX(TICKIN_TX);
105
                DUT.TIMEIN_CONTROL_FLAG_TX(TIMEIN_CONTROL_FLAG_TX);
106
                DUT.TXWRITE_TX(TXWRITE_TX_S);
107
                DUT.TXDATA_FLAGCTRL_TX(TXDATA_FLAGCTRL_TX);
108
 
109
                DUT.SEND_FCT_NOW(SEND_FCT_NOW_TOP);
110
                DUT.ENABLE_TX(ENABLE_TX);
111
                DUT.SEND_NULL_TX(SEND_NULL_TX);
112
                DUT.SEND_FCT_TX(SEND_FCT_TX);
113
                DUT.SEND_NCHAR_TX(SEND_NCHAR_TX);
114
                DUT.SEND_TIME_CODE_TX(SEND_TIME_CODE_TX);
115
                DUT.GOTFCT_TX(GOT_FCT_RX);
116
                DUT.READY_TX(READY_TX);
117
 
118
                DUT.READY_TICK(READY_TICK);
119
                DUT.DOUT(DOUT);
120
                DUT.SOUT(SOUT);
121
                DUT.FSM_TX(FSM_TX);
122
 
123
                DUT3.DIN_REC(DIN);
124
                DUT3.SIN_REC(SIN);
125
                DUT3.RX_CLOCK_OUT(RX_CLOCK_IN);
126
 
127
                DUT2.RX_CLOCK(RX_CLOCK_IN);
128
                DUT2.DIN(DIN);
129
                DUT2.SIN(SIN);
130
                DUT2.CLOCK_SYS(CLOCK);
131
                DUT2.ENABLE_RX(ENABLE_RX);
132
                DUT2.RESET_RX(RESET_RX);
133
                DUT2.RX_ERROR(RXERROR);
134
                DUT2.RX_CREDIT_ERROR(CREDITERROR_RX);
135
                DUT2.GOT_BIT(GOTBIT_RX);
136
                DUT2.GOT_NULL(GOTNULL_RX);
137
                DUT2.GOT_NCHAR(GOTNCHAR_RX);
138
                DUT2.GOT_TIME_CODE(GOT_TIMECODE_RX);
139
                DUT2.GOT_FCT(GOT_FCT_RX);
140
                DUT2.SEND_FCT_NOW_RX(SEND_FCT_NOW_TOP);
141
 
142
                DUT2.BUFFER_READY(BUFFER_READY);
143
                DUT2.DATARX_FLAG(DATARX_FLAG);
144
                DUT2.BUFFER_WRITE(BUFFER_WRITE);
145
                DUT2.TIME_OUT(TIME_OUT);
146
                DUT2.TICK_OUT(TICK_OUT);
147
                DUT2.CONTROL_FLAG_OUT(CONTROL_FLAG_OUT);
148
 
149
                DUT4.CLOCK(CLOCK);
150
                DUT4.RESET(RESET);
151
                DUT4.LINK_START(LINK_START);
152
                DUT4.LINK_DISABLE(LINK_DISABLE);
153
                DUT4.AUTO_START(AUTO_START);
154
                DUT4.FSM_SPW_OUT(FSM_SPW_OUT);
155
 
156
                DUT4.GOT_FCT_RX(GOT_FCT_RX);
157
                DUT4.GOT_TIMECODE_RX(GOT_TIMECODE_RX);
158
                DUT4.GOTNCHAR_RX(GOTNCHAR_RX);
159
                DUT4.GOTNULL_RX(GOTNULL_RX);
160
                DUT4.GOTBIT_RX(GOTBIT_RX);
161
                DUT4.CREDITERROR_RX(CREDITERROR_RX);
162
                DUT4.RXERROR_RX(RXERROR);
163
                DUT4.ENABLE_RX(ENABLE_RX);
164
 
165
                DUT4.ENABLE_TX(ENABLE_TX);
166
                DUT4.SEND_NULL_TX(SEND_NULL_TX);
167
                DUT4.SEND_FCT_TX(SEND_FCT_TX);
168
                DUT4.SEND_NCHAR_TX(SEND_NCHAR_TX);
169
                DUT4.SEND_TIMECODE_TX(SEND_TIME_CODE_TX);
170
                DUT4.RESET_TX(RESET_TX);
171
                DUT4.RESET_RX(RESET_RX);
172
 
173
                DUT5.CLOCK_SEND_DATA(CLOCK);
174
                DUT5.RESET_SEND_DATA(RESET);
175
                DUT5.E_SEND_DATA(E_SEND_DATA);
176
                DUT5.TICKIN_TX_SEND_DATA(TICKIN_TX);
177
                DUT5.TIMEIN_CONTROL_FLAG_TX_SEND_DATA(TIMEIN_CONTROL_FLAG_TX);
178
                DUT5.TXWRITE_TX_SEND_DATA(TXWRITE_TX_S);
179
                DUT5.TXDATA_FLAGCTRL_TX_SEND_DATA(TXDATA_FLAGCTRL_TX);
180
                DUT5.READY_TX_SEND_DATA(READY_TX);
181
                DUT5.READY_TICK_DATA(READY_TICK);
182
 
183
                cout << "SC_CTOR(sc_TOP)" << endl;
184
        }
185
 
186
 
187
 
188
};
189
 
190
#endif

powered by: WebSVN 2.1.0

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