Skip to content

Commit

Permalink
Update comment to describe moduole functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
Lore0599 committed Oct 28, 2024
1 parent c9f1d74 commit b66b441
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions src/mem_multibank_pwrgate.sv
Original file line number Diff line number Diff line change
Expand Up @@ -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

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L22

Line length exceeds max: 100; is: 114 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 114 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:22  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
parameter int unsigned DataWidth = 32'd128, // Data signal width

Check warning on line 23 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L23

Line length exceeds max: 100; is: 102 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 102 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:23  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
parameter int unsigned ByteWidth = 32'd8, // Width of a data byte

Check warning on line 24 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L24

Line length exceeds max: 100; is: 105 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 105 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:24  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
parameter int unsigned NumPorts = 32'd2, // Number of read and write ports

Check warning on line 25 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L25

Line length exceeds max: 100; is: 115 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 115 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:25  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
parameter int unsigned Latency = 32'd1, // Latency when the read data is available

Check warning on line 26 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L26

Line length exceeds max: 100; is: 124 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 124 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:26  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
parameter int unsigned NumLogicBanks = 32'd1, // Logic bank for Power Management

Check warning on line 27 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L27

Line length exceeds max: 100; is: 116 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 116 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:27  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
parameter SimInit = "none", // Simulation initialization

Check warning on line 28 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L28

Explicitly define a storage type for every parameter and localparam, (SimInit). [Style: constants] [explicit-parameter-storage-type]
Raw output
message:"Explicitly define a storage type for every parameter and localparam, (SimInit). [Style: constants] [explicit-parameter-storage-type]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:28  column:28}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}

Check warning on line 28 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L28

Line length exceeds max: 100; is: 110 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 110 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:28  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
parameter bit PrintSimCfg = 1'b0, // Print configuration

Check warning on line 29 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L29

Line length exceeds max: 100; is: 104 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 104 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:29  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
parameter ImplKey = "none", // Reference to specific implementation

Check warning on line 30 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L30

Explicitly define a storage type for every parameter and localparam, (ImplKey). [Style: constants] [explicit-parameter-storage-type]
Raw output
message:"Explicitly define a storage type for every parameter and localparam, (ImplKey). [Style: constants] [explicit-parameter-storage-type]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:30  column:28}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}

Check warning on line 30 in src/mem_multibank_pwrgate.sv

View workflow job for this annotation

GitHub Actions / verible-verilog-lint

[verible-verilog-lint] src/mem_multibank_pwrgate.sv#L30

Line length exceeds max: 100; is: 121 [Style: line-length] [line-length]
Raw output
message:"Line length exceeds max: 100; is: 121 [Style: line-length] [line-length]"  location:{path:"./src/mem_multibank_pwrgate.sv"  range:{start:{line:30  column:101}}}  severity:WARNING  source:{name:"verible-verilog-lint"  url:"https://github.com/chipsalliance/verible"}
// 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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b66b441

Please sign in to comment.