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

Subversion Repositories robust_axi2apb

[/] [robust_axi2apb/] [trunk/] [src/] [base/] [axi2apb_rd.v] - Blame information for rev 13

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 13 eyalhoc
<##//////////////////////////////////////////////////////////////////
2
////                                                             ////
3
////  Author: Eyal Hochberg                                      ////
4
////          eyal@provartec.com                                 ////
5
////                                                             ////
6
////  Downloaded from: http://www.opencores.org                  ////
7
/////////////////////////////////////////////////////////////////////
8
////                                                             ////
9
//// Copyright (C) 2010 Provartec LTD                            ////
10
//// www.provartec.com                                           ////
11
//// info@provartec.com                                          ////
12
////                                                             ////
13
//// This source file may be used and distributed without        ////
14
//// restriction provided that this copyright statement is not   ////
15
//// removed from the file and that any derivative work contains ////
16
//// the original copyright notice and the associated disclaimer.////
17
////                                                             ////
18
//// This source file is free software; you can redistribute it  ////
19
//// and/or modify it under the terms of the GNU Lesser General  ////
20
//// Public License as published by the Free Software Foundation.////
21
////                                                             ////
22
//// This source is distributed in the hope that it will be      ////
23
//// useful, but WITHOUT ANY WARRANTY; without even the implied  ////
24
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR     ////
25
//// PURPOSE.  See the GNU Lesser General Public License for more////
26
//// details. http://www.gnu.org/licenses/lgpl.html              ////
27
////                                                             ////
28
//////////////////////////////////////////////////////////////////##>
29 4 eyalhoc
 
30 2 eyalhoc
INCLUDE def_axi2apb.txt
31 8 eyalhoc
OUTFILE PREFIX_rd.v
32 2 eyalhoc
 
33 8 eyalhoc
module  PREFIX_rd (PORTS);
34 2 eyalhoc
 
35
   input                          clk;
36
   input                          reset;
37
 
38
   input                  GROUP_APB3;
39
 
40
   input                  cmd_err;
41
   input [ID_BITS-1:0]    cmd_id;
42
   output                 finish_rd;
43
 
44
   port                   RGROUP_APB_AXI_R;
45
 
46
 
47
   parameter              RESP_OK     = 2'b00;
48
   parameter              RESP_SLVERR = 2'b10;
49
   parameter              RESP_DECERR = 2'b11;
50
 
51
   reg                    RGROUP_APB_AXI_R.OUT;
52
 
53
 
54
   assign                 finish_rd = RVALID & RREADY & RLAST;
55
 
56
   always @(posedge clk or posedge reset)
57
     if (reset)
58
           begin
59
         RGROUP_APB_AXI_R.OUT <= #FFD {GROUP_APB_AXI_R.OUT.WIDTH{1'b0}};
60
           end
61
         else if (finish_rd)
62
           begin
63
         RGROUP_APB_AXI_R.OUT <= #FFD {GROUP_APB_AXI_R.OUT.WIDTH{1'b0}};
64
           end
65
         else if (psel & penable & (~pwrite) & pready)
66
           begin
67
             RID    <= #FFD cmd_id;
68
                 RDATA  <= #FFD prdata;
69
                 RRESP  <= #FFD cmd_err ? RESP_SLVERR : pslverr ? RESP_DECERR : RESP_OK;
70
                 RLAST  <= #FFD 1'b1;
71
                 RVALID <= #FFD 1'b1;
72
           end
73
 
74
endmodule
75
 
76
 

powered by: WebSVN 2.1.0

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