Esempio n. 1
0
 def f(arg, conds):
     assert type(arg) == Flops or type(arg) == Scalar or type(
         arg) == Array
     conds_sat = conds_chk(conds)
     if type(arg) == Flops and conds_sat > 0.0:
         return Collection([FlopCount(arg) * conds_sat])
     return Collection()
Esempio n. 2
0
 def f(arg, conds):
     assert type(arg) == Flops or type(arg) == Scalar or type(
         arg) == Array
     conds_sat = conds_chk(conds)
     if type(arg
             ) == Array and not arg.onlyStateVars() and conds_sat > 0.0:
         return Collection([ArrayVar(arg) * conds_sat])
     return Collection()
Esempio n. 3
0
 def f(arg, conds):
     assert type(arg) == Flops or type(arg) == Scalar or type(
         arg) == Array
     # TODO: do something more sophisticated when Pr[conds] < 1.0
     # for now, just include it in the working set if Pr[conds] > 0.0
     if type(arg) == Array and not arg.onlyStateVars() and conds_chk(
             conds) > 0.0:
         return Collection([WorkingSet(arg, machine=machine)])
     return Collection()
Esempio n. 4
0
 def f(arg, conds):
     assert type(arg) == Flops or type(arg) == Scalar or type(
         arg) == Array
     conds_sat = conds_chk(conds)
     if type(arg
             ) == Array and not arg.onlyStateVars() and conds_sat > 0.0:
         return Collection([
             Traffic(arg, params, block_params, machine, conds_chk,
                     conds_sat)
         ])
     return Collection()
Esempio n. 5
0
 def f(arg, conds):
     assert type(arg) == Flops or type(arg) == Scalar or type(
         arg) == Array
     conds_sat = conds_chk(conds)
     if type(arg) == Scalar and conds_sat > 0.0:
         return Collection([StateVar(sv=arg) * conds_sat])
     elif type(arg) == Array and conds_sat > 0.0:
         return Collection([StateVar(array=arg) * conds_sat] + \
                           map(lambda ac: StateVar(array=arg, access=ac) * conds_sat,
                               filter(ArrayAccess.isStateVar, arg.accesses)))
     return Collection()