1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-09-01 19:02:31 +01:00

Initial priority implementation

- Fixed up some of the signal map for instrumentation
- Changed how priorites are specified -- no longer method name prefixes
  but dedicated decorators, including an easy way of specifying a custom
  priority level (no longer need to manually connect signals)
- Updated ExecutionTimeInstrument to work with the new system
- Also removed some dead code
This commit is contained in:
Sergei Trofimov
2017-03-17 15:57:05 +00:00
parent 4287e90153
commit c5cd2b9298
8 changed files with 144 additions and 291 deletions

View File

@@ -520,7 +520,7 @@ class level(object):
return self.value != other
def enum(args, start=0):
def enum(args, start=0, step=1):
"""
Creates a class with attributes named by the first argument.
Each attribute is a ``level`` so they behave is integers in comparisons.
@@ -556,11 +556,13 @@ def enum(args, start=0):
raise ValueError('Invalid enum value: {}'.format(repr(name)))
levels = []
for i, v in enumerate(args, start):
n = start
for v in args:
name = caseless_string(identifier(v))
lv = level(v, i)
lv = level(v, n)
setattr(Enum, name, lv)
levels.append(lv)
n += step
setattr(Enum, 'values', levels)