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_registry_resp.v] - Blame information for rev 12

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_registry_resp.v
31
 
32
ITER MX
33
ITER SX
34
 
35
LOOP MX
36
ITER MMX_IDX
37
ENDLOOP MX
38 11 eyalhoc
 
39 2 eyalhoc
 
40
module PREFIX_ic_registry_resp(PORTS);
41
 
42
   input                            clk;
43
   input                            reset;
44
 
45
   port                             MMX_AGROUP_IC_AXI_CMD;
46
 
47 11 eyalhoc
   input [ID_BITS-1:0]              SSX_ID;
48 2 eyalhoc
   input                            SSX_VALID;
49
   input                            SSX_READY;
50
   input                            SSX_LAST;
51 11 eyalhoc
   output [MSTR_BITS-1:0]           SSX_MSTR;
52 2 eyalhoc
   output                           SSX_OK;
53
 
54
 
55
 
56
   wire                             Amatch_MMX_IDMMX_IDX;
57 11 eyalhoc
   wire                             match_SSX_MMX_IDMMX_IDX;
58 2 eyalhoc
   wire                             no_Amatch_MMX;
59
 
60
   wire                             cmd_push_MMX;
61
   wire                             cmd_push_MMX_IDMMX_IDX;
62
 
63
   wire                             cmd_pop_SSX;
64
LOOP MX
65
   wire                             cmd_pop_MMX_IDMMX_IDX;
66
ENDLOOP MX
67
 
68
   wire [SLV_BITS-1:0]   slave_in_MMX_IDMMX_IDX;
69
   wire [SLV_BITS-1:0]   slave_out_MMX_IDMMX_IDX;
70
   wire                             slave_empty_MMX_IDMMX_IDX;
71
   wire                             slave_full_MMX_IDMMX_IDX;
72
 
73
   reg [MSTR_BITS-1:0]   ERR_MSTR_reg;
74
   wire [MSTR_BITS-1:0] ERR_MSTR;
75
 
76
   reg [MSTR_BITS-1:0]   SSX_MSTR;
77
   reg                              SSX_OK;
78
 
79
 
80
 
81
 
82
   assign                           Amatch_MMX_IDMMX_IDX = MMX_AID == ID_MMX_IDMMX_IDX;
83
 
84 11 eyalhoc
   assign                           match_SSX_MMX_IDMMX_IDX = SSX_ID == ID_MMX_IDMMX_IDX;
85 2 eyalhoc
 
86
 
87
   assign                           cmd_push_MMX           = MMX_AVALID & MMX_AREADY;
88
   assign                           cmd_push_MMX_IDMMX_IDX = cmd_push_MMX & Amatch_MMX_IDMMX_IDX;
89
   assign                           cmd_pop_SSX            = SSX_VALID & SSX_READY & SSX_LAST;
90
 
91
   LOOP MX
92 11 eyalhoc
     assign                         cmd_pop_MMX_IDMMX_IDX = CONCAT((cmd_pop_SSX & match_SSX_MMX_IDMMX_IDX) |);
93 2 eyalhoc
   ENDLOOP MX
94
 
95
 
96
   assign                           slave_in_MMX_IDMMX_IDX = MMX_ASLV;
97
 
98
 
99
 
100
 
101
IFDEF DEF_DECERR_SLV
102
   LOOP MX
103
     assign                         no_Amatch_MMX         = CONCAT((~Amatch_MMX_IDMMX_IDX) &);
104
   ENDLOOP MX
105
 
106
 
107
   always @(posedge clk or posedge reset)
108
     if (reset)
109
       ERR_MSTR_reg <= #FFD {MSTR_BITS{1'b0}};
110
   LOOP MX
111
     else if (cmd_push_MMX & no_Amatch_MMX)
112
       ERR_MSTR_reg <= #FFD 'dMX;
113
   ENDLOOP MX
114
 
115
   assign                           ERR_MSTR = ERR_MSTR_reg;
116
ELSE DEF_DECERR_SLV
117
   assign                           ERR_MSTR = 'd0;
118
ENDIF DEF_DECERR_SLV
119
 
120
 
121
LOOP SX
122
   always @(SSX_ID or ERR_MSTR)
123
     begin
124
        case (SSX_ID)
125
          LOOP MX
126
          ID_MMX_IDMMX_IDX : SSX_MSTR = 'dMX;
127
          ENDLOOP MX
128
          default : SSX_MSTR = ERR_MSTR;
129
        endcase
130
     end
131
 
132
   always @(*)
133
     begin
134
        case (SSX_ID)
135
          LOOP MX
136
          ID_MMX_IDMMX_IDX : SSX_OK = slave_out_MMX_IDMMX_IDX == 'dSX;
137
          ENDLOOP MX
138
          default : SSX_OK = 1'b1; //SLVERR                                   
139
        endcase
140
     end
141
ENDLOOP SX
142
 
143
CREATE prgen_fifo.v DEFCMD(SWAP CONST(#FFD) #FFD)
144
LOOP MX
145
LOOP MMX_IDX
146
   prgen_fifo #(SLV_BITS, CMD_DEPTH)
147
   slave_fifo_MMX_IDMMX_IDX(
148
                    .clk(clk),
149
                    .reset(reset),
150
                    .push(cmd_push_MMX_IDMMX_IDX),
151
                    .pop(cmd_pop_MMX_IDMMX_IDX),
152
                    .din(slave_in_MMX_IDMMX_IDX),
153
                    .dout(slave_out_MMX_IDMMX_IDX),
154
                            .empty(slave_empty_MMX_IDMMX_IDX),
155
                            .full(slave_full_MMX_IDMMX_IDX)
156
                    );
157
 
158
ENDLOOP MMX_IDX
159
ENDLOOP MX
160
 
161
 
162
endmodule
163
 
164
 

powered by: WebSVN 2.1.0

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