#!/usr/bin/python3 """ Example of a script that uses SimSo. """ import sys from context import simso from simso.core import Model from simso.core.Fault import ProcessorFailure, VoltageDrop, PriorityInversion, TimingError from simso.configuration import Configuration from simso.configuration.parser import AmaltheaModelParser import pickle def main(argv): # Manual configuration: configuration = Configuration("./misc/mobstr.amxmi") configuration.cycles_per_ms = 1000 configuration.duration = 100 * configuration.cycles_per_ms configuration.scheduler_info.clas = "simso.schedulers.RM" # Check the config before trying to run it. configuration.check_all() # Init a model from the configuration. model = Model(configuration) # Execute the simulation. model.run_model() # Print logs. for log in model.logs: print(log) main(sys.argv) # configuration = None # with open('failed_configuration.pkl','rb') as input: # configuration = pickle.load(input)