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

Subversion Repositories wb_to_amba

[/] [wb_to_amba/] [trunk/] [src/] [wb_arm_phase_fsm.v] - Diff between revs 2 and 3

Show entire file | Details | Blame | View Log

Rev 2 Rev 3
Line 4... Line 4...
 
 
`timescale 1ns / 100ps
`timescale 1ns / 100ps
 
 
 
 
 
 
module wb_arm_phase_fsm(
module
 
  wb_arm_phase_fsm(
                          input   ahb_hclk,
                          input   ahb_hclk,
                          input   ahb_hreset,
                          input   ahb_hreset,
                          input   ahb_hsel,
                          input   ahb_hsel,
                          input   ahb_hready_in,
                          input   ahb_hready_in,
                          input   ahb_hready_out,
                          input   ahb_hready_out,
 
    input [1:0] ahb_htrans,
                          output  ahb_data_phase,
                          output  ahb_data_phase,
                          output  fsm_error
                          output  fsm_error
                        );
                        );
 
 
 
  // -----------------------------
 
  //  do_transfer if not IDLE or BUSY
 
  wire do_transfer = (ahb_htrans == 2'b10) | (ahb_htrans == 2'b11);
 
 
 
 
  // -----------------------------
  // -----------------------------
  //  state machine binary definitions
  //  state machine binary definitions
  parameter IDLE_STATE  = 3'b001;
  parameter IDLE_STATE  = 3'b001;
  parameter DATA_STATE  = 3'b010;
  parameter DATA_STATE  = 3'b010;
Line 38... Line 44...
 
 
  // -----------------------------
  // -----------------------------
  //  state machine
  //  state machine
  always @(*)
  always @(*)
    case(state)
    case(state)
      IDLE_STATE:   if( ahb_hsel & ahb_hready_in )
      IDLE_STATE:   if( ahb_hsel & ahb_hready_in & do_transfer)
                      next_state <= DATA_STATE;
                      next_state <= DATA_STATE;
                    else
                    else
                      next_state <= IDLE_STATE;
                      next_state <= IDLE_STATE;
 
 
      DATA_STATE:   if( ahb_hready_out )
      DATA_STATE:   if( ahb_hready_out )
Line 60... Line 66...
  // -----------------------------
  // -----------------------------
  //  outputs
  //  outputs
  assign ahb_data_phase = (state == DATA_STATE);
  assign ahb_data_phase = (state == DATA_STATE);
  assign fsm_error      = (state == ERROR_STATE);
  assign fsm_error      = (state == ERROR_STATE);
 
 
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.