ScEpTIC.emulator.energy package
Subpackages
- ScEpTIC.emulator.energy.buffer package
- Submodules
- ScEpTIC.emulator.energy.buffer.capacitor module
- Module contents
EnergyBufferModel
EnergyBufferModel.calculate_recharge_energy_to_voltage()
EnergyBufferModel.calculate_recharge_time_to_voltage()
EnergyBufferModel.disable_discharge()
EnergyBufferModel.enable_discharge()
EnergyBufferModel.execute_full_refill()
EnergyBufferModel.get_energy()
EnergyBufferModel.get_energy_charge()
EnergyBufferModel.get_max_voltage()
EnergyBufferModel.get_nominal_size()
EnergyBufferModel.get_size()
EnergyBufferModel.get_usable_energy()
EnergyBufferModel.get_usable_voltage()
EnergyBufferModel.get_voltage()
EnergyBufferModel.increment_energy()
EnergyBufferModel.increment_voltage()
EnergyBufferModel.set_energy()
EnergyBufferModel.set_energy_lower_bound()
EnergyBufferModel.set_voltage()
EnergyBufferModel.set_voltage_lower_bound()
EnergyBufferModel.update()
EnergyBufferModel.update_size()
- ScEpTIC.emulator.energy.energy_harvester package
- ScEpTIC.emulator.energy.energy_source package
- ScEpTIC.emulator.energy.mcu package
- Subpackages
- ScEpTIC.emulator.energy.mcu.datasheets package
- Subpackages
- Submodules
- ScEpTIC.emulator.energy.mcu.datasheets.msp430fr2355 module
- ScEpTIC.emulator.energy.mcu.datasheets.msp430fr5043 module
- ScEpTIC.emulator.energy.mcu.datasheets.msp430fr5739 module
- ScEpTIC.emulator.energy.mcu.datasheets.msp430fr5969 module
- ScEpTIC.emulator.energy.mcu.datasheets.msp430g2553 module
- Module contents
- ScEpTIC.emulator.energy.mcu.lookup_tables package
- ScEpTIC.emulator.energy.mcu.datasheets package
- Submodules
- ScEpTIC.emulator.energy.mcu.msp430fr module
- ScEpTIC.emulator.energy.mcu.msp430g module
- ScEpTIC.emulator.energy.mcu.options module
ADCPowerState
MCUClockCycleAction
MCUClockCycleAction.I2C_ACCESS
MCUClockCycleAction.LPM_ENTER
MCUClockCycleAction.LPM_EXIT
MCUClockCycleAction.LPM_NOP
MCUClockCycleAction.NON_VOLATILE_MEMORY_ACCESS
MCUClockCycleAction.NOP_OFF_RECHARGE
MCUClockCycleAction.NO_MEMORY_ACCESS
MCUClockCycleAction.PHYSICAL_MEMORY_ACCESS
MCUClockCycleAction.SPI_ACCESS
MCUClockCycleAction.VOLATILE_MEMORY_ACCESS
MCUPowerState
- Module contents
MCUEnergyModel
MCUEnergyModel.ADC_I_TO_CONSIDER
MCUEnergyModel.ALFRED_n_min()
MCUEnergyModel.attach_peripheral()
MCUEnergyModel.get_ADC_wait_cycles()
MCUEnergyModel.get_LPM_wait_cycles()
MCUEnergyModel.get_NVM_wait_cycles()
MCUEnergyModel.get_action_wait_cycles()
MCUEnergyModel.get_adc_state()
MCUEnergyModel.get_clock_cycles()
MCUEnergyModel.get_drained_energy()
MCUEnergyModel.get_external_nvm()
MCUEnergyModel.get_frequency()
MCUEnergyModel.get_mcu_cycle_time()
MCUEnergyModel.get_mcu_state()
MCUEnergyModel.get_min_v()
MCUEnergyModel.get_nominal_frequency()
MCUEnergyModel.get_power_state_events()
MCUEnergyModel.get_time()
MCUEnergyModel.get_voltage()
MCUEnergyModel.power_failure_callback()
MCUEnergyModel.reset()
MCUEnergyModel.set_adc_state()
MCUEnergyModel.set_frequency()
MCUEnergyModel.set_lookup_table()
MCUEnergyModel.set_mcu_state()
MCUEnergyModel.set_target_lpm()
MCUEnergyModel.set_time()
MCUEnergyModel.set_v_on()
MCUEnergyModel.update_stats()
- Subpackages
- ScEpTIC.emulator.energy.mcu_peripheral package
- Subpackages
- Submodules
- ScEpTIC.emulator.energy.mcu_peripheral.SGP40 module
- ScEpTIC.emulator.energy.mcu_peripheral.SHT85 module
- ScEpTIC.emulator.energy.mcu_peripheral.camera_0V7620 module
Camera0V7620Model
Camera0V7620Model.CC_READ
Camera0V7620Model.CC_SET
Camera0V7620Model.READ_DATA
Camera0V7620Model.STATES
Camera0V7620Model.attach_system_model()
Camera0V7620Model.get_drained_energy()
Camera0V7620Model.resistance
Camera0V7620Model.set_state()
Camera0V7620Model.simulate_read()
Camera0V7620Model.simulate_set_state()
Camera0V7620Model.t_ready
Camera0V7620Model.t_wakeup
- ScEpTIC.emulator.energy.mcu_peripheral.cc1101 module
CC1101Model
CC1101Model.BAUD_RATE
CC1101Model.HEADER_BYTES
CC1101Model.PACKET_SIZE
CC1101Model.STATES
CC1101Model.attach_system_model()
CC1101Model.data
CC1101Model.get_drained_energy()
CC1101Model.get_transmission_cycles()
CC1101Model.get_wait_cycles()
CC1101Model.get_wakeup_time()
CC1101Model.set_state()
CC1101Model.simulate_set_state()
CC1101Model.simulate_transmit()
CC1101Model.t_wakeup
- ScEpTIC.emulator.energy.mcu_peripheral.external_nvm module
- ScEpTIC.emulator.energy.mcu_peripheral.generic_sensor module
- ScEpTIC.emulator.energy.mcu_peripheral.options module
- Module contents
- ScEpTIC.emulator.energy.state_retention package
- Submodules
- ScEpTIC.emulator.energy.state_retention.external_checkpoint module
- ScEpTIC.emulator.energy.state_retention.internal_checkpoint module
- Module contents
StateRetentionEnergyModel
StateRetentionEnergyModel.attach_system_model()
StateRetentionEnergyModel.execute_probe_energy_buffer()
StateRetentionEnergyModel.execute_restore_state()
StateRetentionEnergyModel.execute_save_state()
StateRetentionEnergyModel.reset()
StateRetentionEnergyModel.set_max_memory_cells()
StateRetentionEnergyModel.set_max_regs()
- ScEpTIC.emulator.energy.timekeeper package
- ScEpTIC.emulator.energy.voltage_regulator package
- Submodules
- ScEpTIC.emulator.energy.voltage_regulator.MAX20361 module
- ScEpTIC.emulator.energy.voltage_regulator.TPS61322 module
- ScEpTIC.emulator.energy.voltage_regulator.TPS62740x module
- ScEpTIC.emulator.energy.voltage_regulator.ideal_regulator module
- Module contents
Submodules
ScEpTIC.emulator.energy.energy_utils module
- ScEpTIC.emulator.energy.energy_utils.P_R_to_V(P, R)
Calculates the voltage from instantaneous power and equivalent resistance :param P: power :param R: resistance
- ScEpTIC.emulator.energy.energy_utils.R_from_energy_t(V, e, t)
Calculates the instantaneous equivalent resistance given the energy consumption in an instant t under the voltage V :param V: Voltage (V) :param e: energy consumed in t :param t: time interval :return: the equivalent resistance
- ScEpTIC.emulator.energy.energy_utils.R_from_parallel_r(R1, R2)
Calculates the equivalent resistance of two parallel resistors :param R1: resistor 1 :param R2: resistor 2 :return: the equivalent resistance
- ScEpTIC.emulator.energy.energy_utils.energy_from_I_f(V, I, f)
Calculates the energy consumption of a clock cycle with frequency f :param V: voltage :param I: current draw :param f: clock frequency
- ScEpTIC.emulator.energy.energy_utils.energy_from_I_t(V, I, t)
Calculates the energy consumption in the time interval t :param V: voltage :param I: current draw :param t: time interval
- ScEpTIC.emulator.energy.energy_utils.energy_from_R_f(V, R, f)
Calculates the energy consumption of a clock cycle with frequency f :param V: voltage :param R: resistance :param f: clock frequency
- ScEpTIC.emulator.energy.energy_utils.energy_from_R_t(V, R, t)
Calculates the energy consumption in the time interval t :param V: voltage :param R: resistance :param t: time interval
- ScEpTIC.emulator.energy.energy_utils.equivalent_resistance(V, I)
Calculates the equivalent resistance of a given voltage and current draw :param V: Voltage (V) :param I: Current Draw (A)
- ScEpTIC.emulator.energy.energy_utils.float_to_str(value, round_val=None, omit_dot_zero=False)
- ScEpTIC.emulator.energy.energy_utils.str_add_vals(val1, val2)
Adds two values in str representation :param val1: first value (with unit multipliers) :param val2: second value (with unit multipliers) :return: the sum in textual representation (with unit multipliers)
- ScEpTIC.emulator.energy.energy_utils.str_to_float(value)
Converts a string to a float, accounting for unit multipliers such as M/k/m/u
- ScEpTIC.emulator.energy.energy_utils.str_to_int(value)
Converts a string to an int, accounting for unit multipliers such as M/k/m/u
ScEpTIC.emulator.energy.options module
- class ScEpTIC.emulator.energy.options.ComponentVoltageSource(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
Enum for specifying the voltage source where custom devices are attached
- ENERGY_BUFFER = 1
- VOLTAGE_REGULATOR = 2
- class ScEpTIC.emulator.energy.options.OpModeName(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
Enum for op_mode_name of system_model.run_step()
- D2VFS_ISR = 'D2VFS_ISR'
- DUMMY = 'DUMMY'
- ENERGY_BUFFER_RECHARGE = 'ENERGY_BUFFER_RECHARGE'
- EXTERNAL_NVM = 'EXTERNAL_NVM'
- FBTC_ISR = 'FBTC_ISR'
- LPM = 'LPM'
- LPM_ENTER = 'LPM_ENTER'
- LPM_EXIT = 'LPM_EXIT'
- NVM_I2C = 'NVM_I2C'
- NVM_SPI = 'NVM_SPI'
- PROBE_ENERGY_BUFFER = 'PROBE_ENERGY_BUFFER'
- PROGRAM_EXECUTION = 'PROGRAM_EXECUTION'
- SIMULATE_ADC = 'SIMULATE_ADC'
- SIMULATE_CYCLES = 'SIMULATE_CYCLES'
- SIMULATE_RADIO = 'SIMULATE_RADIO'
- SIMULATE_SENSOR = 'SIMULATE_SENSOR'
- STATE_RESTORE = 'STATE_RESTORE'
- STATE_SAVE = 'STATE_SAVE'
- STATIC_SCALE_DOWN = 'STATIC_SCALE_DOWN'
- STATIC_SCALE_UP = 'STATIC_SCALE_UP'
ScEpTIC.emulator.energy.power_state_event module
ScEpTIC.emulator.energy.system_energy_model module
- class ScEpTIC.emulator.energy.system_energy_model.SystemEnergyModel
Bases:
object
Class to model the system energy consumption
- add_power_off_event(event)
Adds a PowerStateEvent to the list of events that will cause the system to power off :param event: a PowerStateEvent
- attach_component(name, component, target)
Attaches an additional component to the energy buffer, the voltage regulator, or the MCU. :param name: component name for stats :param component: the component :param target: ComponentVoltageSource enum specifying the voltage source for the device
- attach_custom_device(custom_device)
Attaches a custom device to the system model and initializes it. Note that a custom device consists in a model of an ad-hoc device, which may include multiple components and additional logic. :param custom_device: the custom device (must inherit from CustomDevice)
- attach_energy_buffer(energy_buffer)
Attaches an energy buffer to the system model :param energy_buffer: the energy buffer (must inherit from EnergyBufferModel)
- attach_energy_harvester(energy_harvester)
Attaches an energy harvester to the system model :param energy_harvester: the energy harvester
- attach_energy_source_model(energy_source)
Attaches an energy source model to the system model :param energy_source: the energy source model
- attach_mcu(mcu)
Attaches a MCU to the system model :param mcu: the MCU (must inherit from MCUEnergyModel)
- attach_state_retention_model(state_retention)
Attaches a state retention model to the system model :param state_retention: the state retention model (must inherit from StateRetentionEnergyModel)
- attach_timekeeper(timekeeper)
Attaches a timekeeper to the system model :param timekeeper: the timekeeper
- attach_voltage_regulator(voltage_regulator)
Attaches a voltage regulator to the system model :param voltage_regulator: the voltage regulator (must inherit from VoltageRegulatorModel)
- calculate_energy_draws(mcu_clock_action, elapsed_time)
Calculates the energy draw of the simulated circuit and returns it :param mcu_clock_action: Clock cycle action of the MCU :param elapsed_time: the time elapsed :return: a dictionary with all the energy draws types
- circuit_equivalent_resistance(mcu_clock_action, energy_draws=None, elapsed_time=None)
Calculates the circuit equivalent resistance (excluding the energy harvester) :param mcu_clock_action: Clock cycle action of the MCU :param energy_draws: pre-computed energy draws :param elapsed_time: elapsed time in the pre-computed energy draws :return: the circuit equivalent resistance
- disable_lpm_precise_ticks()
Revers LPM simulation of t = source_sample_time
- disable_stats()
Disables statistics collection
- enable_lpm_precise_ticks()
Enables LPM simulation of t = mcu tick
- execute_full_recharge(mcu_clock_action, op_mode_name, v_target, v_supply)
Executes a full recharge of the energy buffer :param mcu_clock_action: Clock cycle action of the MCU :param op_mode_name: current operation identifier (string) for metrics identification :param v_target: target voltage :param v_supply: voltage of the power supply
- get_collected_signals()
- Returns:
the collected signals
- get_component(name)
- get_drained_energy()
- Returns:
the used energy
- get_elapsed_ticks()
Returns total elapsed clock ticks
- get_elapsed_time()
- Returns:
the time elapsed during a simulation tick / step
- get_power_state_events()
- Returns:
a list of the power state events occurred
- get_simulation_time()
Returns total elapsed time in s
- get_stats()
- Returns:
the simulation statistics and the name of each label
- get_used_energy()
Returns total used energy
- init(custom_devices_print_enabled=True)
Initializes the MCU and custom devices :param custom_devices_print_enabled: enables/disables custom devices messages :return: the number of clock cycles executed by the MCU
- init_custom_signals(data)
Set the strings and keys of custom signals collected during the simulation :param data: a list of tuples (key, string)
- power_failure_occurred()
- Returns:
if a power failure occurred during previous operations
- power_failure_occurring(reset_cache=True)
- Parameters:
reset_cache – reset the cache if a cached power failure occurred
- Returns:
if the MCU needs to be shut down / a power failure is occurring
- record_power_failure()
Records the occurrence of a power failure
- reset(run_gc_collect=True)
Resets statistics :param run_gc_collect: runs the garbage collector after deleting the saved signals
- reset_simulation_time()
- reset_used_energy()
Resets the total energy usage
- run_custom_devices_logic(skip_device=None)
Runs all custom device logic :param skip_device: device to skip :return: the number of clock cycles executed by the MCU during custom device operations
- run_step(mcu_clock_action, op_mode_name, is_wait_cycle=False, from_custom_device=None, additional_op_mode_name=None)
Runs a simulation step :param mcu_clock_action: Clock cycle action of the MCU :param op_mode_name: current operation identifier (string) for metrics identification :param is_wait_cycle: specifies if the execution happens due to a wait cycle :param from_custom_device: name of the cust device that is triggering the step execution :param additional_op_mode_name: additional op_mode_name for metrics identification :return: the number of clock cycles executed by the MCU
- set_custom_signal(name, val)
Set the custom signals collected during the simulation :param name: the signal name :param val: the signal value
- set_power_failures_automatic_check(val)
Sets how power failures are controlled :param val: True/False
- set_power_off_condition(power_off_condition)
Sets the power off condition for the MCU :param power_off_condition: a PowerOffCondition
- set_power_off_voltage(voltage)
Sets the power off voltage (considered only when power off condition = PowerOffCondition.VOLTAGE_THRESHOLD) :param voltage: the power off voltage
ScEpTIC.emulator.energy.voltage_drawner module
- class ScEpTIC.emulator.energy.voltage_drawner.VoltageDrawner
Bases:
object
Generic component that consumes energy
- attach_voltage_source(source)
- Parameters:
source – a voltage source
- get_drained_energy(t)
Calculates the energy consumed by the component. :param t: elapsed time :return: the consumed energy
- voltage_source = None