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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [rtl/] [RTL_VB/] [tx_spw.v] - Blame information for rev 37

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

Line No. Rev Author Line
1 5 redbear
//+FHDR------------------------------------------------------------------------
2
//Copyright (c) 2013 Latin Group American Integhrated Circuit, Inc. All rights reserved
3
//GLADIC Open Source RTL
4
//-----------------------------------------------------------------------------
5
//FILE NAME      :
6
//DEPARTMENT     : IC Design / Verification
7
//AUTHOR         : Felipe Fernandes da Costa
8
//AUTHOR’S EMAIL :
9
//-----------------------------------------------------------------------------
10
//RELEASE HISTORY
11
//VERSION DATE AUTHOR DESCRIPTION
12
//1.0 YYYY-MM-DD name
13
//-----------------------------------------------------------------------------
14
//KEYWORDS : General file searching keywords, leave blank if none.
15
//-----------------------------------------------------------------------------
16
//PURPOSE  : ECSS_E_ST_50_12C_31_july_2008
17
//-----------------------------------------------------------------------------
18
//PARAMETERS
19
//PARAM NAME            RANGE   : DESCRIPTION : DEFAULT : UNITS
20
//e.g.DATA_WIDTH        [32,16] : width of the DATA : 32:
21
//-----------------------------------------------------------------------------
22
//REUSE ISSUES
23
//Reset Strategy        :
24
//Clock Domains         :
25
//Critical Timing       :
26
//Test Features         :
27
//Asynchronous I/F      :
28
//Scan Methodology      :
29
//Instantiations        :
30
//Synthesizable (y/n)   :
31
//Other                 :
32
//-FHDR------------------------------------------------------------------------
33
 
34
`timescale 1ns/1ns
35
 
36
module TX_SPW (
37
                input pclk_tx,
38
                //
39
                input [8:0] data_tx_i,
40
                input txwrite_tx,
41
                //
42
                input [7:0] timecode_tx_i,
43
                input tickin_tx,
44
                //
45
                input enable_tx,
46
                input send_null_tx,
47
                input send_fct_tx,
48
 
49
                //
50
                input gotfct_tx,
51
                input send_fct_now,
52
                //
53 33 redbear
                output reg tx_dout_e,
54
                output reg tx_sout_e,
55 5 redbear
                //
56 8 redbear
                output  reg ready_tx_data,
57 13 redbear
                output  reg ready_tx_timecode
58 5 redbear
 
59
                );
60
 
61 37 redbear
localparam [6:0] tx_spw_start              = 7'b0000000,
62
                 tx_spw_null               = 7'b0000001,
63
                 tx_spw_fct                = 7'b0000010,
64
                 tx_spw_null_c             = 7'b0000100,
65
                 tx_spw_fct_c              = 7'b0001000,
66
                 tx_spw_data_c             = 7'b0010000,
67
                 tx_spw_time_code_c        = 7'b0100000;
68 5 redbear
 
69
localparam [5:0] NULL     = 6'b000001,
70
                 FCT      = 6'b000010,
71
                 EOP      = 6'b000100,
72
                 EEP      = 6'b001000,
73
                 DATA     = 6'b010000,
74
                 TIMEC    = 6'b100000;
75
 
76 25 redbear
 
77
localparam [7:0] null_s = 8'b01110100;
78
localparam [2:0] fct_s  = 3'b100;
79
localparam [3:0] eop_s  = 4'b0101;
80
localparam [3:0] eep_s  = 4'b0110;
81
localparam [13:0] timecode_ss    = 14'b01110000000000;
82
 
83
 
84
 
85 37 redbear
        reg [6:0] state_tx;
86
        reg [6:0] next_state_tx;
87 5 redbear
 
88 37 redbear
        reg  [2:0] state_fct_send;
89
        reg  [2:0] next_state_fct_send;
90
 
91
        reg  [2:0] state_fct_receive;
92
        reg  [2:0] next_state_fct_receive;
93
 
94 5 redbear
        reg [13:0] timecode_s;
95
 
96
        reg [5:0]  last_type;
97
        reg [8:0]  txdata_flagctrl_tx_last;
98 36 redbear
        reg [8:0]  tx_data_in;
99
        reg data_rdy_trnsp;
100 5 redbear
        reg [7:0]  last_timein_control_flag_tx;
101 36 redbear
        reg [7:0]  tx_tcode_in;
102
        reg tcode_rdy_trnsp;
103 5 redbear
 
104
        reg [2:0] fct_send;
105
        reg [2:0] fct_flag;
106 6 redbear
 
107
        reg [5:0] fct_counter_receive;
108
 
109 37 redbear
        //reg block_increment;
110
        reg block_decrement;
111
        reg char_sent;
112
 
113
        //reg block_increment_fct_send;
114
        //reg block_decrement_fct_send;
115
        reg fct_sent;
116
 
117 5 redbear
        reg last_tx_dout;
118
        reg last_tx_sout;
119
 
120 33 redbear
        reg tx_dout;
121
        reg tx_sout;
122
 
123
        reg tx_dout_null;
124
        reg tx_dout_fct;
125
        reg tx_dout_timecode;
126
        reg tx_dout_data;
127
 
128 5 redbear
        reg [3:0] global_counter_transfer;
129
 
130
 
131 13 redbear
 
132 5 redbear
always@(*)
133
begin
134 37 redbear
                tx_dout = last_tx_dout;
135 5 redbear
 
136 37 redbear
                case(state_tx)
137
                tx_spw_start:
138
                begin
139
                end
140
                tx_spw_null,tx_spw_null_c:
141
                begin
142
                         if(last_type == NULL  && global_counter_transfer[3:0] == 4'd0)
143
                         begin
144
                                tx_dout = !(null_s[6]^null_s[0]^null_s[1]);
145
                         end
146
                         else if(last_type == FCT  && global_counter_transfer[3:0] == 4'd0)
147
                         begin
148
                                tx_dout = !(null_s[6]^fct_s[0]^fct_s[1]);
149
                         end
150
                         else if(last_type == EOP  && global_counter_transfer[3:0] == 4'd0)
151
                         begin
152
                                tx_dout = !(null_s[6]^eop_s[0]^eop_s[1]);
153
                         end
154
                         else if(last_type == EEP  && global_counter_transfer[3:0] == 4'd0)
155
                         begin
156
                                tx_dout = !(null_s[6]^eep_s[0]^eep_s[1]);
157
                         end
158
                         else if(last_type == DATA  && global_counter_transfer[3:0] == 4'd0)
159
                         begin
160
                                tx_dout =  !(null_s[6]^txdata_flagctrl_tx_last[0]^txdata_flagctrl_tx_last[1]^txdata_flagctrl_tx_last[2]^txdata_flagctrl_tx_last[3]^ txdata_flagctrl_tx_last[4]^txdata_flagctrl_tx_last[5]^txdata_flagctrl_tx_last[6]^txdata_flagctrl_tx_last[7]);
161
                         end
162
                         else if(last_type == TIMEC && global_counter_transfer[3:0] == 4'd0)
163
                         begin
164
                                tx_dout =  !(null_s[6]^last_timein_control_flag_tx[7]^last_timein_control_flag_tx[6]^last_timein_control_flag_tx[5]^last_timein_control_flag_tx[4]^last_timein_control_flag_tx[3]^last_timein_control_flag_tx[2]^last_timein_control_flag_tx[1]^last_timein_control_flag_tx[0]);
165
                         end
166
                         else if(global_counter_transfer[3:0] == 4'd1)
167
                         begin
168
                                tx_dout = null_s[6];
169
                         end
170
                         else if(global_counter_transfer[3:0] == 4'd2)
171
                         begin
172
                                tx_dout = null_s[5];
173
                         end
174
                         else if(global_counter_transfer[3:0] == 4'd3)
175
                         begin
176
                                tx_dout = null_s[4];
177
                         end
178
                         else if(global_counter_transfer[3:0] == 4'd4)
179
                         begin
180
                                tx_dout = null_s[3];
181
                         end
182
                         else if(global_counter_transfer[3:0] == 4'd5)
183
                         begin
184
                                tx_dout = null_s[2];
185
                         end
186
                         else if(global_counter_transfer[3:0] == 4'd6)
187
                         begin
188
                                tx_dout = null_s[1];
189
                         end
190
                         else if(global_counter_transfer[3:0] == 4'd7)
191
                         begin
192
                                tx_dout = null_s[0];
193
                         end
194
                end
195
                tx_spw_fct,tx_spw_fct_c:
196
                begin
197
                         if(last_type == NULL  && global_counter_transfer[3:0] == 4'd0)
198
                         begin
199
                                tx_dout = !(fct_s[2]^null_s[0]^null_s[1]);
200
                         end
201
                         else if(last_type == FCT  && global_counter_transfer[3:0] == 4'd0)
202
                         begin
203
                                tx_dout = !(fct_s[2]^fct_s[0]^fct_s[1]);
204
                         end
205
                         else if(last_type == EOP  && global_counter_transfer[3:0] == 4'd0)
206
                         begin
207
                                tx_dout = !(fct_s[2]^eop_s[0]^eop_s[1]);
208
                         end
209
                         else if(last_type == EEP  && global_counter_transfer[3:0] == 4'd0)
210
                         begin
211
                                tx_dout = !(fct_s[2]^eep_s[0]^eep_s[1]);
212
                         end
213
                         else if (last_type == DATA && global_counter_transfer[3:0] == 4'd0)
214
                         begin
215
                                tx_dout = !(fct_s[2]^txdata_flagctrl_tx_last[0]^txdata_flagctrl_tx_last[1]^txdata_flagctrl_tx_last[2]^txdata_flagctrl_tx_last[3]^ txdata_flagctrl_tx_last[4]^txdata_flagctrl_tx_last[5]^txdata_flagctrl_tx_last[6]^txdata_flagctrl_tx_last[7]);
216
                         end
217
                         else if(last_type == TIMEC && global_counter_transfer[3:0] == 4'd0)
218
                         begin
219
                                tx_dout = !(fct_s[2]^last_timein_control_flag_tx[7]^last_timein_control_flag_tx[6]^last_timein_control_flag_tx[5]^last_timein_control_flag_tx[4]^last_timein_control_flag_tx[3]^last_timein_control_flag_tx[2]^last_timein_control_flag_tx[1]^last_timein_control_flag_tx[0]);
220
                         end
221
                         else if(global_counter_transfer[3:0] == 4'd1)
222
                         begin
223
                                tx_dout = fct_s[2];
224
                         end
225
                         else if(global_counter_transfer[3:0] == 4'd2)
226
                         begin
227
                                tx_dout = fct_s[1];
228
                         end
229
                         else if(global_counter_transfer[3:0] == 4'd3)
230
                         begin
231
                                tx_dout = fct_s[0];
232
                         end
233
                end
234
                tx_spw_data_c:
235
                begin
236
                        if(!tx_data_in[8] && last_type == NULL  && global_counter_transfer[3:0] == 4'd0)
237
                         begin
238
                                tx_dout = !(tx_data_in[8]^null_s[0]^null_s[1]);
239
                         end
240
                         else if(!tx_data_in[8] && last_type == FCT && global_counter_transfer[3:0] == 4'd0)
241
                         begin
242
                                tx_dout = !(tx_data_in[8]^fct_s[0]^fct_s[1]);
243
                         end
244
                         else if(!tx_data_in[8] && last_type == EOP  && global_counter_transfer[3:0] == 4'd0)
245
                         begin
246
                                tx_dout = !(tx_data_in[8]^eop_s[0]^eop_s[1]);
247
                         end
248
                         else if(!tx_data_in[8] && last_type == EEP  && global_counter_transfer[3:0] == 4'd0)
249
                         begin
250
                                tx_dout = !(tx_data_in[8]^eep_s[0]^eep_s[1]);
251
                         end
252
                         else if(!tx_data_in[8] && last_type == DATA  && global_counter_transfer[3:0] == 4'd0)
253
                         begin
254
                                tx_dout = !(tx_data_in[8]^txdata_flagctrl_tx_last[0]^txdata_flagctrl_tx_last[1]^txdata_flagctrl_tx_last[2]^txdata_flagctrl_tx_last[3]^ txdata_flagctrl_tx_last[4]^txdata_flagctrl_tx_last[5]^txdata_flagctrl_tx_last[6]^txdata_flagctrl_tx_last[7]);
255
                         end
256
                         else if(!tx_data_in[8] && last_type == TIMEC && global_counter_transfer[3:0] == 4'd0)
257
                         begin
258
                                tx_dout = !(tx_data_in[8]^last_timein_control_flag_tx[7]^last_timein_control_flag_tx[6]^last_timein_control_flag_tx[5]^last_timein_control_flag_tx[4]^last_timein_control_flag_tx[3]^last_timein_control_flag_tx[2]^last_timein_control_flag_tx[1]^last_timein_control_flag_tx[0]);
259
                         end
260
                         else if(tx_data_in[8]  && tx_data_in[1:0] == 2'b00 && last_type == NULL  && global_counter_transfer[3:0] == 4'd0)
261
                         begin
262
                                tx_dout = !(eop_s[2]^null_s[0]^null_s[1]);
263
                         end
264
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b00 && last_type == FCT   && global_counter_transfer[3:0] == 4'd0)
265
                         begin
266
                                tx_dout = !(eop_s[2]^fct_s[0]^fct_s[1]);
267
                         end
268
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b00 && last_type == EOP  && global_counter_transfer[3:0] == 4'd0)
269
                         begin
270
                                tx_dout = !(eop_s[2]^eop_s[0]^eop_s[1]);
271
                         end
272
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b00 && last_type == EEP  && global_counter_transfer[3:0] == 4'd0)
273
                         begin
274
                                tx_dout = !(eop_s[2]^eep_s[0]^eep_s[1]);
275
                         end
276
                         else if(tx_data_in[8]  && tx_data_in[1:0] == 2'b00 && last_type == DATA  && global_counter_transfer[3:0] == 4'd0)
277
                         begin
278
                                tx_dout = !(eop_s[2]^txdata_flagctrl_tx_last[0]^txdata_flagctrl_tx_last[1]^txdata_flagctrl_tx_last[2]^txdata_flagctrl_tx_last[3]^ txdata_flagctrl_tx_last[4]^txdata_flagctrl_tx_last[5]^txdata_flagctrl_tx_last[6]^txdata_flagctrl_tx_last[7]);
279
                         end
280
                         else if(tx_data_in[8]  && tx_data_in[1:0] == 2'b00 && last_type == TIMEC && global_counter_transfer[3:0] == 4'd0)
281
                         begin
282
                                tx_dout = !(eop_s[2]^last_timein_control_flag_tx[7]^last_timein_control_flag_tx[6]^last_timein_control_flag_tx[5]^last_timein_control_flag_tx[4]^last_timein_control_flag_tx[3]^last_timein_control_flag_tx[2]^last_timein_control_flag_tx[1]^last_timein_control_flag_tx[0]);
283
                         end
284
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b01 && last_type == NULL  && global_counter_transfer[3:0] == 4'd0)
285
                         begin
286
                                tx_dout = !(eep_s[2]^null_s[0]^null_s[1]);
287
                         end
288
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b01 && last_type == FCT  && global_counter_transfer[3:0] == 4'd0)
289
                         begin
290
                                tx_dout = !(eep_s[2]^fct_s[0]^fct_s[1]);
291
                         end
292
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b01 && last_type == EOP  && global_counter_transfer[3:0] == 4'd0)
293
                         begin
294
                                tx_dout = !(eep_s[2]^eop_s[0]^eop_s[1]);
295
                         end
296
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b01 && last_type == EEP && global_counter_transfer[3:0] == 4'd0)
297
                         begin
298
                                tx_dout = !(eep_s[2]^eep_s[0]^eep_s[1]);
299
                         end
300
                         else if(tx_data_in[8]  && tx_data_in[1:0] == 2'b01 && last_type == DATA && global_counter_transfer[3:0] == 4'd0)
301
                         begin
302
                                tx_dout = !(eep_s[2]^txdata_flagctrl_tx_last[0]^txdata_flagctrl_tx_last[1]^txdata_flagctrl_tx_last[2]^txdata_flagctrl_tx_last[3]^ txdata_flagctrl_tx_last[4]^txdata_flagctrl_tx_last[5]^txdata_flagctrl_tx_last[6]^txdata_flagctrl_tx_last[7]);
303
                         end
304
                         else if(tx_data_in[8]  &&  tx_data_in[1:0] == 2'b01 && last_type == TIMEC && global_counter_transfer[3:0] == 4'd0)
305
                         begin
306
                                tx_dout = !(eep_s[2]^last_timein_control_flag_tx[7]^last_timein_control_flag_tx[6]^last_timein_control_flag_tx[5]^last_timein_control_flag_tx[4]^last_timein_control_flag_tx[3]^last_timein_control_flag_tx[2]^last_timein_control_flag_tx[1]^last_timein_control_flag_tx[0]);
307
                         end
308
                         else if(!tx_data_in[8] &&  global_counter_transfer[3:0] == 4'd1)
309
                         begin
310
                                tx_dout = tx_data_in[8];
311
                         end
312
                         else if(!tx_data_in[8] && global_counter_transfer[3:0] == 4'd2)
313
                         begin
314
                                tx_dout = tx_data_in[0];
315
                         end
316
                         else if(!tx_data_in[8] &&  global_counter_transfer[3:0] == 4'd3)
317
                         begin
318
                                tx_dout = tx_data_in[1];
319
                         end
320
                         else if(!tx_data_in[8] && global_counter_transfer[3:0] == 4'd4)
321
                         begin
322
                                tx_dout = tx_data_in[2];
323
                         end
324
                         else if(!tx_data_in[8]  && global_counter_transfer[3:0] == 4'd5)
325
                         begin
326
                                tx_dout = tx_data_in[3];
327
                         end
328
                         else if(!tx_data_in[8]  && global_counter_transfer[3:0] == 4'd6)
329
                         begin
330
                                tx_dout = tx_data_in[4];
331
                         end
332
                         else if(!tx_data_in[8]  && global_counter_transfer[3:0] == 4'd7)
333
                         begin
334
                                tx_dout = tx_data_in[5];
335
                         end
336
                         else if(!tx_data_in[8] &&  global_counter_transfer[3:0] == 4'd8)
337
                         begin
338
                                tx_dout = tx_data_in[6];
339
                         end
340
                         else if(!tx_data_in[8] &&  global_counter_transfer[3:0] == 4'd9)
341
                         begin
342
                                tx_dout = tx_data_in[7];
343
                         end
344
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b01 && global_counter_transfer[3:0] == 4'd1)
345
                         begin
346
                                tx_dout = eep_s[2];
347
                         end
348
                         else if( tx_data_in[8] && tx_data_in[1:0] == 2'b01 && global_counter_transfer[3:0] == 4'd2)
349
                         begin
350
                                tx_dout = eep_s[1];
351
                         end
352
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b01 && global_counter_transfer[3:0] == 4'd3)
353
                         begin
354
                                tx_dout = eep_s[0];
355
                         end
356
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b00 && global_counter_transfer[3:0] == 4'd1)
357
                         begin
358
                                tx_dout = eop_s[2];
359
                         end
360
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b00 && global_counter_transfer[3:0] == 4'd2)
361
                         begin
362
                                tx_dout = eop_s[1];
363
                         end
364
                         else if(tx_data_in[8] && tx_data_in[1:0] == 2'b00 && global_counter_transfer[3:0] == 4'd3)
365
                         begin
366
                                tx_dout = eop_s[0];
367
                         end
368
                end
369
                tx_spw_time_code_c:
370
                begin
371
                         if(last_type == NULL  && global_counter_transfer[3:0] == 4'd0)
372
                         begin
373
                                tx_dout = !(timecode_s[12]^null_s[0]^null_s[1]);
374
                         end
375
                         else if(last_type == FCT   && global_counter_transfer[3:0] == 4'd0)
376
                         begin
377
                                tx_dout = !(timecode_s[12]^fct_s[0]^fct_s[1]);
378
                         end
379
                         else if (last_type == EOP   && global_counter_transfer[3:0] == 4'd0)
380
                         begin
381
                                tx_dout = !(timecode_s[12]^eop_s[0]^eop_s[1]);
382
                         end
383
                         else if( last_type == EEP   && global_counter_transfer[3:0] == 4'd0)
384
                         begin
385
                                tx_dout = !(timecode_s[12]^eep_s[0]^eep_s[1]);
386
                         end
387
                         else if( last_type == DATA  && global_counter_transfer[3:0] == 4'd0)
388
                         begin
389
                                tx_dout = !(timecode_s[12]^txdata_flagctrl_tx_last[0]^txdata_flagctrl_tx_last[1]^txdata_flagctrl_tx_last[2]^txdata_flagctrl_tx_last[3]^ txdata_flagctrl_tx_last[4]^txdata_flagctrl_tx_last[5]^txdata_flagctrl_tx_last[6]^txdata_flagctrl_tx_last[7]);
390
                         end
391
                         else if( last_type == TIMEC && global_counter_transfer[3:0] == 4'd0)
392
                         begin
393
                                tx_dout = !(timecode_s[12]^last_timein_control_flag_tx[7]^last_timein_control_flag_tx[6]^last_timein_control_flag_tx[5]^last_timein_control_flag_tx[4]^last_timein_control_flag_tx[3]^last_timein_control_flag_tx[2]^last_timein_control_flag_tx[1]^last_timein_control_flag_tx[0]);
394
                         end
395
                         else if( global_counter_transfer[3:0] == 4'd1)
396
                         begin
397
                                tx_dout = timecode_s[12];
398
                         end
399
                         else if( global_counter_transfer[3:0] == 4'd2)
400
                         begin
401
                                tx_dout = timecode_s[11];
402
                         end
403
                         else if( global_counter_transfer[3:0] == 4'd3)
404
                         begin
405
                                tx_dout = timecode_s[10];
406
                         end
407
                         else if( global_counter_transfer[3:0] == 4'd4)
408
                         begin
409
                                tx_dout = timecode_s[9];
410
                         end
411
                         else if( global_counter_transfer[3:0] == 4'd5)
412
                         begin
413
                                tx_dout = timecode_s[8];
414
                         end
415
                         else if( global_counter_transfer[3:0] == 4'd6)
416
                         begin
417
                                tx_dout = timecode_s[0];
418
                         end
419
                         else if( global_counter_transfer[3:0] == 4'd7)
420
                         begin
421
                                tx_dout = timecode_s[1];
422
                         end
423
                         else if( global_counter_transfer[3:0] == 4'd8)
424
                         begin
425
                                tx_dout = timecode_s[2];
426
                         end
427
                         else if(global_counter_transfer[3:0] == 4'd9)
428
                         begin
429
                                tx_dout = timecode_s[3];
430
                         end
431
                         else if(global_counter_transfer[3:0] == 4'd10)
432
                         begin
433
                                tx_dout = timecode_s[4];
434
                         end
435
                         else if(global_counter_transfer[3:0] == 4'd11)
436
                         begin
437
                                tx_dout = timecode_s[5];
438
                         end
439
                         else if( global_counter_transfer[3:0] == 4'd12)
440
                         begin
441
                                tx_dout = timecode_s[6];
442
                         end
443
                         else if(global_counter_transfer[3:0] == 4'd13)
444
                         begin
445
                                tx_dout = timecode_s[7];
446
                         end
447
                end
448
                default:
449
                begin
450
                end
451
                endcase
452 5 redbear
end
453 33 redbear
 
454 5 redbear
//strobe
455
always@(*)
456
begin
457
 
458 36 redbear
        tx_sout = last_tx_sout;
459
 
460 37 redbear
        if(tx_dout == last_tx_dout)
461 5 redbear
        begin
462
                tx_sout = !last_tx_sout;
463
        end
464 37 redbear
        else if(tx_dout != last_tx_dout)
465 5 redbear
        begin
466
                tx_sout = last_tx_sout;
467 33 redbear
        end
468 5 redbear
end
469
 
470 17 redbear
always@(*)
471 5 redbear
begin
472 37 redbear
        next_state_fct_send = state_fct_send;
473 17 redbear
 
474 37 redbear
        case(state_fct_send)
475
        3'd0:
476 5 redbear
        begin
477 37 redbear
                if(send_fct_now)
478 15 redbear
                begin
479 37 redbear
                        next_state_fct_send = 3'd1;
480 17 redbear
                end
481 37 redbear
                else if(fct_sent)
482 17 redbear
                begin
483 37 redbear
                        next_state_fct_send = 3'd3;
484 15 redbear
                end
485 37 redbear
                else
486
                        next_state_fct_send = 3'd0;
487 5 redbear
        end
488 37 redbear
        3'd1:
489
        begin
490
                if(global_counter_transfer == 4'd2)
491
                begin
492
                        next_state_fct_send = 3'd2;
493
                end
494
                else
495
                begin
496
                        next_state_fct_send = 3'd1;
497
                end
498
        end
499
        3'd2:
500
        begin
501
                if(send_fct_now)
502
                begin
503
                        next_state_fct_send = 3'd2;
504
                end
505
                else
506
                begin
507
                        next_state_fct_send = 3'd0;
508
                end
509
        end
510
        3'd3:
511
        begin
512
                if(global_counter_transfer == 4'd2)
513
                begin
514
                        next_state_fct_send = 3'd4;
515
                end
516
                else
517
                begin
518
                        next_state_fct_send = 3'd3;
519
                end
520
        end
521
        3'd4:
522
        begin
523
                if(fct_sent)
524
                begin
525
                        next_state_fct_send = 3'd4;
526
                end
527
                else
528
                begin
529
                        next_state_fct_send = 3'd0;
530
                end
531
        end
532
        default:
533
        begin
534
                next_state_fct_send = 3'd0;
535
        end
536
        endcase
537 5 redbear
end
538
 
539 37 redbear
always@(posedge pclk_tx or negedge enable_tx)
540 5 redbear
begin
541 37 redbear
        if(!enable_tx)
542
        begin
543
                fct_flag <= 3'd7;
544
                state_fct_send<= 3'd0;
545
        end
546
        else
547
        begin
548
                state_fct_send <= next_state_fct_send;
549 5 redbear
 
550 37 redbear
                case(state_fct_send)
551
                3'd0:
552 19 redbear
                begin
553 37 redbear
                        fct_flag <= fct_flag;
554 6 redbear
                end
555 37 redbear
                3'd1:
556 6 redbear
                begin
557 37 redbear
                        if(global_counter_transfer == 4'd2)
558
                                fct_flag <= fct_flag + 3'd1;
559 19 redbear
                        else
560 37 redbear
                                fct_flag <= fct_flag;
561 6 redbear
                end
562 37 redbear
                3'd2:
563
                begin
564
                        fct_flag <= fct_flag;
565
                end
566
                3'd3:
567
                begin
568
                        if(global_counter_transfer == 4'd2)
569
                                fct_flag <= fct_flag - 3'd1;
570
                        else
571
                                fct_flag <= fct_flag;
572
                end
573
                3'd4:
574
                begin
575
                        fct_flag <= fct_flag;
576
                end
577
                default:
578
                begin
579
                        fct_flag <= fct_flag;
580
                end
581
                endcase
582 5 redbear
        end
583
end
584
 
585 37 redbear
 
586 36 redbear
always@(*)
587
begin
588 37 redbear
        next_state_fct_receive = state_fct_receive;
589 5 redbear
 
590 37 redbear
        case(state_fct_receive)
591
        3'd0:
592 36 redbear
        begin
593 37 redbear
                if(gotfct_tx)
594
                begin
595
                        next_state_fct_receive = 3'd1;
596
                end
597
                else if(char_sent)
598
                begin
599
                        next_state_fct_receive = 3'd3;
600
                end
601
                else
602
                        next_state_fct_receive = 3'd0;
603 36 redbear
        end
604 37 redbear
        3'd1:
605 36 redbear
        begin
606 37 redbear
                if(global_counter_transfer == 4'd2)
607
                begin
608
                        next_state_fct_receive = 3'd2;
609
                end
610
                else
611
                begin
612
                        next_state_fct_receive = 3'd1;
613
                end
614 36 redbear
        end
615 37 redbear
        3'd2:
616 36 redbear
        begin
617 37 redbear
                if(gotfct_tx)
618
                begin
619
                        next_state_fct_receive = 3'd2;
620
                end
621
                else
622
                begin
623
                        next_state_fct_receive = 3'd0;
624
                end
625 36 redbear
        end
626 37 redbear
        3'd3:
627 36 redbear
        begin
628 37 redbear
                if(global_counter_transfer == 4'd2)
629
                begin
630
                        next_state_fct_receive = 3'd4;
631
                end
632
                else
633
                begin
634
                        next_state_fct_receive = 3'd3;
635
                end
636 36 redbear
        end
637 37 redbear
        3'd4:
638
        begin
639
                if(char_sent)
640
                begin
641
                        next_state_fct_receive = 3'd4;
642
                end
643
                else
644
                begin
645
                        next_state_fct_receive = 3'd0;
646
                end
647
        end
648
        default:
649
        begin
650
                next_state_fct_receive = 3'd0;
651
        end
652
        endcase
653 36 redbear
end
654
 
655 37 redbear
 
656
always@(posedge pclk_tx or negedge enable_tx)
657 5 redbear
begin
658 37 redbear
        if(!enable_tx)
659
        begin
660
                fct_counter_receive<= 6'd0;
661
                state_fct_receive <= 3'd0;
662
        end
663
        else
664
        begin
665 5 redbear
 
666 37 redbear
                state_fct_receive <= next_state_fct_receive;
667 5 redbear
 
668 37 redbear
                case(state_fct_receive)
669
                3'd0:
670
                begin
671
                        fct_counter_receive <= fct_counter_receive;
672
                end
673
                3'd1:
674
                begin
675
                        if(global_counter_transfer == 4'd2)
676
                        begin
677
                                if(fct_counter_receive < 6'd48)
678
                                begin
679
                                        fct_counter_receive <= fct_counter_receive + 6'd8;
680
                                end
681
                                else
682
                                begin
683
                                        fct_counter_receive <= fct_counter_receive + 6'd7;
684
                                end
685
                        end
686
                        else
687
                                fct_counter_receive <= fct_counter_receive;
688
                end
689
                3'd2:
690
                begin
691
                        fct_counter_receive <= fct_counter_receive;
692
                end
693
                3'd3:
694
                begin
695
                        if(global_counter_transfer == 4'd2)
696
                                fct_counter_receive <= fct_counter_receive - 6'd1;
697
                        else
698
                                fct_counter_receive <= fct_counter_receive;
699
                end
700
                3'd4:
701
                begin
702
                        fct_counter_receive <= fct_counter_receive;
703
                end
704
                default:
705
                begin
706
                        fct_counter_receive <= fct_counter_receive;
707
                end
708
                endcase
709
        end
710
end
711 5 redbear
 
712 37 redbear
always@(*)
713
begin
714 17 redbear
        next_state_tx = state_tx;
715
 
716 5 redbear
        case(state_tx)
717
        tx_spw_start:
718
        begin
719
                if(send_null_tx && enable_tx)
720
                begin
721 36 redbear
                        next_state_tx = tx_spw_null;
722 5 redbear
                end
723
                else
724
                begin
725
                        next_state_tx = tx_spw_start;
726
                end
727
        end
728
        tx_spw_null:
729
        begin
730 37 redbear
                if(send_null_tx && send_fct_tx && enable_tx)
731 5 redbear
                begin
732 37 redbear
                        if(global_counter_transfer == 4'd7)
733
                                next_state_tx = tx_spw_fct;
734 5 redbear
                end
735 37 redbear
                else
736
                        next_state_tx = tx_spw_null;
737 5 redbear
        end
738 37 redbear
        tx_spw_fct:
739 5 redbear
        begin
740 37 redbear
                if(send_fct_tx && fct_flag > 3'd0)
741 5 redbear
                begin
742 37 redbear
                        next_state_tx = tx_spw_fct;
743 5 redbear
                end
744
                else
745
                begin
746 17 redbear
                        if(send_fct_tx && fct_counter_receive > 6'd0)
747 5 redbear
                        begin
748 37 redbear
                                if(global_counter_transfer == 4'd7 || global_counter_transfer == 4'd3)
749
                                begin
750
                                        if(tickin_tx && !ready_tx_timecode && tcode_rdy_trnsp)
751
                                        begin
752
                                                next_state_tx = tx_spw_time_code_c;
753
                                        end
754
                                        else if(fct_flag > 3'd0 && !send_fct_now)
755
                                        begin
756
                                                next_state_tx = tx_spw_fct_c;
757
                                        end
758
                                        else if(txwrite_tx && !gotfct_tx && !gotfct_tx && !ready_tx_data && data_rdy_trnsp && fct_counter_receive > 6'd0)
759
                                        begin
760
                                                next_state_tx = tx_spw_data_c;
761
                                        end
762
                                        else
763
                                        begin
764
                                                next_state_tx = tx_spw_null_c;
765
                                        end
766
                                end
767 5 redbear
                        end
768
                end
769
        end
770 37 redbear
        tx_spw_null_c:
771 5 redbear
        begin
772 37 redbear
                if(global_counter_transfer == 4'd7)
773 5 redbear
                begin
774 37 redbear
                        if(tickin_tx && !ready_tx_timecode && tcode_rdy_trnsp)
775
                        begin
776
                                next_state_tx = tx_spw_time_code_c;
777
                        end
778
                        else if(fct_flag > 3'd0 && !send_fct_now)
779
                        begin
780
                                next_state_tx = tx_spw_fct_c;
781
                        end
782
                        else if(txwrite_tx && !gotfct_tx && !ready_tx_data && data_rdy_trnsp && fct_counter_receive > 6'd0)
783
                        begin
784
                                next_state_tx = tx_spw_data_c;
785
                        end
786
                        else
787
                        begin
788
                                next_state_tx = tx_spw_null_c;
789
                        end
790
                end
791
                else
792 5 redbear
                begin
793 37 redbear
                        next_state_tx = tx_spw_null_c;
794 5 redbear
                end
795 37 redbear
        end
796
        tx_spw_fct_c:
797
        begin
798
                if(global_counter_transfer == 4'd3)
799 5 redbear
                begin
800 37 redbear
                        if(tickin_tx && !ready_tx_timecode && tcode_rdy_trnsp)
801
                        begin
802
                                next_state_tx = tx_spw_time_code_c;
803
                        end
804
                        else
805
                        begin
806
                                next_state_tx = tx_spw_null_c;
807
                        end
808 5 redbear
                end
809 37 redbear
                else
810 8 redbear
                begin
811 37 redbear
                        next_state_tx = tx_spw_fct_c;
812 8 redbear
                end
813 5 redbear
        end
814 37 redbear
        tx_spw_data_c:
815
        begin
816
 
817
                if(!tx_data_in[8])
818
                begin
819
                        if(global_counter_transfer == 4'd9)
820
                        begin
821
                                if(tickin_tx && !ready_tx_timecode && tcode_rdy_trnsp)
822
                                begin
823
                                        next_state_tx = tx_spw_time_code_c;
824
                                end
825
                                else if(fct_flag > 3'd0 && !send_fct_now)
826
                                begin
827
                                        next_state_tx = tx_spw_fct_c;
828
                                end
829
                                else
830
                                begin
831
                                        next_state_tx = tx_spw_null_c;
832
                                end
833
                        end
834
                        else
835
                                next_state_tx = tx_spw_data_c;
836
                end
837
                else if(tx_data_in[8])
838
                begin
839
                        if(global_counter_transfer == 4'd3)
840
                        begin
841
                                if(tickin_tx && !ready_tx_timecode && tcode_rdy_trnsp)
842
                                begin
843
                                        next_state_tx = tx_spw_time_code_c;
844
                                end
845
                                else if(fct_flag > 3'd0 && !send_fct_now)
846
                                begin
847
                                        next_state_tx = tx_spw_fct_c;
848
                                end
849
                                else
850
                                begin
851
                                        next_state_tx = tx_spw_null_c;
852
                                end
853
                        end
854
                        else
855
                                next_state_tx = tx_spw_data_c;
856
                end
857
 
858
 
859
        end
860
        tx_spw_time_code_c:
861
        begin
862
                if(global_counter_transfer == 4'd13)
863
                begin
864
                        if(fct_flag > 3'd0 && !send_fct_now)
865
                        begin
866
                                next_state_tx = tx_spw_fct_c;
867
                        end
868
                        else if(txwrite_tx && !gotfct_tx && !ready_tx_data && data_rdy_trnsp && fct_counter_receive > 6'd0 )
869
                        begin
870
                                next_state_tx = tx_spw_data_c;
871
                        end
872
                        else
873
                        begin
874
                                next_state_tx = tx_spw_null_c;
875
                        end
876
                end
877
                else
878
                begin
879
                        next_state_tx = tx_spw_time_code_c;
880
                end
881
        end
882
        default:
883
        begin
884
                next_state_tx = tx_spw_start;
885
        end
886 5 redbear
        endcase
887
end
888
 
889 33 redbear
 
890 25 redbear
always@(posedge pclk_tx or negedge enable_tx)
891 5 redbear
begin
892
        if(!enable_tx)
893
        begin
894 25 redbear
 
895
                timecode_s    <= 14'b01110000000000;
896 6 redbear
 
897 13 redbear
                ready_tx_data     <= 1'b0;
898
                ready_tx_timecode <= 1'b0;
899 8 redbear
 
900 5 redbear
                last_type  <= NULL;
901
 
902
                global_counter_transfer <= 4'd0;
903
                txdata_flagctrl_tx_last <= 9'd0;
904 36 redbear
                tx_data_in <= 9'd0;
905 5 redbear
                last_timein_control_flag_tx <= 8'd0;
906 6 redbear
 
907 37 redbear
                char_sent<= 1'b0;
908
                fct_sent <= 1'b0;
909 6 redbear
 
910 5 redbear
                last_tx_dout      <= 1'b0;
911
                last_tx_sout      <= 1'b0;
912 33 redbear
 
913 5 redbear
                state_tx <= tx_spw_start;
914 17 redbear
 
915 36 redbear
                tx_dout_e <= 1'b0;
916
                tx_sout_e <= 1'b0;
917
 
918
                data_rdy_trnsp <= 1'b0;
919
 
920
                tx_tcode_in     <= 8'd0;
921
                tcode_rdy_trnsp <= 1'b0;
922
 
923 5 redbear
        end
924
        else
925
        begin
926
                state_tx <= next_state_tx;
927 36 redbear
 
928 37 redbear
                case(state_tx)
929
                tx_spw_start:
930
                begin
931
                end
932
                tx_spw_null:
933
                begin
934 5 redbear
 
935 37 redbear
                        last_tx_dout <= tx_dout;
936
                        last_tx_sout <= tx_sout;
937 36 redbear
 
938 37 redbear
                        tx_dout_e <= last_tx_dout;
939
                        tx_sout_e <= last_tx_sout;
940 6 redbear
 
941 37 redbear
 
942 36 redbear
                        if(txwrite_tx && global_counter_transfer == 4'd5)
943
                        begin
944
                                tx_data_in <= data_tx_i;
945
                                data_rdy_trnsp <= 1'b1;
946
                        end
947
                        else
948
                                tx_data_in <= tx_data_in;
949
 
950
                        if(tickin_tx && global_counter_transfer == 4'd5)
951
                        begin
952
                                tx_tcode_in <= timecode_tx_i;
953
                                tcode_rdy_trnsp <= 1'b1;
954
                        end
955
                        else
956
                                tx_tcode_in <= tx_tcode_in;
957
 
958
                        if(global_counter_transfer == 4'd3)
959 34 redbear
                        begin
960 36 redbear
                                ready_tx_timecode <= 1'b0;
961
                                ready_tx_data <= 1'b0;
962 34 redbear
                        end
963
                        else
964
                        begin
965 36 redbear
                                ready_tx_timecode <= ready_tx_timecode;
966
                                ready_tx_data <= ready_tx_data;
967 34 redbear
                        end
968
 
969 36 redbear
                        if(global_counter_transfer == 4'd7)
970 5 redbear
                        begin
971 36 redbear
                                last_type  <= NULL;
972
                                global_counter_transfer <= 4'd0;
973 5 redbear
                        end
974 36 redbear
                        else
975 5 redbear
                        begin
976 36 redbear
                                last_type  <= last_type;
977 5 redbear
                                global_counter_transfer <= global_counter_transfer + 4'd1;
978
                        end
979
                end
980 37 redbear
                tx_spw_fct:
981 5 redbear
                begin
982 8 redbear
 
983 37 redbear
                        last_tx_dout <= tx_dout;
984
                        last_tx_sout <= tx_sout;
985 25 redbear
 
986 37 redbear
                        tx_dout_e <= last_tx_dout;
987
                        tx_sout_e <= last_tx_sout;
988 36 redbear
 
989
                        ready_tx_data <= ready_tx_data;
990 6 redbear
 
991 34 redbear
                        if(global_counter_transfer == 4'd3)
992
                        begin
993 36 redbear
                                last_type  <=FCT;
994
                                global_counter_transfer <= 4'd0;
995 37 redbear
                                fct_sent <= 1'b0;
996 34 redbear
                        end
997
                        else
998
                        begin
999 37 redbear
                                if(fct_flag > 3'd0)
1000
                                        fct_sent <=  1'b1;
1001 19 redbear
                                else
1002 37 redbear
                                        fct_sent <= fct_sent;
1003 36 redbear
                                global_counter_transfer <= global_counter_transfer + 4'd1;
1004 5 redbear
                        end
1005
                end
1006 37 redbear
                tx_spw_null_c:
1007 5 redbear
                begin
1008 33 redbear
 
1009 37 redbear
                        last_tx_dout <= tx_dout;
1010
                        last_tx_sout <= tx_sout;
1011
 
1012
                        tx_dout_e <= last_tx_dout;
1013
                        tx_sout_e <= last_tx_sout;
1014
 
1015
 
1016
                        if(txwrite_tx && global_counter_transfer == 4'd5)
1017 36 redbear
                        begin
1018 37 redbear
                                tx_data_in <= data_tx_i;
1019 36 redbear
                                data_rdy_trnsp <= 1'b1;
1020
                        end
1021
                        else
1022
                                tx_data_in <= tx_data_in;
1023
 
1024 37 redbear
                        if(tickin_tx && global_counter_transfer == 4'd5)
1025 17 redbear
                        begin
1026 37 redbear
                                tx_tcode_in <= timecode_tx_i;
1027
                                tcode_rdy_trnsp <= 1'b1;
1028 17 redbear
                        end
1029
                        else
1030 37 redbear
                                tx_tcode_in <= tx_tcode_in;
1031 15 redbear
 
1032 37 redbear
 
1033
                        if(global_counter_transfer == 4'd3)
1034 13 redbear
                        begin
1035 37 redbear
                                char_sent <= 1'b0;
1036
                                fct_sent <=  1'b0;
1037
                                ready_tx_timecode <= 1'b0;
1038
                                ready_tx_data <= 1'b0;
1039 13 redbear
                        end
1040 34 redbear
                        else
1041
                        begin
1042 37 redbear
                                ready_tx_timecode <= ready_tx_timecode;
1043
                                ready_tx_data <= ready_tx_data;
1044 34 redbear
                        end
1045
 
1046 37 redbear
                        if(global_counter_transfer == 4'd7)
1047 6 redbear
                        begin
1048 37 redbear
                                last_type  <= NULL;
1049
                                global_counter_transfer <= 4'd0;
1050 6 redbear
                        end
1051 37 redbear
                        else
1052 19 redbear
                        begin
1053 37 redbear
                                last_type  <= last_type;
1054
                                global_counter_transfer <= global_counter_transfer + 4'd1;
1055 19 redbear
                        end
1056 37 redbear
                end
1057
                tx_spw_fct_c:
1058
                begin
1059 6 redbear
 
1060 37 redbear
                        last_tx_dout <= tx_dout;
1061
                        last_tx_sout <= tx_sout;
1062
 
1063
                        tx_dout_e <= last_tx_dout;
1064
                        tx_sout_e <= last_tx_sout;
1065
 
1066
                        ready_tx_data <= ready_tx_data;
1067
 
1068
                        if(global_counter_transfer == 4'd3)
1069
                        begin
1070
                                char_sent <= 1'b0;
1071
                                last_type  <=FCT;
1072
                                fct_sent <=  1'b0;
1073
                                global_counter_transfer <= 4'd0;
1074 5 redbear
                        end
1075
                        else
1076
                        begin
1077 37 redbear
                                if(fct_flag > 3'd0)
1078
                                        fct_sent <=  1'b1;
1079
                                else
1080
                                        fct_sent <= fct_sent;
1081
 
1082
                                global_counter_transfer <= global_counter_transfer + 4'd1;
1083 5 redbear
                        end
1084
                end
1085 37 redbear
                tx_spw_data_c:
1086 5 redbear
                begin
1087 6 redbear
 
1088 37 redbear
                        last_tx_dout <= tx_dout;
1089
                        last_tx_sout <= tx_sout;
1090
 
1091
                        tx_dout_e <= last_tx_dout;
1092
                        tx_sout_e <= last_tx_sout;
1093
 
1094
                        fct_sent <=  1'b0;
1095
 
1096 36 redbear
                        if(!tx_data_in[8])
1097 5 redbear
                        begin
1098 8 redbear
 
1099
                                if(global_counter_transfer == 4'd9)
1100
                                begin
1101 37 redbear
                                        char_sent <= 1'b1;
1102
 
1103 36 redbear
                                        last_type  <= DATA;
1104 8 redbear
                                        ready_tx_data <= 1'b1;
1105 36 redbear
                                        data_rdy_trnsp <= 1'b0;
1106
                                        global_counter_transfer <= 4'd0;
1107 8 redbear
                                end
1108 17 redbear
                                else
1109
                                begin
1110 36 redbear
                                        ready_tx_data <= 1'b0;
1111
                                        ready_tx_timecode <= 1'b0;
1112
                                        global_counter_transfer <= global_counter_transfer + 4'd1;
1113 8 redbear
                                end
1114
 
1115 36 redbear
                                if(global_counter_transfer == 4'd4)
1116
                                        txdata_flagctrl_tx_last <= tx_data_in;
1117
 
1118
 
1119 5 redbear
                        end
1120 36 redbear
                        else if(tx_data_in[8])
1121 5 redbear
                        begin
1122 8 redbear
 
1123
                                if(global_counter_transfer == 4'd3)
1124
                                begin
1125 37 redbear
                                        char_sent <= 1'b1;
1126 36 redbear
 
1127
                                        if(tx_data_in[1:0] == 2'b00)
1128
                                        begin
1129
                                                last_type  <=EOP;
1130
                                        end
1131
                                        else if(tx_data_in[1:0] == 2'b01)
1132
                                        begin
1133
                                                last_type  <=EEP;
1134
                                        end
1135
 
1136
                                        global_counter_transfer <= 4'd0;
1137
                                        data_rdy_trnsp <= 1'b0;
1138 8 redbear
                                        ready_tx_data <= 1'b1;
1139
                                end
1140 17 redbear
                                else
1141
                                begin
1142 34 redbear
                                        txdata_flagctrl_tx_last <= txdata_flagctrl_tx_last;
1143 17 redbear
 
1144 36 redbear
                                        ready_tx_data <= 1'b0;
1145
                                        ready_tx_timecode <= 1'b0;
1146
                                        global_counter_transfer <= global_counter_transfer + 4'd1;
1147 8 redbear
                                end
1148 34 redbear
 
1149 36 redbear
 
1150 5 redbear
                        end
1151 8 redbear
 
1152 5 redbear
                end
1153 37 redbear
                tx_spw_time_code_c:
1154
                begin
1155
 
1156
                        if(txwrite_tx && global_counter_transfer == 4'd6)
1157
                        begin
1158
                                data_rdy_trnsp <= 1'b1;
1159
                                tx_data_in <= data_tx_i;
1160
                        end
1161
                        else
1162
                                tx_data_in <= tx_data_in;
1163
 
1164
 
1165
                        fct_sent <=  1'b0;
1166
 
1167
                        last_tx_dout <= tx_dout;
1168
                        last_tx_sout <= tx_sout;
1169
 
1170
                        tx_dout_e <= last_tx_dout;
1171
                        tx_sout_e <= last_tx_sout;
1172
 
1173
                        if(global_counter_transfer == 4'd13)
1174
                        begin
1175
                                ready_tx_timecode <= 1'b1;
1176
                                global_counter_transfer <= 4'd0;
1177
                        end
1178
                        else
1179
                        begin
1180
                                ready_tx_timecode <= 1'b0;
1181
                                global_counter_transfer <= global_counter_transfer + 4'd1;
1182
                        end
1183
 
1184
 
1185
                        if(global_counter_transfer != 4'd13)
1186
                        begin
1187
 
1188
                                timecode_s <= {timecode_ss[13:10],2'd2,tx_tcode_in[7:0]};
1189
                        end
1190
                        else
1191
                        begin
1192
                                ready_tx_data <= 1'b0;
1193
                                last_timein_control_flag_tx <= tx_tcode_in;
1194
                                last_type  <= TIMEC;
1195
                        end
1196
 
1197
                end
1198
                default:
1199
                begin
1200
                        last_type               <= last_type;
1201
                        global_counter_transfer <= global_counter_transfer;
1202
                        tx_dout_e               <= tx_dout_e;
1203
                        tx_sout_e               <= tx_sout_e;
1204
                end
1205
                endcase
1206 5 redbear
        end
1207
end
1208
 
1209
endmodule

powered by: WebSVN 2.1.0

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