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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [rtl/] [RTL_VB/] [fsm_spw.v] - Diff between revs 37 and 40

Show entire file | Details | Blame | View Log

Rev 37 Rev 40
Line 75... Line 75...
        reg [11:0] after64us;
        reg [11:0] after64us;
        reg [11:0] after850ns;
        reg [11:0] after850ns;
 
 
        reg got_bit_internal;
        reg got_bit_internal;
 
 
 
        reg get_rx_got_fct_a, get_rx_got_fct_b;
 
        reg get_rx_error_a, get_rx_error_b;
 
        reg get_rx_got_null_a, get_rx_got_null_b;
 
 
 
        reg get_rx_got_nchar_a, get_rx_got_nchar_b;
 
        reg get_rx_got_time_code_a, get_rx_got_time_code_b;
 
        reg get_rx_credit_error_a, get_rx_credit_error_b;
 
 
//
//
assign fsm_state    = state_fsm;
assign fsm_state    = state_fsm;
 
 
always@(*)
always@(*)
begin
begin
Line 104... Line 112...
 
 
                if(after128us == 12'd1279)
                if(after128us == 12'd1279)
                begin
                begin
                        next_state_fsm = ready;
                        next_state_fsm = ready;
                end
                end
                else if(rx_error | rx_got_fct | rx_got_nchar | rx_got_time_code)
                else if(get_rx_error_a | get_rx_got_fct_a | get_rx_got_nchar_a | rx_got_time_code)
                begin
                begin
                        next_state_fsm = error_reset;
                        next_state_fsm = error_reset;
                end
                end
 
 
        end
        end
        ready:
        ready:
        begin
        begin
 
 
                if(rx_error | rx_got_fct | rx_got_nchar | rx_got_time_code)
                if(get_rx_error_a | get_rx_got_fct_a | get_rx_got_nchar_a | get_rx_got_time_code_a)
                begin
                begin
                        next_state_fsm = error_reset;
                        next_state_fsm = error_reset;
                end
                end
                else if(((!link_disable) & (link_start |(auto_start & rx_got_null)))==1'b1)
                else if(((!link_disable) & (link_start |(auto_start & get_rx_got_null_a)))==1'b1)
                begin
                begin
                        next_state_fsm = started;
                        next_state_fsm = started;
                end
                end
 
 
        end
        end
        started:
        started:
        begin
        begin
 
 
                if(rx_error | rx_got_fct | rx_got_nchar | rx_got_time_code | after128us == 12'd1279)
                if(get_rx_error_a | get_rx_got_fct_a | get_rx_got_nchar_a | get_rx_got_time_code_a | after128us == 12'd1279)
                begin
                begin
                        next_state_fsm = error_reset;
                        next_state_fsm = error_reset;
                end
                end
                else if((rx_got_null & rx_got_bit)== 1'b1)
                else if((get_rx_got_null_a & rx_got_bit)== 1'b1)
                begin
                begin
                        next_state_fsm = connecting;
                        next_state_fsm = connecting;
                end
                end
 
 
        end
        end
        connecting:
        connecting:
        begin
        begin
 
 
                if(rx_error | rx_got_nchar | rx_got_time_code | after128us == 12'd1279)
                if(get_rx_error_a | get_rx_got_nchar_a | get_rx_got_time_code_a | after128us == 12'd1279)
                begin
                begin
                        next_state_fsm = error_reset;
                        next_state_fsm = error_reset;
                end
                end
                else if(rx_got_fct)
                else if(get_rx_got_fct_a)
                begin
                begin
                        next_state_fsm = run;
                        next_state_fsm = run;
                end
                end
 
 
        end
        end
        run:
        run:
        begin
        begin
 
 
                if(rx_error | rx_credit_error | link_disable  | after850ns == 12'd85)
                if(get_rx_error_a | get_rx_credit_error_a | link_disable  | after850ns == 12'd85)
                begin
                begin
                        next_state_fsm = error_reset;
                        next_state_fsm = error_reset;
                end
                end
                else
                else
                begin
                begin
Line 176... Line 184...
                rx_resetn <= 1'b0;
                rx_resetn <= 1'b0;
 
 
                enable_tx<= 1'b0;
                enable_tx<= 1'b0;
                send_null_tx<= 1'b0;
                send_null_tx<= 1'b0;
                send_fct_tx<= 1'b0;
                send_fct_tx<= 1'b0;
 
 
 
                get_rx_got_fct_a  <= 1'b0;
 
                get_rx_got_fct_b  <= 1'b0;
 
                get_rx_error_a    <= 1'b0;
 
                get_rx_error_b    <= 1'b0;
 
                get_rx_got_null_a <= 1'b0;
 
                get_rx_got_null_b <= 1'b0;
 
 
 
 
 
                get_rx_got_nchar_a     <= 1'b0;
 
                get_rx_got_nchar_b     <= 1'b0;
 
                get_rx_got_time_code_a <= 1'b0;
 
                get_rx_got_time_code_b <= 1'b0;
 
                get_rx_credit_error_a  <= 1'b0;
 
                get_rx_credit_error_b  <= 1'b0;
 
 
        end
        end
        else
        else
        begin
        begin
 
 
 
                get_rx_got_fct_b <= rx_got_fct;
 
                get_rx_got_fct_a <= get_rx_got_fct_b;
 
 
 
                get_rx_error_b <= rx_error;
 
                get_rx_error_a <= get_rx_error_b;
 
 
 
                get_rx_got_null_b <= rx_got_null;
 
                get_rx_got_null_a <= get_rx_got_null_b;
 
 
 
                get_rx_got_nchar_b <= rx_got_nchar;
 
                get_rx_got_nchar_a <= get_rx_got_nchar_b;
 
 
 
                get_rx_got_time_code_b <= rx_got_time_code;
 
                get_rx_got_time_code_a <= get_rx_got_time_code_b;
 
 
 
                get_rx_credit_error_b <= rx_credit_error;
 
                get_rx_credit_error_a <= get_rx_credit_error_b;
 
 
                state_fsm <= next_state_fsm;
                state_fsm <= next_state_fsm;
 
 
                case(state_fsm)
                case(state_fsm)
                error_reset:
                error_reset:
                begin
                begin

powered by: WebSVN 2.1.0

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