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

Subversion Repositories ahb_master

[/] [ahb_master/] [trunk/] [src/] [base/] [axi2ahb_cmd.v] - Diff between revs 10 and 14

Only display areas with differences | Details | Blame | View Log

Rev 10 Rev 14
/////////////////////////////////////////////////////////////////////
<##//////////////////////////////////////////////////////////////////
////                                                             ////
////                                                             ////
////  Author: Eyal Hochberg                                      ////
////  Author: Eyal Hochberg                                      ////
////          eyal@provartec.com                                 ////
////          eyal@provartec.com                                 ////
////                                                             ////
////                                                             ////
////  Downloaded from: http://www.opencores.org                  ////
////  Downloaded from: http://www.opencores.org                  ////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
////                                                             ////
////                                                             ////
//// Copyright (C) 2010 Provartec LTD                            ////
//// Copyright (C) 2010 Provartec LTD                            ////
//// www.provartec.com                                           ////
//// www.provartec.com                                           ////
//// info@provartec.com                                          ////
//// info@provartec.com                                          ////
////                                                             ////
////                                                             ////
//// This source file may be used and distributed without        ////
//// This source file may be used and distributed without        ////
//// restriction provided that this copyright statement is not   ////
//// restriction provided that this copyright statement is not   ////
//// removed from the file and that any derivative work contains ////
//// removed from the file and that any derivative work contains ////
//// the original copyright notice and the associated disclaimer.////
//// the original copyright notice and the associated disclaimer.////
////                                                             ////
////                                                             ////
//// This source file is free software; you can redistribute it  ////
//// This source file is free software; you can redistribute it  ////
//// and/or modify it under the terms of the GNU Lesser General  ////
//// and/or modify it under the terms of the GNU Lesser General  ////
//// Public License as published by the Free Software Foundation.////
//// Public License as published by the Free Software Foundation.////
////                                                             ////
////                                                             ////
//// This source is distributed in the hope that it will be      ////
//// This source is distributed in the hope that it will be      ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied  ////
//// useful, but WITHOUT ANY WARRANTY; without even the implied  ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR     ////
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR     ////
//// PURPOSE.  See the GNU Lesser General Public License for more////
//// PURPOSE.  See the GNU Lesser General Public License for more////
//// details. http://www.gnu.org/licenses/lgpl.html              ////
//// details. http://www.gnu.org/licenses/lgpl.html              ////
////                                                             ////
////                                                             ////
/////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////##>
 
 
OUTFILE PREFIX_cmd.v
OUTFILE PREFIX_cmd.v
 
 
INCLUDE def_axi2ahb.txt
INCLUDE def_axi2ahb.txt
 
 
module  PREFIX_cmd (PORTS);
module  PREFIX_cmd (PORTS);
 
 
   input                  clk;
   input                  clk;
   input                  reset;
   input                  reset;
 
 
   port                   AWGROUP_AXI_A;
   port                   AWGROUP_AXI_A;
   port                   ARGROUP_AXI_A;
   port                   ARGROUP_AXI_A;
   input                  GROUP_AHB;
   input                  GROUP_AHB;
 
 
   input                  ahb_finish;
   input                  ahb_finish;
   output                 cmd_empty;
   output                 cmd_empty;
   output                 cmd_read;
   output                 cmd_read;
   output [ID_BITS-1:0]   cmd_id;
   output [ID_BITS-1:0]   cmd_id;
   output [ADDR_BITS-1:0] cmd_addr;
   output [ADDR_BITS-1:0] cmd_addr;
   output [3:0]           cmd_len;
   output [3:0]           cmd_len;
   output [1:0]           cmd_size;
   output [1:0]           cmd_size;
   output                 cmd_err;
   output                 cmd_err;
 
 
 
 
   wire                   AGROUP_AXI_A;
   wire                   AGROUP_AXI_A;
 
 
   wire                   cmd_push;
   wire                   cmd_push;
   wire                   cmd_pop;
   wire                   cmd_pop;
   wire                   cmd_empty;
   wire                   cmd_empty;
   wire                   cmd_full;
   wire                   cmd_full;
   reg                    read;
   reg                    read;
   wire                   err;
   wire                   err;
 
 
 
 
   wire                   wreq, rreq;
   wire                   wreq, rreq;
   wire                   wack, rack;
   wire                   wack, rack;
   wire                   AERR;
   wire                   AERR;
 
 
   assign                 wreq = AWVALID;
   assign                 wreq = AWVALID;
   assign                 rreq = ARVALID;
   assign                 rreq = ARVALID;
   assign                 wack = AWVALID & AWREADY;
   assign                 wack = AWVALID & AWREADY;
   assign                 rack = ARVALID & ARREADY;
   assign                 rack = ARVALID & ARREADY;
 
 
   always @(posedge clk or posedge reset)
   always @(posedge clk or posedge reset)
     if (reset)
     if (reset)
       read <= #FFD 1'b1;
       read <= #FFD 1'b1;
     else if (wreq & (rack | (~rreq)))
     else if (wreq & (rack | (~rreq)))
       read <= #FFD 1'b0;
       read <= #FFD 1'b0;
     else if (rreq & (wack | (~wreq)))
     else if (rreq & (wack | (~wreq)))
       read <= #FFD 1'b1;
       read <= #FFD 1'b1;
 
 
        //command mux
        //command mux
        assign AGROUP_AXI_A = read ? ARGROUP_AXI_A : AWGROUP_AXI_A;
        assign AGROUP_AXI_A = read ? ARGROUP_AXI_A : AWGROUP_AXI_A;
 
 
   assign ARREADY = (~cmd_full) & read;
   assign ARREADY = (~cmd_full) & read;
   assign AWREADY = (~cmd_full) & (~read);
   assign AWREADY = (~cmd_full) & (~read);
 
 
   assign err =
   assign err =
          ((ALEN != 4'd0) &
          ((ALEN != 4'd0) &
           (ALEN != 4'd3) &
           (ALEN != 4'd3) &
           (ALEN != 4'd7) &
           (ALEN != 4'd7) &
           (ALEN != 4'd15)) |
           (ALEN != 4'd15)) |
          (((ASIZE == 2'b01) & (AADDR[0] != 1'b0)) |
          (((ASIZE == 2'b01) & (AADDR[0] != 1'b0)) |
           ((ASIZE == 2'b10) & (AADDR[1:0] != 2'b00)) |
           ((ASIZE == 2'b10) & (AADDR[1:0] != 2'b00)) |
           ((ASIZE == 2'b11) & (AADDR[2:0] != 3'b000)));
           ((ASIZE == 2'b11) & (AADDR[2:0] != 3'b000)));
 
 
 
 
 
 
    assign                    cmd_push  = AVALID & AREADY;
    assign                    cmd_push  = AVALID & AREADY;
    assign                    cmd_pop   = ahb_finish;
    assign                    cmd_pop   = ahb_finish;
 
 
CREATE prgen_fifo.v DEFCMD(SWAP CONST(#FFD) #FFD)
CREATE prgen_fifo.v DEFCMD(SWAP CONST(#FFD) #FFD)
   prgen_fifo #(ID_BITS+ADDR_BITS+4+2+1+1, CMD_DEPTH)
   prgen_fifo #(ID_BITS+ADDR_BITS+4+2+1+1, CMD_DEPTH)
   cmd_fifo(
   cmd_fifo(
            .clk(clk),
            .clk(clk),
            .reset(reset),
            .reset(reset),
            .push(cmd_push),
            .push(cmd_push),
            .pop(cmd_pop),
            .pop(cmd_pop),
            .din({
            .din({
                  AID,
                  AID,
                  AADDR,
                  AADDR,
                  ALEN,
                  ALEN,
                  ASIZE,
                  ASIZE,
                  read,
                  read,
                  err
                  err
                  }
                  }
                 ),
                 ),
            .dout({
            .dout({
                   cmd_id,
                   cmd_id,
                   cmd_addr,
                   cmd_addr,
                   cmd_len,
                   cmd_len,
                   cmd_size,
                   cmd_size,
                   cmd_read,
                   cmd_read,
                   cmd_err
                   cmd_err
                   }
                   }
                  ),
                  ),
            .empty(cmd_empty),
            .empty(cmd_empty),
            .full(cmd_full)
            .full(cmd_full)
            );
            );
 
 
 
 
 
 
endmodule
endmodule
 
 
 
 
 
 

powered by: WebSVN 2.1.0

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