Line 51... |
Line 51... |
input send_fct_now,
|
input send_fct_now,
|
//
|
//
|
output reg tx_dout,
|
output reg tx_dout,
|
output reg tx_sout,
|
output reg tx_sout,
|
//
|
//
|
output ready_tx_data,
|
output reg ready_tx_data,
|
output ready_tx_timecode
|
output ready_tx_timecode
|
|
|
);
|
);
|
|
|
localparam [2:0] tx_spw_start = 3'b000,
|
localparam [2:0] tx_spw_start = 3'b000,
|
Line 83... |
Line 83... |
reg [8:0] txdata_flagctrl_tx_last;
|
reg [8:0] txdata_flagctrl_tx_last;
|
reg [7:0] last_timein_control_flag_tx;
|
reg [7:0] last_timein_control_flag_tx;
|
|
|
reg first_time;
|
reg first_time;
|
|
|
|
reg hold_null;
|
|
reg hold_fct;
|
|
reg hold_data;
|
|
reg hold_time_code;
|
|
|
reg enable_null;
|
reg enable_null;
|
reg enable_fct;
|
reg enable_fct;
|
reg enable_n_char;
|
reg enable_n_char;
|
reg enable_time_code;
|
reg enable_time_code;
|
|
|
Line 103... |
Line 108... |
|
|
reg [3:0] global_counter_transfer;
|
reg [3:0] global_counter_transfer;
|
|
|
assign ready_tx_timecode = (enable_time_code & global_counter_transfer == 14)?1'b1:1'b0;
|
assign ready_tx_timecode = (enable_time_code & global_counter_transfer == 14)?1'b1:1'b0;
|
|
|
assign ready_tx_data = (enable_n_char & global_counter_transfer == 4'd10 & !data_tx_i[8])?1'b1:
|
|
(enable_n_char & global_counter_transfer == 4'd4 & data_tx_i[8])?1'b1:1'b0;
|
|
|
|
always@(*)
|
always@(*)
|
begin
|
begin
|
tx_dout = 1'b0;
|
tx_dout = 1'b0;
|
|
|
if(!enable_tx)
|
if(!enable_tx)
|
Line 282... |
Line 284... |
end
|
end
|
else if( enable_time_code & !first_time & global_counter_transfer == 4'd13)
|
else if( enable_time_code & !first_time & global_counter_transfer == 4'd13)
|
begin
|
begin
|
tx_dout = timecode_s[0];
|
tx_dout = timecode_s[0];
|
end
|
end
|
else if( enable_n_char & !first_time & last_type == NULL & global_counter_transfer == 4'd0)
|
else if( enable_n_char & !data_tx_i[8] & !first_time & last_type == NULL & global_counter_transfer == 4'd0)
|
begin
|
begin
|
tx_dout = !(data_tx_i[8]^null_s[0]^null_s[1]);
|
tx_dout = !(data_tx_i[8]^null_s[0]^null_s[1]);
|
end
|
end
|
else if( enable_n_char & !first_time & last_type == FCT & global_counter_transfer == 4'd0)
|
else if( enable_n_char & !data_tx_i[8] & !first_time & last_type == FCT & global_counter_transfer == 4'd0)
|
begin
|
begin
|
tx_dout = !(data_tx_i[8]^fct_s[0]^fct_s[1]);
|
tx_dout = !(data_tx_i[8]^fct_s[0]^fct_s[1]);
|
end
|
end
|
else if( enable_n_char & !first_time & last_type == EOP & global_counter_transfer == 4'd0)
|
else if( enable_n_char & !data_tx_i[8] & !first_time & last_type == EOP & global_counter_transfer == 4'd0)
|
begin
|
begin
|
tx_dout = !(data_tx_i[8]^eop_s[0]^eop_s[1]);
|
tx_dout = !(data_tx_i[8]^eop_s[0]^eop_s[1]);
|
end
|
end
|
else if( enable_n_char & !first_time & last_type == EEP & global_counter_transfer == 4'd0)
|
else if( enable_n_char & !data_tx_i[8] & !first_time & last_type == EEP & global_counter_transfer == 4'd0)
|
begin
|
begin
|
tx_dout = !(data_tx_i[8]^eep_s[0]^eep_s[1]);
|
tx_dout = !(data_tx_i[8]^eep_s[0]^eep_s[1]);
|
end
|
end
|
else if( enable_n_char & !first_time & last_type == DATA & global_counter_transfer == 4'd0)
|
else if( enable_n_char & !data_tx_i[8] & !first_time & last_type == DATA & global_counter_transfer == 4'd0)
|
begin
|
begin
|
tx_dout = !(data_tx_i[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]);
|
tx_dout = !(data_tx_i[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]);
|
end
|
end
|
else if( enable_n_char & !first_time & last_type == TIMEC & global_counter_transfer == 4'd0)
|
else if( enable_n_char & !data_tx_i[8] & !first_time & last_type == TIMEC & global_counter_transfer == 4'd0)
|
begin
|
begin
|
tx_dout = !(data_tx_i[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]);
|
tx_dout = !(data_tx_i[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]);
|
end
|
end
|
else if( enable_n_char & !data_tx_i[8] & !first_time & global_counter_transfer == 4'd1)
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & last_type == NULL & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eop_s[3]^null_s[0]^null_s[1]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & last_type == FCT & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eop_s[3]^fct_s[0]^fct_s[1]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & last_type == EOP & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eop_s[3]^eop_s[0]^eop_s[1]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & last_type == EEP & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eop_s[3]^eep_s[0]^eep_s[1]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & last_type == DATA & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eop_s[3]^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]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & last_type == TIMEC & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eop_s[3]^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]);
|
|
end
|
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & global_counter_transfer == 4'd1)
|
|
begin
|
|
tx_dout = eop_s[2];
|
|
end
|
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & global_counter_transfer == 4'd2)
|
|
begin
|
|
tx_dout = eop_s[1];
|
|
end
|
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & global_counter_transfer == 4'd3)
|
|
begin
|
|
tx_dout = eop_s[0];
|
|
end
|
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & last_type == NULL & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eep_s[3]^null_s[0]^null_s[1]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & last_type == FCT & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eep_s[3]^fct_s[0]^fct_s[1]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & last_type == EOP & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eep_s[3]^eop_s[0]^eop_s[1]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & last_type == EEP & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eep_s[3]^eep_s[0]^eep_s[1]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & last_type == DATA & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eep_s[3]^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]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & last_type == TIMEC & global_counter_transfer == 4'd0)
|
|
begin
|
|
tx_dout = !(eep_s[3]^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]);
|
|
end
|
|
else if( enable_n_char & !data_tx_i[8] & !data_tx_i[8] & !first_time & global_counter_transfer == 4'd1)
|
begin
|
begin
|
tx_dout = data_tx_i[8];
|
tx_dout = data_tx_i[8];
|
end
|
end
|
else if( enable_n_char & !data_tx_i[8] & !first_time & global_counter_transfer == 4'd2)
|
else if( enable_n_char & !data_tx_i[8] & !first_time & global_counter_transfer == 4'd2)
|
begin
|
begin
|
Line 342... |
Line 404... |
end
|
end
|
else if( enable_n_char & !data_tx_i[8] & !first_time & global_counter_transfer == 4'd9)
|
else if( enable_n_char & !data_tx_i[8] & !first_time & global_counter_transfer == 4'd9)
|
begin
|
begin
|
tx_dout = data_tx_i[7];
|
tx_dout = data_tx_i[7];
|
end
|
end
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & global_counter_transfer == 4'd1)
|
|
begin
|
|
tx_dout = eop_s[2];
|
|
end
|
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & global_counter_transfer == 4'd2)
|
|
begin
|
|
tx_dout = eop_s[1];
|
|
end
|
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b00 & !first_time & global_counter_transfer == 4'd3)
|
|
begin
|
|
tx_dout = eop_s[0];
|
|
end
|
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & global_counter_transfer == 4'd1)
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & global_counter_transfer == 4'd1)
|
begin
|
begin
|
tx_dout = eep_s[2];
|
tx_dout = eep_s[2];
|
end
|
end
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & global_counter_transfer == 4'd2)
|
else if( enable_n_char & data_tx_i[8] & data_tx_i[1:0] == 2'b01 & !first_time & global_counter_transfer == 4'd2)
|
Line 377... |
Line 427... |
|
|
if(!enable_tx)
|
if(!enable_tx)
|
begin
|
begin
|
tx_sout = 1'b0;
|
tx_sout = 1'b0;
|
end
|
end
|
else if((enable_null | enable_fct) && tx_dout == last_tx_dout)
|
else if((enable_null | enable_fct | enable_n_char) && tx_dout == last_tx_dout)
|
begin
|
begin
|
tx_sout = !last_tx_sout;
|
tx_sout = !last_tx_sout;
|
end
|
end
|
else if((enable_null | enable_fct) && tx_dout != last_tx_dout)
|
else if((enable_null | enable_fct | enable_n_char) && tx_dout != last_tx_dout)
|
begin
|
begin
|
tx_sout = last_tx_sout;
|
tx_sout = last_tx_sout;
|
end
|
end
|
end
|
end
|
|
|
Line 444... |
Line 494... |
case(state_tx)
|
case(state_tx)
|
tx_spw_start:
|
tx_spw_start:
|
begin
|
begin
|
if(send_null_tx && enable_tx)
|
if(send_null_tx && enable_tx)
|
begin
|
begin
|
if(global_counter_transfer == 4'd7)
|
if(!hold_null)
|
next_state_tx = tx_spw_null;
|
next_state_tx = tx_spw_null;
|
|
|
enable_null = 1'b1;
|
enable_null = 1'b1;
|
end
|
end
|
else
|
else
|
Line 458... |
Line 508... |
end
|
end
|
tx_spw_null:
|
tx_spw_null:
|
begin
|
begin
|
enable_null = 1'b1;
|
enable_null = 1'b1;
|
|
|
if(global_counter_transfer == 4'd7)
|
if(!hold_null)
|
begin
|
begin
|
if(send_null_tx && send_fct_tx && enable_tx)
|
if(send_null_tx && send_fct_tx && enable_tx)
|
next_state_tx = tx_spw_null_fct;
|
next_state_tx = tx_spw_null_fct;
|
else
|
else
|
next_state_tx = tx_spw_null;
|
next_state_tx = tx_spw_null;
|
Line 471... |
Line 521... |
end
|
end
|
tx_spw_null_fct:
|
tx_spw_null_fct:
|
begin
|
begin
|
|
|
enable_null = 1'b1;
|
enable_null = 1'b1;
|
next_state_tx = tx_spw_null_fct;
|
|
|
|
if(send_fct_tx && fct_flag > 0)
|
if(send_fct_tx && fct_flag > 0 && !hold_null)
|
begin
|
begin
|
|
next_state_tx = tx_spw_null_fct;
|
enable_null = 1'b0;
|
enable_null = 1'b0;
|
enable_fct = 1'b1;
|
enable_fct = 1'b1;
|
end
|
end
|
else
|
else
|
begin
|
begin
|
enable_fct = 1'b0;
|
enable_fct = 1'b0;
|
|
if(send_fct_tx && fct_counter > 6'd0)
|
if(send_fct_tx && gotfct_tx)
|
|
begin
|
begin
|
if(global_counter_transfer == 4'd7)
|
|
next_state_tx = tx_spw_full;
|
next_state_tx = tx_spw_full;
|
end
|
end
|
|
|
end
|
end
|
end
|
end
|
tx_spw_full:
|
tx_spw_full:
|
begin
|
begin
|
|
|
enable_null = 1'b1;
|
enable_null = 1'b0;
|
|
enable_fct = 1'b0;
|
|
enable_n_char = 1'b0;
|
|
enable_time_code = 1'b0;
|
|
|
if(tickin_tx & (global_counter_transfer == 4'd7 || global_counter_transfer == 4'd9 || global_counter_transfer == 4'd13 || global_counter_transfer == 4'd3))
|
if(tickin_tx && !hold_null && !hold_fct && !hold_data)
|
begin
|
begin
|
enable_time_code = 1'b1;
|
enable_time_code = 1'b1;
|
enable_null = 1'b0;
|
|
end
|
end
|
else if(fct_flag > 3'd0 & (global_counter_transfer == 4'd7 || global_counter_transfer == 4'd9 || global_counter_transfer == 4'd13 || global_counter_transfer == 4'd3))
|
else if(fct_flag > 3'd0 && !hold_null && !hold_time_code && !hold_data)
|
begin
|
begin
|
enable_fct = 1'b1;
|
enable_fct = 1'b1;
|
enable_null = 1'b0;
|
|
end
|
end
|
else if(txwrite_tx && fct_counter_receive > 6'd0 & (global_counter_transfer == 4'd7 || global_counter_transfer == 4'd9 || global_counter_transfer == 4'd13 || global_counter_transfer == 4'd3))
|
else if(txwrite_tx && fct_counter_receive > 6'd0 && !hold_null && !hold_time_code && !hold_fct )
|
begin
|
begin
|
enable_n_char = 1'b1;
|
enable_n_char = 1'b1;
|
enable_null = 1'b0;
|
end
|
|
else if(!hold_time_code && !hold_fct && !hold_data)
|
|
begin
|
|
enable_null = 1'b1;
|
end
|
end
|
|
|
end
|
end
|
endcase
|
endcase
|
|
|
Line 530... |
Line 582... |
|
|
fct_flag <= 3'd0;
|
fct_flag <= 3'd0;
|
fct_send_last <= 3'd0;
|
fct_send_last <= 3'd0;
|
|
|
first_time <= 1'b1;
|
first_time <= 1'b1;
|
|
ready_tx_data <= 1'b0;
|
|
|
|
hold_null <= 1'b0;
|
|
hold_fct <= 1'b0;
|
|
hold_data <= 1'b0;
|
|
hold_time_code <= 1'b0;
|
|
|
last_type <= NULL;
|
last_type <= NULL;
|
|
|
global_counter_transfer <= 4'd0;
|
global_counter_transfer <= 4'd0;
|
txdata_flagctrl_tx_last <= 9'd0;
|
txdata_flagctrl_tx_last <= 9'd0;
|
last_timein_control_flag_tx <= 8'd0;
|
last_timein_control_flag_tx <= 8'd0;
|
Line 553... |
Line 612... |
last_tx_sout <= tx_sout;
|
last_tx_sout <= tx_sout;
|
|
|
if(enable_null)
|
if(enable_null)
|
begin
|
begin
|
|
|
|
ready_tx_data <= 1'b0;
|
|
|
//
|
//
|
if(fct_send_last != fct_send)
|
if(fct_send_last != fct_send)
|
begin
|
begin
|
if(fct_send == 3'd1 && fct_send_last == 3'd7)
|
if(fct_send == 3'd1 && fct_send_last == 3'd7)
|
begin
|
begin
|
Line 586... |
Line 647... |
end
|
end
|
|
|
if(first_time)
|
if(first_time)
|
begin
|
begin
|
first_time <= 1'b0;
|
first_time <= 1'b0;
|
|
hold_null <= 1'b1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
end
|
end
|
else if(global_counter_transfer != 4'd7)
|
else if(global_counter_transfer != 4'd7)
|
begin
|
begin
|
|
hold_null <= 1'b1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
end
|
end
|
else
|
else
|
begin
|
begin
|
|
hold_null <= 1'b0;
|
global_counter_transfer <= 4'd0;
|
global_counter_transfer <= 4'd0;
|
end
|
end
|
end
|
end
|
else if(enable_fct)
|
else if(enable_fct)
|
begin
|
begin
|
|
|
|
ready_tx_data <= 1'b0;
|
|
|
//
|
//
|
if(fct_counter_last != fct_counter)
|
if(fct_counter_last != fct_counter)
|
begin
|
begin
|
if(fct_counter == 6'd8 && fct_counter_last == 6'd56)
|
if(fct_counter == 6'd8 && fct_counter_last == 6'd56)
|
begin
|
begin
|
Line 617... |
Line 683... |
fct_counter_last <= fct_counter;
|
fct_counter_last <= fct_counter;
|
end
|
end
|
|
|
if(global_counter_transfer != 4'd3)
|
if(global_counter_transfer != 4'd3)
|
begin
|
begin
|
|
hold_fct <= 1'b1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
end
|
end
|
else
|
else
|
begin
|
begin
|
|
hold_fct <= 1'b0;
|
global_counter_transfer <= 4'd0;
|
global_counter_transfer <= 4'd0;
|
fct_flag <= fct_flag - 3'd1;
|
fct_flag <= fct_flag - 3'd1;
|
end
|
end
|
end
|
end
|
else if(enable_time_code)
|
else if(enable_time_code)
|
begin
|
begin
|
|
|
|
ready_tx_data <= 1'b0;
|
|
|
//
|
//
|
if(fct_counter_last != fct_counter)
|
if(fct_counter_last != fct_counter)
|
begin
|
begin
|
if(fct_counter == 6'd8 && fct_counter_last == 6'd56)
|
if(fct_counter == 6'd8 && fct_counter_last == 6'd56)
|
begin
|
begin
|
Line 669... |
Line 740... |
global_counter_transfer <= 4'd0;
|
global_counter_transfer <= 4'd0;
|
end
|
end
|
end
|
end
|
else if(enable_n_char)
|
else if(enable_n_char)
|
begin
|
begin
|
|
|
//
|
//
|
if(fct_send_last != fct_send)
|
if(fct_send_last != fct_send)
|
begin
|
begin
|
if(fct_send == 3'd1 && fct_send_last == 3'd7)
|
if(fct_send == 3'd1 && fct_send_last == 3'd7)
|
begin
|
begin
|
Line 684... |
Line 756... |
end
|
end
|
|
|
fct_send_last <= fct_send;
|
fct_send_last <= fct_send;
|
end
|
end
|
|
|
if(global_counter_transfer < 4'd9 && !data_tx_i[8])
|
if(!data_tx_i[8])
|
|
begin
|
|
|
|
if(global_counter_transfer == 4'd9)
|
|
begin
|
|
ready_tx_data <= 1'b1;
|
|
end
|
|
|
|
if(global_counter_transfer != 4'd9)
|
begin
|
begin
|
|
hold_data <= 1'b1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
txdata_flagctrl_tx_last <= data_tx_i;
|
txdata_flagctrl_tx_last <= data_tx_i;
|
end
|
end
|
else if(global_counter_transfer < 4'd3 && data_tx_i[8])
|
else
|
|
begin
|
|
hold_data <= 1'b0;
|
|
global_counter_transfer <= 4'd0;
|
|
//
|
|
if(fct_counter_last != fct_counter)
|
|
begin
|
|
if(fct_counter == 6'd8 && fct_counter_last == 6'd56)
|
begin
|
begin
|
|
fct_counter_receive <= fct_counter_receive + 6'd8 - 6'd1;
|
|
end
|
|
else
|
|
begin
|
|
fct_counter_receive <= fct_counter_receive + (fct_counter - fct_counter_last) - 6'd1;
|
|
end
|
|
|
|
fct_counter_last <= fct_counter;
|
|
end
|
|
else
|
|
begin
|
|
fct_counter_receive <= fct_counter_receive - 6'd1;
|
|
end
|
|
end
|
|
|
|
end
|
|
else if(data_tx_i[8])
|
|
begin
|
|
|
|
if(global_counter_transfer == 4'd3)
|
|
begin
|
|
ready_tx_data <= 1'b1;
|
|
end
|
|
|
|
if(global_counter_transfer != 4'd3)
|
|
begin
|
|
hold_data <= 1'b1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
global_counter_transfer <= global_counter_transfer + 4'd1;
|
txdata_flagctrl_tx_last <= data_tx_i;
|
txdata_flagctrl_tx_last <= data_tx_i;
|
end
|
end
|
else
|
else
|
begin
|
begin
|
|
hold_data <= 1'b0;
|
global_counter_transfer <= 4'd0;
|
global_counter_transfer <= 4'd0;
|
|
//
|
|
if(fct_counter_last != fct_counter)
|
|
begin
|
|
if(fct_counter == 6'd8 && fct_counter_last == 6'd56)
|
|
begin
|
|
fct_counter_receive <= fct_counter_receive + 6'd8 - 6'd1;
|
|
end
|
|
else
|
|
begin
|
|
fct_counter_receive <= fct_counter_receive + (fct_counter - fct_counter_last) - 6'd1;
|
|
end
|
|
|
|
fct_counter_last <= fct_counter;
|
|
end
|
|
else
|
|
begin
|
fct_counter_receive <= fct_counter_receive - 6'd1;
|
fct_counter_receive <= fct_counter_receive - 6'd1;
|
end
|
end
|
end
|
end
|
|
end
|
|
|
|
end
|
|
|
end
|
end
|
end
|
end
|
|
|
endmodule
|
endmodule
|