Skip to content

Commit fbbd8e0

Browse files
authored
Merge pull request #62 from antmicro/fix-exhaust-build-dirs-extraction
exhaust: better build dir extraction and added user selection options
2 parents f522adb + e3ba438 commit fbbd8e0

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

exhaust.py

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ def get_reports(out_prefix):
3636

3737
def get_builds(out_prefix):
3838
"""Returns all the paths of all the builds in the build directory."""
39-
return matching_pattern(
40-
os.path.join(root_dir, out_prefix, '*/'), '.*\/(.*)\/$'
41-
)
39+
build_dir = os.path.join(root_dir, out_prefix)
40+
builds = []
41+
for content in os.listdir(build_dir):
42+
if os.path.isdir(os.path.join(build_dir, content)):
43+
builds.append(content)
44+
45+
return builds
4246

4347

4448
def print_summary_table(out_prefix, total_tasks):
@@ -48,7 +52,7 @@ def print_summary_table(out_prefix, total_tasks):
4852
['Project', 'Toolchain', 'Family', 'Part', 'Board', 'Options']
4953
]
5054
passed = failed = 0
51-
for build in builds:
55+
for build in sorted(builds):
5256
# Split directory name into columns
5357
# Example: oneblink_vpr_xc7_a35tcsg326-1_arty_options
5458
pattern = '([^_]*)_([^_]*)_([^_]*)_([^_]*)_([^_]*)_(.*)'
@@ -118,6 +122,13 @@ def iter_options(args):
118122

119123
for constraint in os.listdir(constraint_path):
120124
family, device, package, board = get_device_info(constraint)
125+
126+
# Check if user selected specific family/device/package/board
127+
family = args.family if args.family else family
128+
device = args.device if args.device else device
129+
package = args.package if args.package else package
130+
board = args.board if args.board else board
131+
121132
combinations.add(
122133
(project, toolchain, family, device, package, board)
123134
)
@@ -165,9 +176,20 @@ def main():
165176
parser = argparse.ArgumentParser(
166177
description='Exhaustively try project-toolchain combinations'
167178
)
168-
parser.add_argument('--family', default=None, help='device family')
169-
parser.add_argument('--part', default=None, help='device part')
170-
parser.add_argument('--board', default=None, help='target board')
179+
parser.add_argument(
180+
'--family', default=None, help='device family: e.g. --family xc7'
181+
)
182+
parser.add_argument(
183+
'--device', default=None, help='FPGA device: e.g. --device a35t'
184+
)
185+
parser.add_argument(
186+
'--package',
187+
default=None,
188+
help='FPGA package: e.g. --package csg324-1'
189+
)
190+
parser.add_argument(
191+
'--board', default=None, help='target board: e.g. --board arty'
192+
)
171193
parser.add_argument(
172194
'--project',
173195
default=None,

0 commit comments

Comments
 (0)