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_wr.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_registry_wr.v
31 7 eyalhoc
 
32 2 eyalhoc
ITER MX
33
ITER SX
34
 
35
LOOP MX
36
ITER MMX_IDX
37
ENDLOOP MX
38
 
39
module PREFIX_ic_registry_wr(PORTS);
40
 
41
 
42
 
43
   input                            clk;
44
   input                            reset;
45
 
46
   port                             MMX_AWGROUP_IC_AXI_CMD;
47
 
48
   input [ID_BITS-1:0]  MMX_WID;
49
   input                            MMX_WVALID;
50
   input                            MMX_WREADY;
51
   input                            MMX_WLAST;
52
   output [SLV_BITS-1:0] MMX_WSLV;
53
   output                           MMX_WOK;
54
 
55
   input                            SSX_AWVALID;
56
   input                            SSX_AWREADY;
57
   input [MSTR_BITS-1:0] SSX_AWMSTR;
58
   input                            SSX_WVALID;
59
   input                            SSX_WREADY;
60
   input                            SSX_WLAST;
61
 
62
 
63
   wire                             AWmatch_MMX_IDMMX_IDX;
64
   wire                             Wmatch_MMX_IDMMX_IDX;
65
 
66
   wire                             cmd_push_MMX;
67
   wire                             cmd_push_MMX_IDMMX_IDX;
68
 
69
   wire                             cmd_pop_MMX;
70
   wire                             cmd_pop_MMX_IDMMX_IDX;
71
 
72
   wire [SLV_BITS-1:0]   slave_in_MMX_IDMMX_IDX;
73
   wire [SLV_BITS-1:0]   slave_out_MMX_IDMMX_IDX;
74
   wire                             slave_empty_MMX_IDMMX_IDX;
75
   wire                             slave_full_MMX_IDMMX_IDX;
76
 
77
   wire                             cmd_push_SSX;
78
   wire                             cmd_pop_SSX;
79
   wire [MSTR_BITS-1:0] master_in_SSX;
80
   wire [MSTR_BITS-1:0] master_out_SSX;
81
   wire                             master_empty_SSX;
82
   wire                             master_full_SSX;
83
 
84
   reg [SLV_BITS-1:0]    MMX_WSLV;
85
   reg                              MMX_WOK;
86
 
87
 
88
 
89
 
90
   assign                           AWmatch_MMX_IDMMX_IDX  = MMX_AWID == ID_MMX_IDMMX_IDX;
91
 
92
   assign                           Wmatch_MMX_IDMMX_IDX   = MMX_WID == ID_MMX_IDMMX_IDX;
93
 
94
 
95
   assign                           cmd_push_MMX           = MMX_AWVALID & MMX_AWREADY;
96
   assign                           cmd_push_MMX_IDMMX_IDX = cmd_push_MMX & AWmatch_MMX_IDMMX_IDX;
97
   assign                           cmd_pop_MMX            = MMX_WVALID & MMX_WREADY & MMX_WLAST;
98
   assign                           cmd_pop_MMX_IDMMX_IDX  = cmd_pop_MMX & Wmatch_MMX_IDMMX_IDX;
99
 
100
   assign                           cmd_push_SSX           = SSX_AWVALID & SSX_AWREADY;
101
   assign                           cmd_pop_SSX            = SSX_WVALID & SSX_WREADY & SSX_WLAST;
102
   assign                           master_in_SSX          = SSX_AWMSTR;
103
 
104
   assign                           slave_in_MMX_IDMMX_IDX = MMX_AWSLV;
105
 
106
 
107
   LOOP MX
108
   always @(MMX_WID
109
            or slave_out_MMX_IDMMX_IDX
110
            )
111
     begin
112
        case (MMX_WID)
113
          ID_MMX_IDMMX_IDX : MMX_WSLV = slave_out_MMX_IDMMX_IDX;
114
          default : MMX_WSLV = SERR;
115
        endcase
116
     end
117
 
118
   always @(MMX_WSLV
119
            or master_out_SSX
120
            )
121
     begin
122
        case (MMX_WSLV)
123
          'dSX : MMX_WOK = master_out_SSX == 'dMX;
124
          default : MMX_WOK = 1'b0;
125
        endcase
126
     end
127
 
128
   ENDLOOP MX
129
 
130
LOOP MX
131
LOOP MMX_IDX
132
   prgen_fifo #(SLV_BITS, CMD_DEPTH)
133
   slave_fifo_MMX_IDMMX_IDX(
134
                    .clk(clk),
135
                    .reset(reset),
136
                    .push(cmd_push_MMX_IDMMX_IDX),
137
                    .pop(cmd_pop_MMX_IDMMX_IDX),
138
                    .din(slave_in_MMX_IDMMX_IDX),
139
                    .dout(slave_out_MMX_IDMMX_IDX),
140
                            .empty(slave_empty_MMX_IDMMX_IDX),
141
                            .full(slave_full_MMX_IDMMX_IDX)
142
                    );
143
 
144
   ENDLOOP MMX_IDX
145
   ENDLOOP MX
146
 
147
 
148
 
149
   LOOP SX
150
   prgen_fifo #(MSTR_BITS, 32)
151
   master_fifo_SSX(
152
                   .clk(clk),
153
                   .reset(reset),
154
                   .push(cmd_push_SSX),
155
                   .pop(cmd_pop_SSX),
156
                   .din(master_in_SSX),
157
                   .dout(master_out_SSX),
158
                   .empty(master_empty_SSX),
159
                   .full(master_full_SSX)
160
                   );
161
 
162
   ENDLOOP SX
163
 
164
endmodule
165
 
166
 

powered by: WebSVN 2.1.0

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