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

Subversion Repositories robust_axi_fabric

[/] [robust_axi_fabric/] [trunk/] [src/] [base/] [ic_decerr.v] - Blame information for rev 11

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 7 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
 
30 2 eyalhoc
OUTFILE PREFIX_ic_decerr.v
31
 
32
module PREFIX_ic_decerr(PORTS);
33
 
34
   input                          clk;
35
   input                          reset;
36
 
37
   input                          AWIDOK;
38
   input                          ARIDOK;
39
   port                           GROUP_IC_AXI;
40
 
41
 
42
   parameter                      RESP_SLVERR = 2'b10;
43
   parameter                      RESP_DECERR = 2'b11;
44
 
45
 
46
   reg                            AWREADY;
47
   reg [ID_BITS-1:0]               BID;
48
   reg [1:0]                       BRESP;
49
   reg                            BVALID;
50
   reg                            ARREADY;
51
   reg [ID_BITS-1:0]               RID;
52
   reg [1:0]                       RRESP;
53
   reg                            RVALID;
54
   reg [4-1:0]             rvalid_cnt;
55
 
56
 
57
   assign                         BUSER = 'd0;
58
   assign                         RUSER = 'd0;
59
   assign                         RDATA = {DATA_BITS{1'b0}};
60
 
61
 
62
   //WRITE
63
   assign                         WREADY = 1'b1;
64
 
65
   always @(posedge clk or posedge reset)
66
     if (reset)
67
       begin
68
          AWREADY <= #FFD 1'b1;
69
          BID     <= #FFD {ID_BITS{1'b0}};
70
          BRESP   <= #FFD 2'b00;
71
       end
72
     else if (BVALID & BREADY)
73
       begin
74
          AWREADY <= #FFD 1'b1;
75
       end
76
     else if (AWVALID & AWREADY)
77
       begin
78
          AWREADY <= #FFD 1'b0;
79
          BID     <= #FFD AWID;
80
          BRESP   <= #FFD AWIDOK ? RESP_DECERR : RESP_SLVERR;
81
       end
82
 
83
   always @(posedge clk or posedge reset)
84
     if (reset)
85
       BVALID <= #FFD 1'b0;
86
     else if (WVALID & WREADY & WLAST)
87
       BVALID <= #FFD 1'b1;
88
     else if (BVALID & BREADY)
89
       BVALID <= #FFD 1'b0;
90
 
91
 
92
   //READ   
93
   always @(posedge clk or posedge reset)
94
     if (reset)
95
       begin
96
          ARREADY <= #FFD 1'b1;
97
          RID     <= #FFD {ID_BITS{1'b0}};
98
          RRESP   <= #FFD 2'b00;
99
       end
100
     else if (RVALID & RREADY & RLAST)
101
       begin
102
          ARREADY <= #FFD 1'b1;
103
       end
104
     else if (ARVALID & ARREADY)
105
       begin
106
          ARREADY <= #FFD 1'b0;
107
          RID     <= #FFD ARID;
108
          RRESP   <= #FFD ARIDOK ? RESP_DECERR : RESP_SLVERR;
109
       end
110
 
111
 
112
   always @(posedge clk or posedge reset)
113
     if (reset)
114
       rvalid_cnt <= #FFD {4{1'b0}};
115
     else if (RVALID & RREADY & RLAST)
116
       rvalid_cnt <= #FFD {4{1'b0}};
117
     else if (RVALID & RREADY)
118
       rvalid_cnt <= #FFD rvalid_cnt - 1'b1;
119
     else if (ARVALID & ARREADY)
120
       rvalid_cnt <= #FFD ARLEN;
121
 
122
 
123
   always @(posedge clk or posedge reset)
124
     if (reset)
125
       RVALID <= #FFD 1'b0;
126
     else if (RVALID & RREADY & RLAST)
127
       RVALID <= #FFD 1'b0;
128
     else if (ARVALID & ARREADY)
129
       RVALID <= #FFD 1'b1;
130
 
131
   assign RLAST = (rvalid_cnt == 'd0) & RVALID;
132
 
133
 
134
 
135
 
136
 
137
 
138
endmodule
139
 
140
 

powered by: WebSVN 2.1.0

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