From e3125c7322b2a2227c9f203618282113645a64fa Mon Sep 17 00:00:00 2001 From: Jeff Goeders Date: Fri, 27 Sep 2024 16:18:50 +0000 Subject: [PATCH] Dataset --- bfasst/flows/rand_soc_dumped.py | 9 ++++++--- bfasst/tools/design_create/rand_soc.py | 7 ++++--- resources/randsoc/dataset5.yaml | 4 ++-- resources/randsoc/dataset6_test.yaml | 7 +++++++ resources/randsoc/dataset6_train.yaml | 7 +++++++ resources/randsoc/randsoc_configs/dataset6_train.yaml | 10 ++++++++++ third_party/gmt_tools | 2 +- 7 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 resources/randsoc/dataset6_test.yaml create mode 100644 resources/randsoc/dataset6_train.yaml create mode 100644 resources/randsoc/randsoc_configs/dataset6_train.yaml diff --git a/bfasst/flows/rand_soc_dumped.py b/bfasst/flows/rand_soc_dumped.py index ca190ffe..a4e90b26 100644 --- a/bfasst/flows/rand_soc_dumped.py +++ b/bfasst/flows/rand_soc_dumped.py @@ -13,7 +13,7 @@ class RandSocDumped(FlowNoDesign): """Flow to dump bels from random soc block designs with Isoblaze""" - def __init__(self, num_designs=1, part=None, randsoc_config_path=None): + def __init__(self, num_designs=1, part=None, randsoc_config_path=None, start_idx=0): # pylint: disable=duplicate-code super().__init__() @@ -29,14 +29,17 @@ def __init__(self, num_designs=1, part=None, randsoc_config_path=None): assert randsoc_config_path.exists(), f"Config file {randsoc_config_path} does not exist" # Create all random designs - self.rand_soc_tool = RandSoC(self, num_designs=num_designs, config_path=randsoc_config_path) + self.rand_soc_tool = RandSoC( + self, num_designs=num_designs, config_path=randsoc_config_path, start_idx=start_idx + ) # Build each random design for i, (design_tcl, contraints_tcl) in enumerate( zip( self.rand_soc_tool.outputs["design_tcl"], self.rand_soc_tool.outputs["impl_constraints_tcl"], - ) + ), + start=start_idx, ): synth_tool = VivadoSynth(self, design_tcl.parent) synth_tool.synth_build["tcl_sources"] = [str(design_tcl)] diff --git a/bfasst/tools/design_create/rand_soc.py b/bfasst/tools/design_create/rand_soc.py index 31192bb4..d0375a24 100644 --- a/bfasst/tools/design_create/rand_soc.py +++ b/bfasst/tools/design_create/rand_soc.py @@ -10,12 +10,13 @@ class RandSoC(ToolBase): """Tool to create a random SoC""" - def __init__(self, flow, num_designs, config_path): + def __init__(self, flow, num_designs, config_path, start_idx=0): super().__init__(flow) self.build_path = BUILD_PATH / "rand_soc" self._my_dir_path = pathlib.Path(__file__).parent.resolve() self.num_designs = num_designs self.config_path = config_path + self.start_idx = start_idx self._init_outputs() self.rule_snippet_path = TOOLS_PATH / "design_create" / "rand_soc_rules.ninja" @@ -23,7 +24,7 @@ def create_build_snippets(self): rand_soc_pkg_files = list((GMT_TOOLS_PATH / "rand_soc" / "rand_soc").glob("**/*.py")) rand_soc_pkg_files.append(GMT_TOOLS_PATH / "rand_soc" / "main.py") - for i, design in enumerate(self.outputs["design_tcl"]): + for i, design in enumerate(self.outputs["design_tcl"], start=self.start_idx): design_dir_path = design.parent with open(self._my_dir_path / "rand_soc_build.ninja.mustache", "r") as f: build = chevron.render( @@ -43,7 +44,7 @@ def create_build_snippets(self): def _init_outputs(self): self.outputs["design_tcl"] = [] self.outputs["impl_constraints_tcl"] = [] - for i in range(self.num_designs): + for i in range(self.start_idx, self.start_idx + self.num_designs): design_dir_path = self.build_path / f"design_{i}" self.outputs["design_tcl"].append(design_dir_path / "design.tcl") self.outputs["impl_constraints_tcl"].append(design_dir_path / "impl_constraints.tcl") diff --git a/resources/randsoc/dataset5.yaml b/resources/randsoc/dataset5.yaml index 82f023f6..3f3190db 100644 --- a/resources/randsoc/dataset5.yaml +++ b/resources/randsoc/dataset5.yaml @@ -1,7 +1,7 @@ flow: RandSocDumped -num_designs: 6000 +num_designs: 6500 part: xc7a200tlffv1156-2L -randsoc_config_path: resources/randsoc/randsoc_configs/dataset5.yaml \ No newline at end of file +randsoc_config_path: resources/randsoc/randsoc_configs/dataset5.yaml diff --git a/resources/randsoc/dataset6_test.yaml b/resources/randsoc/dataset6_test.yaml new file mode 100644 index 00000000..c64129ab --- /dev/null +++ b/resources/randsoc/dataset6_test.yaml @@ -0,0 +1,7 @@ +flow: RandSocDumped + +num_designs: 1600 + +part: xc7a200tlffv1156-2L + +randsoc_config_path: resources/randsoc/randsoc_configs/dataset5.yaml diff --git a/resources/randsoc/dataset6_train.yaml b/resources/randsoc/dataset6_train.yaml new file mode 100644 index 00000000..9d342cb7 --- /dev/null +++ b/resources/randsoc/dataset6_train.yaml @@ -0,0 +1,7 @@ +flow: RandSocDumped + +num_designs: 5500 + +part: xc7a200tlffv1156-2L + +randsoc_config_path: resources/randsoc/randsoc_configs/dataset6_train.yaml diff --git a/resources/randsoc/randsoc_configs/dataset6_train.yaml b/resources/randsoc/randsoc_configs/dataset6_train.yaml new file mode 100644 index 00000000..9d220f1e --- /dev/null +++ b/resources/randsoc/randsoc_configs/dataset6_train.yaml @@ -0,0 +1,10 @@ +available_ip: + - class: Uartlite + - class: Accumulator + - class: AxiTimer + - class: Microblaze + - class: Dft + - class: Gpio + +min_ip: 3 +max_ip: 18 diff --git a/third_party/gmt_tools b/third_party/gmt_tools index fcc0fe34..1b30c885 160000 --- a/third_party/gmt_tools +++ b/third_party/gmt_tools @@ -1 +1 @@ -Subproject commit fcc0fe34e85e5b56204f7d8276ea94f5c319583f +Subproject commit 1b30c885c9b699baead3b50e78121cfb9b253024