Skip to content

Commit 766fa7c

Browse files
committed
Apply PR comments:
- [Lint]: Waive linting check on string datat type declaration - [HW]: Re-introduce IF to check design parameters
1 parent 9286fa0 commit 766fa7c

File tree

2 files changed

+14
-25
lines changed

2 files changed

+14
-25
lines changed

lint/common_cells.style.waiver

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ waive --rule=typedef-structs-unions --line=29 --location="src/ecc_encode.sv"
44
# That is a known issue with string parameter in Synopsys DC
55
waive --rule=explicit-parameter-storage-type --line=19 --location="src/stream_arbiter.sv"
66
waive --rule=explicit-parameter-storage-type --line=19 --location="src/stream_arbiter_flushable.sv"
7+
waive --rule=explicit-parameter-storage-type --line=29 --location="src/mem_multibank_pwrgate.sv.sv"
8+
waive --rule=explicit-parameter-storage-type --line=31 --location="src/mem_multibank_pwrgate.sv.sv"
79
waive --rule=always-ff-non-blocking --line=290 --location="src/clk_int_div.sv"
810
waive --rule=always-ff-non-blocking --line=293 --location="src/clk_int_div.sv"
911
waive --rule=always-ff-non-blocking --line=302 --location="src/clk_int_div.sv"

src/mem_multibank_pwrgate.sv

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ module mem_multibank_pwrgate #(
2626
parameter int unsigned NumPorts = 32'd2, // Number of read and write ports
2727
parameter int unsigned Latency = 32'd1, // Latency when the read data is available
2828
parameter int unsigned NumLogicBanks = 32'd1, // Logic bank for Power Management
29-
parameter string SimInit = "none", // Simulation initialization
29+
parameter SimInit = "none", // Simulation initialization
3030
parameter bit PrintSimCfg = 1'b0, // Print configuration
31-
parameter string ImplKey = "none", // Reference to specific implementation
31+
parameter ImplKey = "none", // Reference to specific implementation
3232
// DEPENDENT PARAMETERS, DO NOT OVERWRITE!
3333
parameter int unsigned AddrWidth = (NumWords > 32'd1) ? $clog2(NumWords) : 32'd1,
3434
parameter int unsigned BeWidth = (DataWidth + ByteWidth - 32'd1) / ByteWidth, // ceil_div
@@ -89,14 +89,16 @@ module mem_multibank_pwrgate #(
8989
localparam int unsigned BankSelWidth = (NumLogicBanks > 32'd1) ?
9090
$clog2(NumLogicBanks) : 32'd1;
9191

92+
if (LogicBankSize != 2 ** (AddrWidth - BankSelWidth))
93+
$error("Logic Bank size is not a power of two: UNSUPPORTED!");
9294

9395
// Signals from/to logic banks
94-
logic [NumLogicBanks-1:0][ NumPorts-1:0] req_cut;
95-
logic [NumLogicBanks-1:0][ NumPorts-1:0] we_cut;
96-
logic [NumLogicBanks-1:0][ NumPorts-1:0][AddrWidth-BankSelWidth-1:0] addr_cut;
97-
data_t [NumLogicBanks-1:0][ NumPorts-1:0] wdata_cut;
98-
be_t [NumLogicBanks-1:0][ NumPorts-1:0] be_cut;
99-
data_t [NumLogicBanks-1:0][ NumPorts-1:0] rdata_cut;
96+
logic [NumLogicBanks-1:0][NumPorts-1:0] req_cut;
97+
logic [NumLogicBanks-1:0][NumPorts-1:0] we_cut;
98+
logic [NumLogicBanks-1:0][NumPorts-1:0][AddrWidth-BankSelWidth-1:0] addr_cut;
99+
data_t [NumLogicBanks-1:0][NumPorts-1:0] wdata_cut;
100+
be_t [NumLogicBanks-1:0][NumPorts-1:0] be_cut;
101+
data_t [NumLogicBanks-1:0][NumPorts-1:0] rdata_cut;
100102

101103
// Signals to select the right bank
102104
logic [NumPorts-1:0][BankSelWidth-1:0] bank_sel;
@@ -135,16 +137,6 @@ module mem_multibank_pwrgate #(
135137
end else begin
136138
out_mux_sel_q <= out_mux_sel_d;
137139
end
138-
139-
// for (int PortIdx = 0; PortIdx < NumPorts; PortIdx++) begin
140-
// if (!rst_ni) begin
141-
// out_mux_sel_q[PortIdx] <= '0;
142-
// end else begin
143-
// for (int shift_idx = 0; shift_idx < Latency; shift_idx++) begin
144-
// out_mux_sel_q[PortIdx][shift_idx] <= out_mux_sel_d[PortIdx][shift_idx];
145-
// end
146-
// end
147-
// end
148140
end
149141
end : gen_read_latency
150142

@@ -188,11 +180,6 @@ module mem_multibank_pwrgate #(
188180
.rdata_o(rdata_cut[BankIdx])
189181
);
190182
end : gen_logic_bank
191-
`ifndef COMMON_CELLS_ASSERTS_OFF
192-
`ASSERT_INIT(pwr2_bank, LogicBankSize == 2 ** (AddrWidth - BankSelWidth),
193-
"Logic Bank size is not a power of two: UNSUPPORTED!")
194-
`endif
195-
196183
end
197184

198185
// Trigger warnings when power signals (deepsleep_i and powergate_i) are not connected.
@@ -201,9 +188,9 @@ module mem_multibank_pwrgate #(
201188
`ifndef SYNTHESIS
202189
initial begin
203190
assert (!$isunknown(deepsleep_i))
204-
else $warning("deepsleep_i has some unconnected signals");
191+
else $warning("deepsleep_i has some unconnected signals");
205192
assert (!$isunknown(powergate_i))
206-
else $warning("powergate_i has some unconnected signals");
193+
else $warning("powergate_i has some unconnected signals");
207194
end
208195
`endif
209196
`endif

0 commit comments

Comments
 (0)