blob: 2efacb8e0bb3051e08b9490c178e1f10c6ebe0e2 [file] [log] [blame]
agorararmard6c766a82020-12-10 18:13:12 +02001// SPDX-FileCopyrightText: 2020 Efabless Corporation
agorararmarde5780bf2020-12-09 21:27:56 +00002//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
agorararmardafa96ea2020-12-09 23:37:31 +020014// SPDX-License-Identifier: Apache-2.0
agorararmarde5780bf2020-12-09 21:27:56 +000015
Matt Venn08cd6eb2020-11-16 12:01:14 +010016`default_nettype none
Manar14f7ca02020-10-30 11:58:16 +020017
Manarffe6cad2020-11-09 19:09:04 +020018module storage (
19 // MGMT_AREA R/W Interface
Manar14f7ca02020-10-30 11:58:16 +020020 input mgmt_clk,
Manarffe6cad2020-11-09 19:09:04 +020021 input [`RAM_BLOCKS-1:0] mgmt_ena,
22 input [`RAM_BLOCKS-1:0] mgmt_wen, // not shared
23 input [(`RAM_BLOCKS*4)-1:0] mgmt_wen_mask, // not shared
Manar14f7ca02020-10-30 11:58:16 +020024 input [7:0] mgmt_addr,
25 input [31:0] mgmt_wdata,
Manarffe6cad2020-11-09 19:09:04 +020026 output [(`RAM_BLOCKS*32)-1:0] mgmt_rdata,
Manar14f7ca02020-10-30 11:58:16 +020027
Manarffe6cad2020-11-09 19:09:04 +020028 // MGMT_AREA RO Interface
29 input mgmt_ena_ro,
30 input [7:0] mgmt_addr_ro,
31 output [31:0] mgmt_rdata_ro
Manar14f7ca02020-10-30 11:58:16 +020032);
Manarffe6cad2020-11-09 19:09:04 +020033 sram_1rw1r_32_256_8_sky130 SRAM_0 (
Manar14f7ca02020-10-30 11:58:16 +020034 // MGMT R/W port
35 .clk0(mgmt_clk),
Manarffe6cad2020-11-09 19:09:04 +020036 .csb0(mgmt_ena[0]),
37 .web0(mgmt_wen[0]),
38 .wmask0(mgmt_wen_mask[3:0]),
39 .addr0(mgmt_addr),
Manar14f7ca02020-10-30 11:58:16 +020040 .din0(mgmt_wdata),
Manarffe6cad2020-11-09 19:09:04 +020041 .dout0(mgmt_rdata[31:0]),
Manar14f7ca02020-10-30 11:58:16 +020042 // MGMT RO port
43 .clk1(mgmt_clk),
Manarffe6cad2020-11-09 19:09:04 +020044 .csb1(mgmt_ena_ro),
45 .addr1(mgmt_addr_ro),
46 .dout1(mgmt_rdata_ro)
47 );
48
49 sram_1rw1r_32_256_8_sky130 SRAM_1 (
50 // MGMT R/W port
51 .clk0(mgmt_clk),
52 .csb0(mgmt_ena[1]),
53 .web0(mgmt_wen[1]),
54 .wmask0(mgmt_wen_mask[7:4]),
55 .addr0(mgmt_addr),
56 .din0(mgmt_wdata),
57 .dout0(mgmt_rdata[63:32])
58 );
59
Tim Edwards581068f2020-11-19 12:45:25 -050060endmodule
61`default_nettype wire