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 2

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

Line No. Rev Author Line
1 2 eyalhoc
OUTFILE PREFIX_ic_registry_wr.v
2
ITER MX
3
ITER SX
4
 
5
LOOP MX
6
ITER MMX_IDX
7
ENDLOOP MX
8
 
9
module PREFIX_ic_registry_wr(PORTS);
10
 
11
 
12
 
13
   input                            clk;
14
   input                            reset;
15
 
16
   port                             MMX_AWGROUP_IC_AXI_CMD;
17
 
18
   input [ID_BITS-1:0]  MMX_WID;
19
   input                            MMX_WVALID;
20
   input                            MMX_WREADY;
21
   input                            MMX_WLAST;
22
   output [SLV_BITS-1:0] MMX_WSLV;
23
   output                           MMX_WOK;
24
 
25
   input                            SSX_AWVALID;
26
   input                            SSX_AWREADY;
27
   input [MSTR_BITS-1:0] SSX_AWMSTR;
28
   input                            SSX_WVALID;
29
   input                            SSX_WREADY;
30
   input                            SSX_WLAST;
31
 
32
 
33
   wire                             AWmatch_MMX_IDMMX_IDX;
34
   wire                             Wmatch_MMX_IDMMX_IDX;
35
 
36
   wire                             cmd_push_MMX;
37
   wire                             cmd_push_MMX_IDMMX_IDX;
38
 
39
   wire                             cmd_pop_MMX;
40
   wire                             cmd_pop_MMX_IDMMX_IDX;
41
 
42
   wire [SLV_BITS-1:0]   slave_in_MMX_IDMMX_IDX;
43
   wire [SLV_BITS-1:0]   slave_out_MMX_IDMMX_IDX;
44
   wire                             slave_empty_MMX_IDMMX_IDX;
45
   wire                             slave_full_MMX_IDMMX_IDX;
46
 
47
   wire                             cmd_push_SSX;
48
   wire                             cmd_pop_SSX;
49
   wire [MSTR_BITS-1:0] master_in_SSX;
50
   wire [MSTR_BITS-1:0] master_out_SSX;
51
   wire                             master_empty_SSX;
52
   wire                             master_full_SSX;
53
 
54
   reg [SLV_BITS-1:0]    MMX_WSLV;
55
   reg                              MMX_WOK;
56
 
57
 
58
 
59
 
60
   assign                           AWmatch_MMX_IDMMX_IDX  = MMX_AWID == ID_MMX_IDMMX_IDX;
61
 
62
   assign                           Wmatch_MMX_IDMMX_IDX   = MMX_WID == ID_MMX_IDMMX_IDX;
63
 
64
 
65
   assign                           cmd_push_MMX           = MMX_AWVALID & MMX_AWREADY;
66
   assign                           cmd_push_MMX_IDMMX_IDX = cmd_push_MMX & AWmatch_MMX_IDMMX_IDX;
67
   assign                           cmd_pop_MMX            = MMX_WVALID & MMX_WREADY & MMX_WLAST;
68
   assign                           cmd_pop_MMX_IDMMX_IDX  = cmd_pop_MMX & Wmatch_MMX_IDMMX_IDX;
69
 
70
   assign                           cmd_push_SSX           = SSX_AWVALID & SSX_AWREADY;
71
   assign                           cmd_pop_SSX            = SSX_WVALID & SSX_WREADY & SSX_WLAST;
72
   assign                           master_in_SSX          = SSX_AWMSTR;
73
 
74
   assign                           slave_in_MMX_IDMMX_IDX = MMX_AWSLV;
75
 
76
 
77
   LOOP MX
78
   always @(MMX_WID
79
            or slave_out_MMX_IDMMX_IDX
80
            )
81
     begin
82
        case (MMX_WID)
83
          ID_MMX_IDMMX_IDX : MMX_WSLV = slave_out_MMX_IDMMX_IDX;
84
          default : MMX_WSLV = SERR;
85
        endcase
86
     end
87
 
88
   always @(MMX_WSLV
89
            or master_out_SSX
90
            )
91
     begin
92
        case (MMX_WSLV)
93
          'dSX : MMX_WOK = master_out_SSX == 'dMX;
94
          default : MMX_WOK = 1'b0;
95
        endcase
96
     end
97
 
98
   ENDLOOP MX
99
 
100
LOOP MX
101
LOOP MMX_IDX
102
   prgen_fifo #(SLV_BITS, CMD_DEPTH)
103
   slave_fifo_MMX_IDMMX_IDX(
104
                    .clk(clk),
105
                    .reset(reset),
106
                    .push(cmd_push_MMX_IDMMX_IDX),
107
                    .pop(cmd_pop_MMX_IDMMX_IDX),
108
                    .din(slave_in_MMX_IDMMX_IDX),
109
                    .dout(slave_out_MMX_IDMMX_IDX),
110
                            .empty(slave_empty_MMX_IDMMX_IDX),
111
                            .full(slave_full_MMX_IDMMX_IDX)
112
                    );
113
 
114
   ENDLOOP MMX_IDX
115
   ENDLOOP MX
116
 
117
 
118
 
119
   LOOP SX
120
   prgen_fifo #(MSTR_BITS, 32)
121
   master_fifo_SSX(
122
                   .clk(clk),
123
                   .reset(reset),
124
                   .push(cmd_push_SSX),
125
                   .pop(cmd_pop_SSX),
126
                   .din(master_in_SSX),
127
                   .dout(master_out_SSX),
128
                   .empty(master_empty_SSX),
129
                   .full(master_full_SSX)
130
                   );
131
 
132
   ENDLOOP SX
133
 
134
endmodule
135
 
136
 

powered by: WebSVN 2.1.0

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