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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [rtl/] [RTL_VB/] [tx_spw.v] - Diff between revs 33 and 34

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 33 Rev 34
Line 607... Line 607...
                end
                end
                else if(fct_flag > 3'd0 && !hold_null && !hold_time_code && !hold_data)
                else if(fct_flag > 3'd0 && !hold_null && !hold_time_code && !hold_data)
                begin
                begin
                        enable_fct  = 1'b1;
                        enable_fct  = 1'b1;
                end
                end
                else if((txwrite_tx && fct_counter_receive > 6'd0 && !hold_null && !hold_time_code && !hold_fct) == 1'b1 )
                else if((txwrite_tx && !ready_tx_data && fct_counter_receive > 6'd0 && !hold_null && !hold_time_code && !hold_fct) == 1'b1 )
                begin
                begin
                        enable_n_char = 1'b1;
                        enable_n_char = 1'b1;
                end
                end
                else
                else
                begin
                begin
Line 721... Line 721...
                last_tx_sout <= tx_sout;
                last_tx_sout <= tx_sout;
 
 
                if(enable_null)
                if(enable_null)
                begin
                begin
 
 
                        ready_tx_data <= 1'b0;
                        //ready_tx_data <= 1'b0;
                        ready_tx_timecode <= 1'b0;
                        ready_tx_timecode <= 1'b0;
                        //hold_null     <= 1'b0;
                        //hold_null     <= 1'b0;
                        hold_fct        <= 1'b0;
                        hold_fct        <= 1'b0;
                        hold_data       <= 1'b0;
                        hold_data       <= 1'b0;
                        hold_time_code  <= 1'b0;
                        hold_time_code  <= 1'b0;
Line 753... Line 753...
                                block_sum_fct_send<= 1'b0;
                                block_sum_fct_send<= 1'b0;
                        end
                        end
                        else
                        else
                                block_sum_fct_send <= block_sum_fct_send;
                                block_sum_fct_send <= block_sum_fct_send;
 
 
 
                        if(global_counter_transfer == 4'd7)
 
                        begin
 
                                hold_null <= 1'b0;
 
                        end
 
                        else
 
                        begin
 
                                hold_null <= 1'b1;
 
                        end
 
 
                        if(first_time)
                        if(first_time)
                        begin
                        begin
                                first_time <= 1'b0;
                                first_time <= 1'b0;
                                hold_null  <= 1'b1;
                                //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;
                                //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;
                                //hold_null <= 1'b0;
 
                                ready_tx_data <= 1'b0;
                                last_type  <= NULL;
                                last_type  <= NULL;
                                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;
                        //ready_tx_data <= 1'b0;
                        ready_tx_timecode <= 1'b0;
                        ready_tx_timecode <= 1'b0;
 
 
                        hold_null       <= 1'b0;
                        hold_null       <= 1'b0;
                        //hold_fct      <= 1'b0;
                        //hold_fct      <= 1'b0;
                        hold_data       <= 1'b0;
                        hold_data       <= 1'b0;
Line 794... Line 804...
                                block_sum<= 1'b0;
                                block_sum<= 1'b0;
                        end
                        end
                        else
                        else
                                block_sum <= block_sum;
                                block_sum <= block_sum;
 
 
 
                        if(global_counter_transfer == 4'd2)
 
                                ready_tx_data <= 1'b0;
 
                        else
 
                                ready_tx_data <= ready_tx_data;
 
 
                        if(global_counter_transfer != 4'd3)
                        if(global_counter_transfer == 4'd3)
 
                        begin
 
                                hold_fct <= 1'b0;
 
                        end
 
                        else
                        begin
                        begin
                                hold_fct <= 1'b1;
                                hold_fct <= 1'b1;
 
                        end
 
 
 
                        if(global_counter_transfer != 4'd3)
 
                        begin
 
                                //hold_fct <= 1'b1;
                                global_counter_transfer <= global_counter_transfer + 4'd1;
                                global_counter_transfer <= global_counter_transfer + 4'd1;
                                //
                                //
                                if(send_fct_now && !block_sum_fct_send)
                                if(send_fct_now && !block_sum_fct_send)
                                begin
                                begin
                                        fct_flag <= fct_send;
                                        fct_flag <= fct_send;
Line 814... Line 837...
                                else
                                else
                                        block_sum_fct_send <= block_sum_fct_send;
                                        block_sum_fct_send <= block_sum_fct_send;
                        end
                        end
                        else
                        else
                        begin
                        begin
                                hold_fct <= 1'b0;
                                //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;
                                last_type  <=FCT;
                                last_type  <=FCT;
                        end
                        end
                end
                end
Line 828... Line 851...
                        hold_null       <= 1'b0;
                        hold_null       <= 1'b0;
                        hold_fct        <= 1'b0;
                        hold_fct        <= 1'b0;
                        hold_data       <= 1'b0;
                        hold_data       <= 1'b0;
                        //hold_time_code        <= 1'b0;
                        //hold_time_code        <= 1'b0;
 
 
                        ready_tx_data <= 1'b0;
                        //ready_tx_data <= 1'b0;
 
 
                        if(gotfct_tx && !block_sum)
                        if(gotfct_tx && !block_sum)
                        begin
                        begin
                                fct_counter_receive <= fct_counter;
                                fct_counter_receive <= fct_counter;
                                block_sum<= 1'b1;
                                block_sum<= 1'b1;
Line 847... Line 870...
                        if(global_counter_transfer == 4'd13)
                        if(global_counter_transfer == 4'd13)
                        begin
                        begin
                                ready_tx_timecode <= 1'b1;
                                ready_tx_timecode <= 1'b1;
                        end
                        end
 
 
 
                        if(global_counter_transfer == 4'd13)
 
                        begin
 
                                hold_time_code <= 1'b0;
 
                        end
 
                        else
 
                        begin
 
                                hold_time_code <= 1'b0;
 
                        end
 
 
                        //
                        //
                        if(send_fct_now && !block_sum_fct_send)
                        if(send_fct_now && !block_sum_fct_send)
                        begin
                        begin
                                fct_flag <= fct_send;
                                fct_flag <= fct_send;
                                block_sum_fct_send<= 1'b1;
                                block_sum_fct_send<= 1'b1;
Line 860... Line 892...
                                block_sum_fct_send<= 1'b0;
                                block_sum_fct_send<= 1'b0;
                        end
                        end
                        else
                        else
                                block_sum_fct_send <= block_sum_fct_send;
                                block_sum_fct_send <= block_sum_fct_send;
 
 
                        if(global_counter_transfer < 4'd13)
                        if(global_counter_transfer != 4'd13)
                        begin
                        begin
                                global_counter_transfer <= global_counter_transfer + 4'd1;
                                global_counter_transfer <= global_counter_transfer + 4'd1;
                                timecode_s <= {timecode_ss[13:10],2'd2,timecode_tx_i[7:0]};
                                timecode_s <= {timecode_ss[13:10],2'd2,timecode_tx_i[7:0]};
                        end
                        end
                        else
                        else
                        begin
                        begin
 
                                ready_tx_data <= 1'b0;
                                last_timein_control_flag_tx <= timecode_tx_i;
                                last_timein_control_flag_tx <= timecode_tx_i;
                                global_counter_transfer <= 4'd0;
                                global_counter_transfer <= 4'd0;
                                last_type  <= TIMEC;
                                last_type  <= TIMEC;
                        end
                        end
                end
                end
Line 898... Line 931...
                        if(!data_tx_i[8])
                        if(!data_tx_i[8])
                        begin
                        begin
 
 
                                if(global_counter_transfer == 4'd9)
                                if(global_counter_transfer == 4'd9)
                                begin
                                begin
 
                                        hold_data <= 1'b0;
                                        ready_tx_data <= 1'b1;
                                        ready_tx_data <= 1'b1;
                                end
                                end
                                else
                                else
                                begin
                                begin
                                        ready_tx_data <= 1'b0;
                                        ready_tx_data <= 1'b0;
 
                                        hold_data <= 1'b1;
                                end
                                end
 
 
                                if(global_counter_transfer != 4'd9)
                                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;
 
 
                                        if(gotfct_tx && !block_sum)
                                        if(gotfct_tx && !block_sum)
                                        begin
                                        begin
Line 925... Line 960...
                                        else
                                        else
                                                block_sum <= block_sum;
                                                block_sum <= block_sum;
                                end
                                end
                                else
                                else
                                begin
                                begin
                                        hold_data <= 1'b0;
 
                                        global_counter_transfer <= 4'd0;
                                        global_counter_transfer <= 4'd0;
                                        fct_counter_receive <= fct_counter_receive - 6'd1;
                                        fct_counter_receive <= fct_counter_receive - 6'd1;
                                        last_type  <= DATA;
                                        last_type  <= DATA;
                                end
                                end
 
 
Line 937... Line 971...
                        else if(data_tx_i[8])
                        else if(data_tx_i[8])
                        begin
                        begin
 
 
                                if(global_counter_transfer == 4'd3)
                                if(global_counter_transfer == 4'd3)
                                begin
                                begin
 
                                        hold_data <= 1'b0;
                                        ready_tx_data <= 1'b1;
                                        ready_tx_data <= 1'b1;
                                end
                                end
                                else
                                else
                                begin
                                begin
 
                                        hold_data <= 1'b1;
                                        ready_tx_data <= 1'b0;
                                        ready_tx_data <= 1'b0;
                                end
                                end
 
 
                                if(global_counter_transfer != 4'd3)
                                if(global_counter_transfer != 4'd3)
                                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 <= txdata_flagctrl_tx_last;
 
 
                                        if(gotfct_tx && !block_sum)
                                        if(gotfct_tx && !block_sum)
                                        begin
                                        begin
                                                fct_counter_receive <= fct_counter;
                                                fct_counter_receive <= fct_counter;
                                                block_sum<= 1'b1;
                                                block_sum<= 1'b1;
Line 964... Line 1000...
                                        else
                                        else
                                                block_sum <= block_sum;
                                                block_sum <= block_sum;
                                end
                                end
                                else
                                else
                                begin
                                begin
 
 
                                        hold_data <= 1'b0;
 
                                        global_counter_transfer <= 4'd0;
                                        global_counter_transfer <= 4'd0;
                                        fct_counter_receive <= fct_counter_receive - 6'd1;
                                        fct_counter_receive <= fct_counter_receive - 6'd1;
 
 
 
                                        if(data_tx_i[1:0] == 2'b00)
 
                                        begin
                                        last_type  <=EOP;
                                        last_type  <=EOP;
                                end
                                end
 
                                        else if(data_tx_i[1:0] == 2'b01)
 
                                        begin
 
                                                last_type  <=EEP;
 
                                        end
 
                                end
                        end
                        end
 
 
                end
                end
 
 
        end
        end

powered by: WebSVN 2.1.0

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