Commit 999540e2 by Tobias Langer

Added support for utilization based simulation.

parent 2e5cf367
...@@ -14,9 +14,9 @@ def get_exp_cnt(path): ...@@ -14,9 +14,9 @@ def get_exp_cnt(path):
def main(): def main():
parser = argparse.ArgumentParser('Run all the scripts so everything works fine.') parser = argparse.ArgumentParser('Run all the scripts so everything works fine.')
parser.add_argument('experiments', type=int, nargs=1, default=1, parser.add_argument('experiments', type=int, nargs='?', default=1,
help='The number of experiments to be run.') help='The number of experiments to be run.')
parser.add_argument('utilization', type=float, nargs='?', default=1, parser.add_argument('utilization', type=float, nargs='?',
help='The utilization for the experiments to be run.', help='The utilization for the experiments to be run.',
default=None) default=None)
...@@ -32,7 +32,7 @@ def main(): ...@@ -32,7 +32,7 @@ def main():
cnt = 0 cnt = 0
remain = args.experiments remain = args.experiments
while remain > 0: while remain > 0:
if parser.utilization is not None: if args.utilization is not None:
subprocess.call(['./tasksetgen.py', '--microseconds', '--uniform', '5', subprocess.call(['./tasksetgen.py', '--microseconds', '--uniform', '5',
'--utilization {}:{}'.format(args.utilization - 0.25, args.utilization + 0.25), '--utilization {}:{}'.format(args.utilization - 0.25, args.utilization + 0.25),
str(remain), 'experiments/ese2016_{}'.format(cnt), str(remain), 'experiments/ese2016_{}'.format(cnt),
......
...@@ -128,6 +128,9 @@ def main(): ...@@ -128,6 +128,9 @@ def main():
default='.') default='.')
parser.add_argument('experiment_target', type=str, help='Output directory for experiments.', nargs='?', parser.add_argument('experiment_target', type=str, help='Output directory for experiments.', nargs='?',
default='.') default='.')
parser.add_argument('--utility', type=str, help='The utility for which tasksets should be generated. Is a range such as 2.5:3.5', nargs=1)
parser.add_argument('--baseclock', type=str, default='system_clock', parser.add_argument('--baseclock', type=str, default='system_clock',
nargs='?', nargs='?',
help='The clock which is to be used for the execution.') help='The clock which is to be used for the execution.')
...@@ -174,16 +177,35 @@ def main(): ...@@ -174,16 +177,35 @@ def main():
else: else:
distribution = Distribution.uniform distribution = Distribution.uniform
utility = None
try:
utility_val = args.utility.split(':')
if len(utility_val > 3):
print('Invalid utility specified.', file=sys.sterr)
sys.exit(1)
utility = [float(util) for util in utility_val]
except AttributeError:
pass
print('Generating tasks…', file=sys.stderr) print('Generating tasks…', file=sys.stderr)
tasksets = [] tasksets = []
while len(tasksets) < args.tasksetcount: while len(tasksets) < args.tasksetcount:
taskset = [] taskset = []
while len(taskset) < args.cores + 1 or \ if utility is None:
calc_utilization(taskset) <= args.cores and \ while len(taskset) < args.cores + 1 or \
hyperperiod(taskset) < 300000: # Limit hyperperiod to 5 minutes calc_utilization(taskset) <= args.cores and \
taskset.append(create_task(distribution)) hyperperiod(taskset) < 300000: # Limit hyperperiod to 5 minutes
if len(taskset) >= args.cores + 1: taskset.append(create_task(distribution))
tasksets.append(taskset) if len(taskset) >= args.cores + 1:
tasksets.append(taskset)
else:
taskset_util = calc_utilization(taskset)
while taskset_util < utility[0] and taskset_util < utility[1]:
taskset.append(create_task(distribution))
if taskset_util < utility[1]:
if len(taskset) >= args.cores + 1:
tasksets.append(taskset)
now = datetime.datetime.now() now = datetime.datetime.now()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment