Skip to content

Commit

Permalink
adding ACK pwr gate in mem wrapper, fixing pwr manager APPs (#549)
Browse files Browse the repository at this point in the history
  • Loading branch information
davideschiavone committed Jul 22, 2024
1 parent dab270b commit 3d4de8e
Show file tree
Hide file tree
Showing 28 changed files with 709 additions and 585 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sim-apps-job/test_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BColors:
# Blacklist of apps to skip
blacklist = [
"example_spi_read",
"example_spi_host_dma_power_gate",
"example_spidma_powergate",
"example_spi_write",
]

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ run_verif_rtl_log.txt
# ignore the following hw automatically generated files
environment.yml
core-v-mini-mcu.upf
core-v-mini-mcu.dc.upf
tb/tb_util.svh
hw/core-v-mini-mcu/include/core_v_mini_mcu_pkg.sv
hw/core-v-mini-mcu/system_bus.sv
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ mcu-gen:
$(PYTHON) util/mcu_gen.py --config $(X_HEEP_CFG) --cfg_peripherals $(MCU_CFG_PERIPHERALS) --pads_cfg $(PAD_CFG) --outdir sw/device/lib/runtime --cpu $(CPU) --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_domains $(EXTERNAL_DOMAINS) --header-c sw/device/lib/runtime/core_v_mini_mcu.h.tpl
$(PYTHON) util/mcu_gen.py --config $(X_HEEP_CFG) --cfg_peripherals $(MCU_CFG_PERIPHERALS) --pads_cfg $(PAD_CFG) --outdir sw/linker --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --linker_script sw/linker/link.ld.tpl
$(PYTHON) util/mcu_gen.py --config $(X_HEEP_CFG) --cfg_peripherals $(MCU_CFG_PERIPHERALS) --pads_cfg $(PAD_CFG) --outdir . --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --pkg-sv ./core-v-mini-mcu.upf.tpl
$(PYTHON) util/mcu_gen.py --config $(X_HEEP_CFG) --cfg_peripherals $(MCU_CFG_PERIPHERALS) --pads_cfg $(PAD_CFG) --outdir . --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --pkg-sv ./core-v-mini-mcu.dc.upf.tpl
$(PYTHON) util/mcu_gen.py --config $(X_HEEP_CFG) --cfg_peripherals $(MCU_CFG_PERIPHERALS) --pads_cfg $(PAD_CFG) --outdir hw/ip/power_manager/rtl --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_domains $(EXTERNAL_DOMAINS) --pkg-sv hw/ip/power_manager/data/power_manager.sv.tpl
$(PYTHON) util/mcu_gen.py --config $(X_HEEP_CFG) --cfg_peripherals $(MCU_CFG_PERIPHERALS) --pads_cfg $(PAD_CFG) --outdir hw/ip/power_manager/data --bus $(BUS) --memorybanks $(MEMORY_BANKS) --memorybanks_il $(MEMORY_BANKS_IL) --external_domains $(EXTERNAL_DOMAINS) --pkg-sv hw/ip/power_manager/data/power_manager.hjson.tpl
bash -c "cd hw/ip/power_manager; source power_manager_gen.sh; cd ../../../"
Expand Down
4 changes: 2 additions & 2 deletions configs/example_interleaved.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
name: code
start: 0
// minimum size for freeRTOS and clang
size: 0x00000C800
size: 0x00000D800
},
{
name: data
start: 0x00000C800
start: 0x00000D800
}
]
}
4 changes: 2 additions & 2 deletions configs/general.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
name: code
start: 0
#minimum size for freeRTOS and clang
size: 0x00000C800
size: 0x00000D800
},
{
name: data
start: 0x00000C800
start: 0x00000D800
}
]
}
7 changes: 7 additions & 0 deletions core-v-mini-mcu.core
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ parameters:
datatype: bool
paramtype: vlogdefine
default: false
FPGA_SYNTHESIS:
datatype: bool
paramtype: vlogdefine
default: false
FPGA_NEXYS:
datatype: bool
paramtype: vlogdefine
Expand Down Expand Up @@ -421,6 +425,7 @@ targets:
- X_EXT
- SYNTHESIS=true
- REMOVE_OBI_FIFO
- FPGA_SYNTHESIS=true
- FPGA_NEXYS=true
tools:
vivado:
Expand All @@ -442,6 +447,7 @@ targets:
- X_EXT
- SYNTHESIS=true
- REMOVE_OBI_FIFO
- FPGA_SYNTHESIS=true
tools:
vivado:
part: xc7z020clg400-1
Expand All @@ -462,6 +468,7 @@ targets:
- X_EXT
- SYNTHESIS=true
- REMOVE_OBI_FIFO
- FPGA_SYNTHESIS=true
- FPGA_ZCU104=true
tools:
vivado:
Expand Down
159 changes: 159 additions & 0 deletions core-v-mini-mcu.dc.upf.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
upf_version 2.1

set_design_top core_v_mini_mcu
set_scope .


<%text>
#####################
## POWER DOMAINS ##
#####################
</%text>\

create_power_domain PD_TOP -include_scope
create_power_domain PD_CPU -elements {cpu_subsystem_i}
create_power_domain PD_PERIP_SUBS -elements {peripheral_subsystem_i}
% for bank in xheep.iter_ram_banks():
create_power_domain PD_MEM_BANK_${bank.name()} -elements {memory_subsystem_i/ram${bank.name()}_i}
% endfor


<%text>
####################
## POWER STATES ##
####################
</%text>\

add_power_state PD_TOP.primary -state TOP_ON <%text>\</%text>
{-supply_expr {power == `{FULL_ON, 1.2} && ground == `{FULL_ON, 0.0}}}

add_power_state PD_CPU.primary -state CPU_ON <%text>\</%text>
{-supply_expr {power == `{FULL_ON, 1.2} && ground == `{FULL_ON, 0.0}}}

add_power_state PD_CPU.primary -state CPU_OFF <%text>\</%text>
{-supply_expr {power == `{OFF} && ground == `{FULL_ON, 0.0}}} -simstate CORRUPT

add_power_state PD_PERIP_SUBS.primary -state PERIP_SUBS_ON <%text>\</%text>
{-supply_expr {power == `{FULL_ON, 1.2} && ground == `{FULL_ON, 0.0}}}

add_power_state PD_PERIP_SUBS.primary -state PERIP_SUBS_OFF <%text>\</%text>
{-supply_expr {power == `{OFF} && ground == `{FULL_ON, 0.0}}} -simstate CORRUPT

% for bank in xheep.iter_ram_banks():
add_power_state PD_MEM_BANK_${bank.name()}.primary -state MEM_BANK_${bank.name()}_ON <%text>\</%text>
{-supply_expr {power == `{FULL_ON, 1.2} && ground == `{FULL_ON, 0.0}}}

add_power_state PD_MEM_BANK_${bank.name()}.primary -state MEM_BANK_${bank.name()}_OFF <%text>\</%text>
{-supply_expr {power == `{OFF} && ground == `{FULL_ON, 0.0}}} -simstate CORRUPT

% endfor

<%text>
###################
## SUPPLY NETS ##
###################
</%text>\

create_supply_port VDD -direction in
create_supply_port VSS -direction in

create_supply_net VDD
create_supply_net VSS

connect_supply_net VDD -ports VDD
connect_supply_net VSS -ports VSS

create_supply_set PD_TOP.primary -function {power VDD} -function {ground VSS} -update

create_supply_net VDD_CPU
create_supply_set PD_CPU.primary -function {power VDD_CPU} -function {ground VSS} -update

create_supply_net VDD_PERIP_SUBS
create_supply_set PD_PERIP_SUBS.primary -function {power VDD_PERIP_SUBS} -function {ground VSS} -update

% for bank in xheep.iter_ram_banks():
create_supply_net VDD_MEM_BANK_${bank.name()}
create_supply_set PD_MEM_BANK_${bank.name()}.primary -function {power VDD_MEM_BANK_${bank.name()}} -function {ground VSS} -update

% endfor

<%text>
################
## SWITCHES ##
################
</%text>\

create_power_switch switch_PD_CPU <%text>\</%text>
-supply_set PD_TOP.primary <%text>\</%text>
-domain PD_CPU <%text>\</%text>
-input_supply_port {sw_in VDD} <%text>\</%text>
-output_supply_port {sw_out VDD_CPU} <%text>\</%text>
-control_port {sw_ctrl ao_peripheral_subsystem_i/cpu_subsystem_pwr_ctrl_o<%text>\</%text>[pwrgate_en_n<%text>\</%text>]} <%text>\</%text>
-ack_port {sw_ack ao_peripheral_subsystem_i/cpu_subsystem_pwr_ctrl_i<%text>\</%text>[pwrgate_ack_n<%text>\</%text>]} <%text>\</%text>
-on_state {on_state sw_in {sw_ctrl}} <%text>\</%text>
-off_state {off_state {!sw_ctrl}}

create_power_switch switch_PD_PERIP_SUBS <%text>\</%text>
-supply_set PD_TOP.primary <%text>\</%text>
-domain PD_PERIP_SUBS <%text>\</%text>
-input_supply_port {sw_in VDD} <%text>\</%text>
-output_supply_port {sw_out VDD_PERIP_SUBS} <%text>\</%text>
-control_port {sw_ctrl ao_peripheral_subsystem_i/peripheral_subsystem_pwr_ctrl_o<%text>\</%text>[pwrgate_en_n<%text>\</%text>]} <%text>\</%text>
-ack_port {sw_ack ao_peripheral_subsystem_i/peripheral_subsystem_pwr_ctrl_i<%text>\</%text>[pwrgate_ack_n<%text>\</%text>]} <%text>\</%text>
-on_state {on_state sw_in {sw_ctrl}} <%text>\</%text>
-off_state {off_state {!sw_ctrl}}

% for bank in xheep.iter_ram_banks():
create_power_switch switch_PD_MEM_BANK_${bank.name()} <%text>\</%text>
-supply_set PD_TOP.primary <%text>\</%text>
-domain PD_MEM_BANK_${bank.name()} <%text>\</%text>
-input_supply_port {sw_in VDD} <%text>\</%text>
-output_supply_port {sw_out VDD_MEM_BANK_${bank.name()}} <%text>\</%text>
-control_port {sw_ctrl ao_peripheral_subsystem_i/memory_subsystem_pwr_ctrl_o[${bank.name()}]<%text>\</%text>[pwrgate_en_n<%text>\</%text>]} <%text>\</%text>
-ack_port {sw_ack ao_peripheral_subsystem_i/memory_subsystem_pwr_ctrl_i[${bank.name()}]<%text>\</%text>[pwrgate_ack_n<%text>\</%text>]} <%text>\</%text>
-on_state {on_state sw_in {sw_ctrl}} <%text>\</%text>
-off_state {off_state {!sw_ctrl}}

% endfor

<%text>
#################
## ISOLATION ##
#################
</%text>\

set_isolation cpu_iso <%text>\</%text>
-domain PD_CPU <%text>\</%text>
-isolation_power_net VDD <%text>\</%text>
-isolation_ground_net VSS <%text>\</%text>
-isolation_signal ao_peripheral_subsystem_i/cpu_subsystem_pwr_ctrl_o<%text>\</%text>[isogate_en_n<%text>\</%text>] <%text>\</%text>
-isolation_sense low <%text>\</%text>
-clamp_value 0 <%text>\</%text>
-applies_to outputs <%text>\</%text>
-name_prefix cpu_iso_cell <%text>\</%text>
-location parent

set_isolation perip_subs_iso <%text>\</%text>
-domain PD_PERIP_SUBS <%text>\</%text>
-isolation_power_net VDD <%text>\</%text>
-isolation_ground_net VSS <%text>\</%text>
-isolation_signal ao_peripheral_subsystem_i/peripheral_subsystem_pwr_ctrl_o<%text>\</%text>[isogate_en_n<%text>\</%text>] <%text>\</%text>
-isolation_sense low <%text>\</%text>
-clamp_value 0 <%text>\</%text>
-applies_to outputs <%text>\</%text>
-name_prefix cpu_iso_cell <%text>\</%text>
-location parent

% for bank in xheep.iter_ram_banks():
set_isolation mem_bank_${bank.name()}_iso <%text>\</%text>
-domain PD_MEM_BANK_${bank.name()} <%text>\</%text>
-isolation_power_net VDD <%text>\</%text>
-isolation_ground_net VSS <%text>\</%text>
-isolation_signal ao_peripheral_subsystem_i/memory_subsystem_pwr_ctrl_o[${bank.name()}]<%text>\</%text>[isogate_en_n<%text>\</%text>] <%text>\</%text>
-isolation_sense low <%text>\</%text>
-clamp_value 0 <%text>\</%text>
-elements {memory_subsystem_i/ram${bank.name()}_i/rdata_o} <%text>\</%text>
-name_prefix cpu_iso_cell <%text>\</%text>
-location parent

% endfor
6 changes: 3 additions & 3 deletions core-v-mini-mcu.upf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ create_power_switch switch_PD_MEM_BANK_${bank.name()} <%text>\</%text>
-domain PD_MEM_BANK_${bank.name()} <%text>\</%text>
-input_supply_port {sw_in VDD} <%text>\</%text>
-output_supply_port {sw_out VDD_MEM_BANK_${bank.name()}} <%text>\</%text>
-control_port {sw_ctrl memory_subsystem_banks_powergate_switch_no[${bank.name()}]} <%text>\</%text>
-ack_port {sw_ack memory_subsystem_banks_powergate_switch_ack_ni[${bank.name()}]} <%text>\</%text>
-control_port {sw_ctrl memory_subsystem_banks_powergate_switch_n[${bank.name()}]} <%text>\</%text>
-ack_port {sw_ack memory_subsystem_i.ram${bank.name()}_i.pwrgate_ack_no} <%text>\</%text>
-on_state {on_state sw_in {sw_ctrl}} <%text>\</%text>
-off_state {off_state {!sw_ctrl}}

Expand Down Expand Up @@ -152,7 +152,7 @@ set_isolation mem_bank_${bank.name()}_iso <%text>\</%text>
-isolation_signal memory_subsystem_banks_powergate_iso_n[${bank.name()}] <%text>\</%text>
-isolation_sense low <%text>\</%text>
-clamp_value 0 <%text>\</%text>
-applies_to outputs <%text>\</%text>
-elements {memory_subsystem_i/ram${bank.name()}_i/rdata_o} <%text>\</%text>
-name_prefix cpu_iso_cell <%text>\</%text>
-location parent

Expand Down
21 changes: 8 additions & 13 deletions hw/core-v-mini-mcu/core_v_mini_mcu.sv
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,6 @@ module core_v_mini_mcu
input logic cpu_subsystem_powergate_switch_ack_ni,
output logic peripheral_subsystem_powergate_switch_no,
input logic peripheral_subsystem_powergate_switch_ack_ni,
output logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_switch_no,
input logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_switch_ack_ni,
output logic [EXT_DOMAINS_RND-1:0] external_subsystem_powergate_switch_no,
input logic [EXT_DOMAINS_RND-1:0] external_subsystem_powergate_switch_ack_ni,
output logic [EXT_DOMAINS_RND-1:0] external_subsystem_powergate_iso_no,
Expand Down Expand Up @@ -421,6 +419,8 @@ module core_v_mini_mcu
logic peripheral_subsystem_powergate_iso_n;
logic peripheral_subsystem_clkgate_en_n;

logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_switch_n;
logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_switch_ack_n;
logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_set_retentive_n;
logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_iso_n;
logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_clkgate_en_n;
Expand All @@ -440,16 +440,14 @@ module core_v_mini_mcu
assign peripheral_subsystem_rst_n = peripheral_subsystem_pwr_ctrl_out.rst_n;
assign peripheral_subsystem_clkgate_en_n = peripheral_subsystem_pwr_ctrl_out.clkgate_en_n;

//pwrgate exposed both outside and inside to deal with memories with embedded SLEEP mode or external PWR cells
assign memory_subsystem_banks_powergate_switch_no[0] = memory_subsystem_pwr_ctrl_out[0].pwrgate_en_n;
assign memory_subsystem_pwr_ctrl_in[0].pwrgate_ack_n = memory_subsystem_banks_powergate_switch_ack_ni[0];
assign memory_subsystem_banks_powergate_switch_n[0] = memory_subsystem_pwr_ctrl_out[0].pwrgate_en_n;
assign memory_subsystem_pwr_ctrl_in[0].pwrgate_ack_n = memory_subsystem_banks_powergate_switch_ack_n[0];
//isogate exposed outside for UPF sim flow and switch cells
assign memory_subsystem_banks_powergate_iso_n[0] = memory_subsystem_pwr_ctrl_out[0].isogate_en_n;
assign memory_subsystem_banks_set_retentive_n[0] = memory_subsystem_pwr_ctrl_out[0].retentive_en_n;
assign memory_subsystem_clkgate_en_n[0] = memory_subsystem_pwr_ctrl_out[0].clkgate_en_n;
//pwrgate exposed both outside and inside to deal with memories with embedded SLEEP mode or external PWR cells
assign memory_subsystem_banks_powergate_switch_no[1] = memory_subsystem_pwr_ctrl_out[1].pwrgate_en_n;
assign memory_subsystem_pwr_ctrl_in[1].pwrgate_ack_n = memory_subsystem_banks_powergate_switch_ack_ni[1];
assign memory_subsystem_banks_powergate_switch_n[1] = memory_subsystem_pwr_ctrl_out[1].pwrgate_en_n;
assign memory_subsystem_pwr_ctrl_in[1].pwrgate_ack_n = memory_subsystem_banks_powergate_switch_ack_n[1];
//isogate exposed outside for UPF sim flow and switch cells
assign memory_subsystem_banks_powergate_iso_n[1] = memory_subsystem_pwr_ctrl_out[1].isogate_en_n;
assign memory_subsystem_banks_set_retentive_n[1] = memory_subsystem_pwr_ctrl_out[1].retentive_en_n;
Expand Down Expand Up @@ -610,11 +608,8 @@ module core_v_mini_mcu
.clk_gate_en_ni(memory_subsystem_clkgate_en_n),
.ram_req_i(ram_slave_req),
.ram_resp_o(ram_slave_resp),
/*
the memory_subsystem_banks_powergate_switch_no gets wired both internally
and externally to support both macros that have and do not have SLEEP capabilities integrated in the macros
*/
.pwrgate_ni(memory_subsystem_banks_powergate_switch_no),
.pwrgate_ni(memory_subsystem_banks_powergate_switch_n),
.pwrgate_ack_no(memory_subsystem_banks_powergate_switch_ack_n),
.set_retentive_ni(memory_subsystem_banks_set_retentive_n)
);

Expand Down
16 changes: 6 additions & 10 deletions hw/core-v-mini-mcu/core_v_mini_mcu.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ ${pad.core_v_mini_mcu_interface}
input logic cpu_subsystem_powergate_switch_ack_ni,
output logic peripheral_subsystem_powergate_switch_no,
input logic peripheral_subsystem_powergate_switch_ack_ni,
output logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_switch_no,
input logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_switch_ack_ni,
output logic [EXT_DOMAINS_RND-1:0] external_subsystem_powergate_switch_no,
input logic [EXT_DOMAINS_RND-1:0] external_subsystem_powergate_switch_ack_ni,
output logic [EXT_DOMAINS_RND-1:0] external_subsystem_powergate_iso_no,
Expand Down Expand Up @@ -175,6 +173,8 @@ ${pad.core_v_mini_mcu_interface}
logic peripheral_subsystem_powergate_iso_n;
logic peripheral_subsystem_clkgate_en_n;

logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_switch_n;
logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_switch_ack_n;
logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_set_retentive_n;
logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_banks_powergate_iso_n;
logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] memory_subsystem_clkgate_en_n;
Expand All @@ -195,9 +195,8 @@ ${pad.core_v_mini_mcu_interface}
assign peripheral_subsystem_clkgate_en_n = peripheral_subsystem_pwr_ctrl_out.clkgate_en_n;

% for bank in xheep.iter_ram_banks():
//pwrgate exposed both outside and inside to deal with memories with embedded SLEEP mode or external PWR cells
assign memory_subsystem_banks_powergate_switch_no[${bank.name()}] = memory_subsystem_pwr_ctrl_out[${bank.name()}].pwrgate_en_n;
assign memory_subsystem_pwr_ctrl_in[${bank.name()}].pwrgate_ack_n = memory_subsystem_banks_powergate_switch_ack_ni[${bank.name()}];
assign memory_subsystem_banks_powergate_switch_n[${bank.name()}] = memory_subsystem_pwr_ctrl_out[${bank.name()}].pwrgate_en_n;
assign memory_subsystem_pwr_ctrl_in[${bank.name()}].pwrgate_ack_n = memory_subsystem_banks_powergate_switch_ack_n[${bank.name()}];
//isogate exposed outside for UPF sim flow and switch cells
assign memory_subsystem_banks_powergate_iso_n[${bank.name()}] = memory_subsystem_pwr_ctrl_out[${bank.name()}].isogate_en_n;
assign memory_subsystem_banks_set_retentive_n[${bank.name()}] = memory_subsystem_pwr_ctrl_out[${bank.name()}].retentive_en_n;
Expand Down Expand Up @@ -359,11 +358,8 @@ ${pad.core_v_mini_mcu_interface}
.clk_gate_en_ni(memory_subsystem_clkgate_en_n),
.ram_req_i(ram_slave_req),
.ram_resp_o(ram_slave_resp),
/*
the memory_subsystem_banks_powergate_switch_no gets wired both internally
and externally to support both macros that have and do not have SLEEP capabilities integrated in the macros
*/
.pwrgate_ni(memory_subsystem_banks_powergate_switch_no),
.pwrgate_ni(memory_subsystem_banks_powergate_switch_n),
.pwrgate_ack_no(memory_subsystem_banks_powergate_switch_ack_n),
.set_retentive_ni(memory_subsystem_banks_set_retentive_n)
);

Expand Down
2 changes: 2 additions & 0 deletions hw/core-v-mini-mcu/memory_subsystem.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module memory_subsystem

// power manager signals that goes to the ASIC macros
input logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] pwrgate_ni,
output logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] pwrgate_ack_no,
input logic [core_v_mini_mcu_pkg::NUM_BANKS-1:0] set_retentive_ni
);

Expand Down Expand Up @@ -74,6 +75,7 @@ module memory_subsystem
.wdata_i(ram_req_i[${i}].wdata),
.be_i(ram_req_i[${i}].be),
.pwrgate_ni(pwrgate_ni[${i}]),
.pwrgate_ack_no(pwrgate_ack_no[${i}]),
.set_retentive_ni(set_retentive_ni[${i}]),
.rdata_o(ram_resp_o[${i}].rdata)
);
Expand Down
4 changes: 4 additions & 0 deletions hw/fpga/sram_wrapper.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ module sram_wrapper #(
input logic [3:0] be_i,
// power manager signals that goes to the ASIC macros
input logic pwrgate_ni,
output logic pwrgate_ack_no,
input logic set_retentive_ni,
// output ports
output logic [31:0] rdata_o
);

assign pwrgate_ack_no = pwrgate_ni;

<%el = ""%>
% for num_words in xheep.iter_bank_numwords():
${el}if (NumWords == 32'd${num_words}) begin
Expand Down
Loading

0 comments on commit 3d4de8e

Please sign in to comment.