simso icon indicating copy to clipboard operation
simso copied to clipboard

BF Scheduler

Open dbaltieri opened this issue 7 years ago • 2 comments

Hello everyone,

Today Im trying to simulate some of the available schedulers, but only one it is not working (BF), returning the following message:

screen shot 2018-02-06 at 5 37 06 pm The simulation using BF scheduler

screen shot 2018-02-06 at 5 40 34 pm The simulation using EKG scheduler

How to simulate using BF Algorithm ?

dbaltieri avatar Feb 06 '18 20:02 dbaltieri

Could you provide the script as a text file instead of an image?

According to the code, the error can only happen if job.wcet = 0, which is surprising according to your configuration...

ui = job.wcet / job.deadline
return (1. - (bk1 * ui - int(bk1 * ui))) / ui

MaximeCheramy avatar Feb 10 '18 18:02 MaximeCheramy

Yes. In this code I'm using EKG scheduler, but if try to execute BF I get that error.

`import sys from simso.core import Model from simso.configuration import Configuration

def main(argv): if len(argv) == 2: # Configuration load from a file. configuration = Configuration(argv[1]) else: # Manual configuration: configuration = Configuration()

    configuration.duration = 420 * configuration.cycles_per_ms

    # Add tasks:
    configuration.add_task(name="T1", identifier=1, period=7,
                           activation_date=0, wcet=3, deadline=7)
    configuration.add_task(name="T2", identifier=2, period=12,
                           activation_date=0, wcet=3, deadline=12)
    configuration.add_task(name="T3", identifier=3, period=20,
                           activation_date=0, wcet=5, deadline=20)

    # Add a processor:
    configuration.add_processor(name="CPU 1", identifier=1)
    configuration.add_processor(name="CPU 2", identifier=2)


    # Add a scheduler:
    #configuration.scheduler_info.filename = "simso/schedulers/BF.py"
    configuration.scheduler_info.clas = "simso.schedulers.BF"

# 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)`

dbaltieri avatar Feb 15 '18 12:02 dbaltieri