-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,27 +5,29 @@ | |
// Lorenzo Leone <[email protected]> | ||
|
||
// ## Description: | ||
// A wrapper for `tc_sram_impl` which instantiate logic banks that can be in retentive mode | ||
// or can be turned off. This module can be used for Power Aware simulations and the | ||
// control signals can be driven directly from the UPF signals. | ||
// A wrapper for `tc_sram_impl` that instantiates logic banks with retention mode | ||
// or power-off capability. | ||
// This module can be used for power-aware simulations, with control signals driven | ||
// directly by UPF signals. | ||
// | ||
// ## Goal: | ||
// In a memory with multiple banks and with power gate/retention capabilities, the addressing of | ||
// each bank must be done in such a way that eventual interleaving is not broken. | ||
// During retention or power off, only contiguos addresses should be switched. | ||
// The memory, must be seen always as a set of contiguous addresses, without holes in the mapping. | ||
// In a memory with multiple banks that support power gating and retention, | ||
// each bank’s addressing must ensure that interleaving remains intact. During retention | ||
// or power-off states, only contiguous addresses should be switched. | ||
// The memory should always appear as a set of contiguous addresses, with no gaps in the | ||
// address mapping. | ||
// This module is responsible for managing the correct memory addressing | ||
// | ||
|
||
module mem_multibank_pwrgate #( | ||
parameter int unsigned NumWords = 32'd1024, // Number of Words in data array | ||
parameter int unsigned DataWidth = 32'd128, // Data signal width | ||
parameter int unsigned ByteWidth = 32'd8, // Width of a data byte | ||
parameter int unsigned NumPorts = 32'd2, // Number of read and write ports | ||
parameter int unsigned Latency = 32'd1, // Latency when the read data is available | ||
parameter int unsigned NumLogicBanks = 32'd1, // Logic bank for Power Management | ||
parameter SimInit = "none", // Simulation initialization | ||
parameter bit PrintSimCfg = 1'b0, // Print configuration | ||
parameter ImplKey = "none", // Reference to specific implementation | ||
parameter int unsigned NumWords = 32'd1024, // Number of Words in data array | ||
Check warning on line 22 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L22
Raw output
|
||
parameter int unsigned DataWidth = 32'd128, // Data signal width | ||
Check warning on line 23 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L23
Raw output
|
||
parameter int unsigned ByteWidth = 32'd8, // Width of a data byte | ||
Check warning on line 24 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L24
Raw output
|
||
parameter int unsigned NumPorts = 32'd2, // Number of read and write ports | ||
Check warning on line 25 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L25
Raw output
|
||
parameter int unsigned Latency = 32'd1, // Latency when the read data is available | ||
Check warning on line 26 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L26
Raw output
|
||
parameter int unsigned NumLogicBanks = 32'd1, // Logic bank for Power Management | ||
Check warning on line 27 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L27
Raw output
|
||
parameter SimInit = "none", // Simulation initialization | ||
Check warning on line 28 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L28
Raw output
Check warning on line 28 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L28
Raw output
|
||
parameter bit PrintSimCfg = 1'b0, // Print configuration | ||
Check warning on line 29 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L29
Raw output
|
||
parameter ImplKey = "none", // Reference to specific implementation | ||
Check warning on line 30 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L30
Raw output
Check warning on line 30 in src/mem_multibank_pwrgate.sv GitHub Actions / verible-verilog-lint[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L30
Raw output
|
||
// DEPENDENT PARAMETERS, DO NOT OVERWRITE! | ||
parameter int unsigned AddrWidth = (NumWords > 32'd1) ? $clog2(NumWords) : 32'd1, | ||
parameter int unsigned BeWidth = (DataWidth + ByteWidth - 32'd1) / ByteWidth, // ceil_div | ||
|
@@ -186,8 +188,10 @@ module mem_multibank_pwrgate #( | |
`ifndef VERILATOR | ||
`ifndef TARGET_SYNTHESIS | ||
initial begin | ||
assert (!$isunknown(deepsleep_i)) else $warning("deepsleep_i has some unconnected signals"); | ||
assert (!$isunknown(powergate_i)) else $warning("powergate_i has some unconnected signals"); | ||
assert (!$isunknown(deepsleep_i)) | ||
else $warning("deepsleep_i has some unconnected signals"); | ||
assert (!$isunknown(powergate_i)) | ||
else $warning("powergate_i has some unconnected signals"); | ||
end | ||
`endif | ||
`endif | ||
|