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

Subversion Repositories spacewiresystemc

[/] [spacewiresystemc/] [trunk/] [rtl/] [RTL_VB/] [fsm_spw.v] - Diff between revs 18 and 25

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

Rev 18 Rev 25
Line 127... Line 127...
 
 
                if(rx_error | rx_got_fct | rx_got_nchar | rx_got_time_code)
                if(rx_error | rx_got_fct | rx_got_nchar | rx_got_time_code)
                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)))
                else if((!link_disable) & (link_start |(auto_start && rx_got_null)))
                begin
                begin
                        next_state_fsm = started;
                        next_state_fsm = started;
                end
                end
 
 
        end
        end
Line 140... Line 140...
 
 
                if(rx_error | rx_got_fct | rx_got_nchar | rx_got_time_code | after128us == 12'd1279 )
                if(rx_error | rx_got_fct | rx_got_nchar | rx_got_time_code | 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)
                else if(rx_got_null & rx_got_bit)
                begin
                begin
                        next_state_fsm = connecting;
                        next_state_fsm = connecting;
                end
                end
 
 
        end
        end
Line 206... Line 206...
                end
                end
                run:
                run:
                begin
                begin
                end
                end
                endcase
                endcase
 
 
        end
        end
end
end
 
 
always@(posedge pclk)
always@(posedge pclk)
begin
begin
Line 218... Line 219...
        begin
        begin
                after128us <= 12'd0;
                after128us <= 12'd0;
        end
        end
        else
        else
        begin
        begin
                if(state_fsm == error_wait | state_fsm == started | state_fsm == connecting)
 
 
                if(next_state_fsm == connecting && state_fsm == started)
 
                begin
 
                        after128us <= 12'd0;
 
                end
 
                else if(state_fsm == error_wait || state_fsm == started || state_fsm == connecting)
                begin
                begin
                        if(after128us < 12'd1279)
                        if(after128us < 12'd1279)
                                after128us <= after128us + 12'd1;
                                after128us <= after128us + 12'd1;
                        else
                        else
                                after128us <= 12'd0;
                                after128us <= 12'd0;
Line 266... Line 272...
        begin
        begin
                after850ns <= 12'd0;
                after850ns <= 12'd0;
        end
        end
        else
        else
        begin
        begin
 
                if(state_fsm != run)
 
                begin
 
                        after850ns <= 12'd0;
 
                end
 
                else
 
                begin
                if(rx_got_bit)
                if(rx_got_bit)
                begin
                begin
                        after850ns <= 12'd0;
                        after850ns <= 12'd0;
                end
                end
                else
                else
Line 278... Line 290...
                                after850ns <= after850ns + 12'd1;
                                after850ns <= after850ns + 12'd1;
                        else
                        else
                                after850ns <= 12'd0;
                                after850ns <= 12'd0;
                end
                end
        end
        end
 
        end
 
 
end
end
 
 
endmodule
endmodule
 
 
 No newline at end of file
 No newline at end of file

powered by: WebSVN 2.1.0

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