Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/vsc/model/solvegroup_swizzler_partsel.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ def swizzle(self,

if rs.rand_order_l is not None:
# Perform an ordered randomization
if self.debug > 0: print(" following solve-order constraints")
for ro_l in rs.rand_order_l:
swizzled_field |= self.swizzle_field_l(ro_l, rs, bound_m, btor)
else:
if self.debug > 0: print(" following random field order")
swizzled_field |= self.swizzle_field_l(rs.rand_fields(), rs, bound_m, btor)

if not swizzled_field:
Expand Down
11 changes: 9 additions & 2 deletions src/vsc/visitors/expand_solve_order_visitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
'''
from vsc.model.field_array_model import FieldArrayModel
from vsc.model.field_scalar_model import FieldScalarModel
from vsc.model.enum_field_model import EnumFieldModel
from vsc.model.model_visitor import ModelVisitor


Expand All @@ -27,12 +28,18 @@ def expand(self, a, b):
else:
b.accept(self)

def visit_scalar_field(self, f:FieldScalarModel):
def visit_field(self, f:list[FieldScalarModel, EnumFieldModel]):
if self.lhs:
# Now, visit rhs
ExpandSolveOrderVisitor(self.order_m, lhs=False).expand(f, self.b)
else:
if not self.a in self.order_m.keys():
self.order_m[self.a] = set()
self.order_m[self.a].add(f)


def visit_scalar_field(self, f:FieldScalarModel):
self.visit_field(f)

def visit_enum_field(self, f:EnumFieldModel):
self.visit_field(f)