ScEpTIC.emulator package

Subpackages

Submodules

ScEpTIC.emulator.stats module

class ScEpTIC.emulator.stats.ScEpTICStats

Bases: object

Stats of ScEpTIC simulation

anomaly_found(count=1)
checkpoint_executed()
checkpoint_restored()
dump_restored()
instruction_executed()
reset()
stop_at(pc, clock, is_anomaly=False)

ScEpTIC.emulator.vm module

class ScEpTIC.emulator.vm.VM(config)

Bases: object

Execution environment for LLVM IR code

evaluate_run_test(module_name, class_name)

Estimates the number of instructions to be executed continuously

get_found_anomalies(outfile=None)

Prints out the found anomalies. If an outfile is specified, such information is written inside it.

get_observation_info(outfile=None)

Prints out the gethered profiling information. If an outfile is specified, such information is written inside it.

get_output_profiling_info(outfile=None)
get_profiling_info(outfile=None, module_name='')

Prints out the gethered profiling information. If an outfile is specified, such information is written inside it.

get_visual_dump()

Returns a visual dump of the current state of the simulator.

reset()

Resets the whole status of the simulator.

reset_anomalies()

Resets the found anomalies.

reset_profiling()

Resets the gathered profiling information.

run_test(module_name, class_name)

Runs completely a test, given the test module (interruption manager)

run_tests()

Runs the tests configured in the config file.

stop_current_test()

Stops the current test

ScEpTIC.emulator.vmstate module

class ScEpTIC.emulator.vmstate.VMState(program_configuration, register_file_configuration, memory_configuration, execution_depth)

Bases: object

State of the ScEpTIC execution environment

property current_instruction

Returns the current instruction.

get_instruction_from_pc(pc)

Returns an instruction corresponding to a given program counter

handle_stop_request(anomaly)

Stops the analysis if stop_on_first_anomaly is set to True, accordingly to the user input.

init_code(functions, declarations)

Stores the function’s code information to be run and performs register allocation if required.

init_gst(global_vars)

Initializes the global symbol table.

on_branch(label, basic_block_id, tick_count)

Callback that executes the operations needed to perform the branch operation, which updates program counter and last_basic_block.

on_function_call(function_name)

Callback that executes the operations needed before executing a function call.

on_function_return(return_value, input_lookup_data, tick_count, update_program_counter=True)

Callback that executes the operations needed after returning from a function call.

on_run(tick_count, update_program_counter=True)

Callback that is executed when an instruction is run. It increments the program counter and the global_clock.

property program_end_reached

Returns if the end of the program has been reached.

reset()

Performs the CPU reset operations.

run_step()

Runs the current instruction.

static validate_execution_depth(execution_depth)

Verifies if the user provided execution_depth is valid.

static validate_program_configuration(program_configuration)

Validates the program configuration.

Module contents