script.py 1.01 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#!/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)