50 lines
2.4 KiB
Python
50 lines
2.4 KiB
Python
"""
|
|
Hibernus
|
|
https://ieeexplore.ieee.org/document/6960060
|
|
"""
|
|
|
|
def setup(config):
|
|
config.memory.volatile.set_config('enabled', True)
|
|
config.memory.volatile.set_config('contains_stack', True)
|
|
config.memory.volatile.set_config('contains_heap', True)
|
|
config.memory.volatile.set_config('contains_gst', True)
|
|
|
|
config.memory.non_volatile.set_config('enabled', True)
|
|
config.memory.non_volatile.set_config('contains_stack', False)
|
|
config.memory.non_volatile.set_config('contains_heap', False)
|
|
config.memory.non_volatile.set_config('contains_gst', True)
|
|
|
|
config.state_retention.set_config('type', 'checkpoint')
|
|
config.state_retention.set_config('state_save_strategy', 'interrupt')
|
|
config.state_retention.set_config('calculate_v_save_state', True)
|
|
|
|
# Took from Hibernus paper
|
|
# - V_restore = 2.27V; V_hibernate = 2.17V; C = 16uF; f = 8MHz
|
|
# - E_restore-E_hibernate = 3.55uJ; R = 3.0V / 1mA = 3kOHM;
|
|
# - E_cc_min = 2.17V * (2.17V / 3kOHM) / 8MHz = 0.196nJ/cc; CC = 18094; (V = 2.17 -> here state-save is triggered)
|
|
# - E_cc_max = 2.27V * (2.27V / 3kOHM) / 8MHz = 0.215nJ/cc; CC = 16535;
|
|
# - CC_avg = 17315
|
|
config.state_retention.set_config('calculate_v_resume_additional_cc', 17315)
|
|
|
|
# When saving the state, we want to have headroom to stay in LPM.
|
|
# - V_hibernate = 2.17V; V_off = 2.0V; C = 16uF; f = 8MHz
|
|
# - E_hibernate-E_off = 5.671uJ; R = 3.0V / 1mA = 3kOHM;
|
|
# - E_cc_min = 2.0V * (2.0V / 3kOHM) / 8MHz = 0.167nJ/cc; CC = 33958;
|
|
# - E_cc_max = 2.17V * (2.17V / 3kOHM) / 8MHz = 0.196nJ/cc; CC = 28934;
|
|
# - CC_avg = 31446
|
|
#config.state_retention.set_config('calculate_v_save_state_additional_cc', 31446)
|
|
|
|
# Little bit of headroom
|
|
config.state_retention.set_config('calculate_v_save_state_additional_cc', 300)
|
|
|
|
config.state_retention.set_config('state_save_behaviour', 'execute')
|
|
config.state_retention.set_config('hibernate_after_save', True)
|
|
|
|
config.state_retention.set_config('restore_stack', True)
|
|
config.state_retention.set_config('restore_heap', True)
|
|
config.state_retention.set_config('restore_volatile_gst', True)
|
|
config.state_retention.set_config('restore_non_volatile_gst', False)
|
|
|
|
config.state_retention.set_config('restore_register_file', True)
|
|
config.state_retention.set_config('restore_environment', False)
|