agorararmard | 6c766a8 | 2020-12-10 18:13:12 +0200 | [diff] [blame] | 1 | // SPDX-FileCopyrightText: 2020 Efabless Corporation |
agorararmard | e5780bf | 2020-12-09 21:27:56 +0000 | [diff] [blame] | 2 | // |
| 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. |
agorararmard | afa96ea | 2020-12-09 23:37:31 +0200 | [diff] [blame] | 14 | // SPDX-License-Identifier: Apache-2.0 |
agorararmard | e5780bf | 2020-12-09 21:27:56 +0000 | [diff] [blame] | 15 | |
Matt Venn | 08cd6eb | 2020-11-16 12:01:14 +0100 | [diff] [blame] | 16 | `default_nettype none |
Manar | 14f7ca0 | 2020-10-30 11:58:16 +0200 | [diff] [blame] | 17 | |
Manar | ffe6cad | 2020-11-09 19:09:04 +0200 | [diff] [blame] | 18 | module storage ( |
| 19 | // MGMT_AREA R/W Interface |
Manar | 14f7ca0 | 2020-10-30 11:58:16 +0200 | [diff] [blame] | 20 | input mgmt_clk, |
Manar | ffe6cad | 2020-11-09 19:09:04 +0200 | [diff] [blame] | 21 | 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 |
Manar | 14f7ca0 | 2020-10-30 11:58:16 +0200 | [diff] [blame] | 24 | input [7:0] mgmt_addr, |
| 25 | input [31:0] mgmt_wdata, |
Manar | ffe6cad | 2020-11-09 19:09:04 +0200 | [diff] [blame] | 26 | output [(`RAM_BLOCKS*32)-1:0] mgmt_rdata, |
Manar | 14f7ca0 | 2020-10-30 11:58:16 +0200 | [diff] [blame] | 27 | |
Manar | ffe6cad | 2020-11-09 19:09:04 +0200 | [diff] [blame] | 28 | // MGMT_AREA RO Interface |
| 29 | input mgmt_ena_ro, |
| 30 | input [7:0] mgmt_addr_ro, |
| 31 | output [31:0] mgmt_rdata_ro |
Manar | 14f7ca0 | 2020-10-30 11:58:16 +0200 | [diff] [blame] | 32 | ); |
Manar | ffe6cad | 2020-11-09 19:09:04 +0200 | [diff] [blame] | 33 | sram_1rw1r_32_256_8_sky130 SRAM_0 ( |
Manar | 14f7ca0 | 2020-10-30 11:58:16 +0200 | [diff] [blame] | 34 | // MGMT R/W port |
| 35 | .clk0(mgmt_clk), |
Manar | ffe6cad | 2020-11-09 19:09:04 +0200 | [diff] [blame] | 36 | .csb0(mgmt_ena[0]), |
| 37 | .web0(mgmt_wen[0]), |
| 38 | .wmask0(mgmt_wen_mask[3:0]), |
| 39 | .addr0(mgmt_addr), |
Manar | 14f7ca0 | 2020-10-30 11:58:16 +0200 | [diff] [blame] | 40 | .din0(mgmt_wdata), |
Manar | ffe6cad | 2020-11-09 19:09:04 +0200 | [diff] [blame] | 41 | .dout0(mgmt_rdata[31:0]), |
Manar | 14f7ca0 | 2020-10-30 11:58:16 +0200 | [diff] [blame] | 42 | // MGMT RO port |
| 43 | .clk1(mgmt_clk), |
Manar | ffe6cad | 2020-11-09 19:09:04 +0200 | [diff] [blame] | 44 | .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 Edwards | 581068f | 2020-11-19 12:45:25 -0500 | [diff] [blame] | 60 | endmodule |
| 61 | `default_nettype wire |