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

Subversion Repositories xgate

[/] [xgate/] [trunk/] [rtl/] [verilog/] [xgate_wbm_bus.v] - Diff between revs 34 and 53

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

Rev 34 Rev 53
Line 55... Line 55...
  input                    wbs_rst_i,     // synchronous active high reset
  input                    wbs_rst_i,     // synchronous active high reset
  input                    arst_i,        // asynchronous reset
  input                    arst_i,        // asynchronous reset
  // XGATE Control Signals
  // XGATE Control Signals
  output      [DWIDTH-1:0] read_mem_data,    // Data from system memory
  output      [DWIDTH-1:0] read_mem_data,    // Data from system memory
  output                   mem_req_ack,      // Memory bus transaction complete
  output                   mem_req_ack,      // Memory bus transaction complete
 
  input                    risc_clk,         //
 
  input                    async_rst_b,      //
  input                    xge,              // XGATE Enabled
  input                    xge,              // XGATE Enabled
 
  input                    single_step,      // Pulse to trigger a single instruction execution in debug mode
 
  output                   ss_mem_ack,       // WISHBONE Bus has granted single step memory access
  input             [15:0] xgate_address,    // Address to system memory
  input             [15:0] xgate_address,    // Address to system memory
  input                    mem_access,       // 
  input                    mem_access,       // 
  input                    write_mem_strb_l, // Strobe for writing low data byte
  input                    write_mem_strb_l, // Strobe for writing low data byte
  input                    write_mem_strb_h, // Strobe for writing high data bye
  input                    write_mem_strb_h, // Strobe for writing high data bye
  input       [DWIDTH-1:0] write_mem_data    // Data to system memory
  input       [DWIDTH-1:0] write_mem_data    // Data to system memory
  );
  );
 
 
 
 
  // Wires and Registers
  // Wires and Registers
  wire   module_sel;       // This module is selected for bus transaction
  wire   module_sel;       // This module is selected for bus transaction
 
  reg    ss_mem_req;       // Bus request for single step memory access
 
 
  //
  //
  // Module body
  // Module body
  //
  //
 
 
 
  // Latch Single Step Request and ask for memory access
 
  always @(posedge risc_clk or negedge async_rst_b)
 
    if ( !async_rst_b )
 
      ss_mem_req <= 1'b0;
 
    else
 
      ss_mem_req <= (single_step || ss_mem_req) && !wbm_ack_i && xge;
 
 
 
  assign ss_mem_ack = ss_mem_req && wbm_ack_i;
 
 
 
 
  assign wbm_dat_o = write_mem_data;
  assign wbm_dat_o = write_mem_data;
  assign read_mem_data = wbm_dat_i;
  assign read_mem_data = wbm_dat_i;
  assign wbm_adr_o = xgate_address;
  assign wbm_adr_o = xgate_address;
 
 
  assign mem_req_ack = wbm_ack_i;
  assign mem_req_ack = wbm_ack_i;
 
 
  assign wbm_we_o = write_mem_strb_h || write_mem_strb_l;
  assign wbm_we_o = write_mem_strb_h || write_mem_strb_l;
 
 
  assign wbm_sel_o = {write_mem_strb_h, write_mem_strb_l};
  assign wbm_sel_o = {write_mem_strb_h, write_mem_strb_l};
 
 
  assign wbm_cyc_o = xge && mem_access;
  assign wbm_cyc_o = xge && (mem_access || ss_mem_req);
 
 
  assign wbm_stb_o = xge && mem_access;
  assign wbm_stb_o = xge && (mem_access || ss_mem_req);
 
 
endmodule  // xgate_wbm_bus
endmodule  // xgate_wbm_bus
 
 
 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.