From e61427cb99bf418ba06e79e62d3e4f944e1799d4 Mon Sep 17 00:00:00 2001 From: Matthew Ballance Date: Fri, 10 Jan 2025 04:45:48 +0000 Subject: [PATCH] XX Signed-off-by: Matthew Ballance --- docs/Notes.md | 33 +++++++- docs/Roadmap.md | 75 +++++++++++++++++++ docs/quickstart.rst | 59 +++++++++++++-- src/dv_flow_mgr/fragment_def.py | 6 +- src/dv_flow_mgr/package_def.py | 53 ++++++------- src/dv_flow_mgr/package_import_spec.py | 31 ++++++++ src/dv_flow_mgr/session.py | 68 +++++++++++++---- src/dv_flow_mgr/share/flow.json | 15 ++-- src/dv_flow_mgr/task.py | 3 + src/dv_flow_mgr/task_def.py | 2 +- .../tasklib/hdl/sim/mti_task_sim_image.py | 6 +- src/dv_flow_mgr/tasklib/hdl/sim/vcs_pkg.py | 14 ++++ .../tasklib/hdl/sim/vcs_task_sim_image.py | 49 ++++++++++++ .../tasklib/hdl/sim/vcs_task_sim_run.py | 45 +++++++++++ .../tasklib/hdl/sim/vl_task_sim_image.py | 4 +- .../tasklib/hdl/sim/vlt_task_sim_run.py | 2 +- 16 files changed, 402 insertions(+), 63 deletions(-) create mode 100644 docs/Roadmap.md create mode 100644 src/dv_flow_mgr/package_import_spec.py create mode 100644 src/dv_flow_mgr/tasklib/hdl/sim/vcs_pkg.py create mode 100644 src/dv_flow_mgr/tasklib/hdl/sim/vcs_task_sim_image.py create mode 100644 src/dv_flow_mgr/tasklib/hdl/sim/vcs_task_sim_run.py diff --git a/docs/Notes.md b/docs/Notes.md index c520625..6a1d122 100644 --- a/docs/Notes.md +++ b/docs/Notes.md @@ -160,4 +160,35 @@ package: # DV Flow Manager 1.0.0 - Packages and Fragments - Package Import -- \ No newline at end of file +- Python implementation of YAML-defined tasks +- Parameters and Properties +- Modifying the value of input parameters +- Strategy for tool-specific options +- Tasks for reusable sim-image components (sim-image, library, ip) +- Work-avoidance schemes for SV + +## Use Cases +- Compile simulation image (debug, optimized) +- Run user-specified simulations + +# DV Flow Manager 2.0.0 +- Package inheritance ("project templates") +- VSCode log browser - visualize task graph ; navigate / view individual task logs + - See execution times + - See which tasks performed real work (output of 'changed') +- Task/sub-graph execution delegation interface (implementation for LSF, SLURM, etc) +- + +# DV Flow Manager 3.0.0 + +# DV Flow Manager 4.0.0 +- VSCode flow-file development support (error checking, completion, navigation) +- VSCode run integration (launch run from VSCode ; monitor execution/completion) + +# DV Flow Manager 5.0.0 +- VSCode debug support (step through task graph ; inspect variable values) + + + + + diff --git a/docs/Roadmap.md b/docs/Roadmap.md new file mode 100644 index 0000000..f0dc72f --- /dev/null +++ b/docs/Roadmap.md @@ -0,0 +1,75 @@ + +# Flow Specification +The Flow Specification is comprised of the Flow YAML Schema and the +semantic definition of how task graphs defined using the flow specification +are evaluated. + +## 1.0.0 +- Package definition +- Package import +- Task definition + - "with" variable usage + - Operations on input and output data + - Operations on task parameters +- Package fragments + +## 2.0.0 +- Parameterized package definition and use +- Package "uses" (type/inheritance) +- Task "with"-data definition (tasks can add their own parameters) +- Task Groups / Sub-DAG + +## 3.0.0 +- JQ-based data extraction +- YAML task templates / expansions +- Support for annotating job requirements + +# Library + +## 1.0.0 +- Std + - Null (combine dependencies, set variables). Implements tasks that do not specify 'uses' + - Exec + - FileSet + - PyClass - implement a task as a Python class (load from a module) + +- HdlSim + - Library - creates a reusable simulator-specific library + - IP - create a reusable single-module IP library + - SimImage - creates a simulation image + - SimRun + + +## 2.0.0 +- Std + - DefineData (Declares a data structure to pass) + - Export - Captures the result of some task in a dedicated directory + +## 3.0.0 +- Std + - + +# DV Flow Manager + +## 1.0.0 +- Simple 'max-jobs' process scheduler + +## 2.0.0 +- Progress meter and status line to monitor builds (non-verbose) +- Multi-level mechanism for monitoring jobs + - High-level with a progress bar + - +- Log-creation feature that assembles a total log from per-task logs + +## 3.0.0 +- Provide link to source for error messages +- Improve debug logging + +## 4.0.0 +- Improve status display by allowing actions to signal count-like information (+pass, +fail) +- OpenTelemetry support + + +## 5.0.0 +- Need some form of site settings + diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 34ee685..6586053 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -60,16 +60,19 @@ simulate this module. tasks: - name: rtl type: std.FileSet - params: + with: + type: "systemVerilogSource" include: "*.sv" - name: sim-image type: hdl.sim.SimImage - depends: [rtl] + with: + - top: [top] + needs: [rtl] - name: sim-run type: hdl.sim.SimRun - depends: [sim-image] + needs: [sim-image] If we run the `dvfm run` command, DV Flow Manager will: @@ -80,6 +83,52 @@ If we run the `dvfm run` command, DV Flow Manager will: .. code-block:: bash - % dvfm run + % dvfm run sim-run -The command should complete successfully, and we should see the following \ No newline at end of file +This will compile the source, build a simulation image for module `top`, +and run the resulting image. Not too bad for 20-odd lines of build specification. + +A Bit More Detail +================= +Let's break this down just a bit: + +.. code-block:: yaml + + package: + name: my_design + + imports: + - name: hdl.sim.vlt + as: hdl.sim + +DV Flow Manager views the world as a series of *packages* that reference each +other and contain *tasks* to operate on sources within the *packages*. + +Here, we have declared a new package (my_design) and specified that it +references a built-in package named `hdl.sim.vlt`. This is a package that +implements tasks for performing HDL simulation with the Verilator simulator. + +Note that we specify an alias (hdl.sim) for the package when importing it. +This will allow us to easily swap in a different simulator without changing +anything else within our package definition. + +.. code-block:: yaml + :highlight: 8,12 + + package: + name: my_design + + imports: + - name: hdl.sim.vlt + as: hdl.sim + + tasks: + - name: rtl + type: std.FileSet + with: + type: "systemVerilogSource" + include: "*.sv" + +Our first task is to specify the sources we want to process. This is done +by specifying a `FileSet` task. The parameters of this task specify where +the task should look for sources and which sources it should include \ No newline at end of file diff --git a/src/dv_flow_mgr/fragment_def.py b/src/dv_flow_mgr/fragment_def.py index b9664b3..20220cf 100644 --- a/src/dv_flow_mgr/fragment_def.py +++ b/src/dv_flow_mgr/fragment_def.py @@ -23,11 +23,9 @@ import json from pydantic import BaseModel from typing import Any, Dict, List -from .flow import Flow from .package import Package -from .package_def import PackageImportSpec -from .task import TaskParamCtor -from .task_def import TaskDef, TaskSpec +from .package_import_spec import PackageImportSpec +from .task_def import TaskDef class FragmentDef(BaseModel): tasks : List[TaskDef] = dc.Field(default_factory=list) diff --git a/src/dv_flow_mgr/package_def.py b/src/dv_flow_mgr/package_def.py index 11c2c1c..1b06e97 100644 --- a/src/dv_flow_mgr/package_def.py +++ b/src/dv_flow_mgr/package_def.py @@ -24,36 +24,12 @@ from pydantic import BaseModel from typing import Any, Dict, List from .flow import Flow +from .fragment_def import FragmentDef from .package import Package +from .package_import_spec import PackageImportSpec, PackageSpec from .task import TaskParamCtor from .task_def import TaskDef, TaskSpec -@dc.dataclass -class PackageSpec(object): - name : str - params : Dict[str,Any] = dc.Field(default_factory=dict) - _fullname : str = None - - def get_fullname(self) -> str: - if self._fullname is None: - if len(self.params) != 0: - self._fullname = "%s%s}" % ( - self.name, - json.dumps(self.params, separators=(',', ':'))) - else: - self._fullname = self.name - return self._fullname - - def __hash__(self): - return hash(self.get_fullname()) - - def __eq__(self, value): - return isinstance(value, PackageSpec) and value.get_fullname() == self.get_fullname() - -@dc.dataclass -class PackageImportSpec(PackageSpec): - path : str = dc.Field(default=None, alias="from") - alias : str = dc.Field(default=None, alias="as") class PackageDef(BaseModel): name : str @@ -63,6 +39,8 @@ class PackageDef(BaseModel): imports : List[PackageImportSpec] = dc.Field(default_factory=list) fragments: List[str] = dc.Field(default_factory=list) + fragment_l : List['FragmentDef'] = dc.Field(default_factory=list, exclude=True) + # import_m : Dict['PackageSpec','Package'] = dc.Field(default_factory=dict) basedir : str = None @@ -90,8 +68,31 @@ def mkPackage(self, session, params : Dict[str,Any] = None) -> 'Package': basedir=self.basedir, depend_refs=task.depends) else: + # We use the Null task from the std package raise Exception("") ret.tasks[task.name] = ctor_t + for frag in self.fragment_l: + for task in frag.tasks: + if task.type is not None: + # Find package (not package_def) that implements this task + # Insert an indirect reference to that tasks's constructor + + # Only call getTaskCtor if the task is in a different package + task_t = task.type if isinstance(task.type, TaskSpec) else TaskSpec(task.type) + ctor_t = session.getTaskCtor(task_t, self) + + ctor_t = TaskParamCtor( + base=ctor_t, + params=task.params, + basedir=frag.basedir, + depend_refs=task.depends) + else: + # We use the Null task from the std package + raise Exception("") + if task.name in ret.tasks: + raise Exception("Task %s already defined" % task.name) + ret.tasks[task.name] = ctor_t + return ret diff --git a/src/dv_flow_mgr/package_import_spec.py b/src/dv_flow_mgr/package_import_spec.py new file mode 100644 index 0000000..0430f1f --- /dev/null +++ b/src/dv_flow_mgr/package_import_spec.py @@ -0,0 +1,31 @@ + +import pydantic.dataclasses as dc +import json +from typing import Dict, Any + +@dc.dataclass +class PackageSpec(object): + name : str + params : Dict[str,Any] = dc.Field(default_factory=dict) + _fullname : str = None + + def get_fullname(self) -> str: + if self._fullname is None: + if len(self.params) != 0: + self._fullname = "%s%s}" % ( + self.name, + json.dumps(self.params, separators=(',', ':'))) + else: + self._fullname = self.name + return self._fullname + + def __hash__(self): + return hash(self.get_fullname()) + + def __eq__(self, value): + return isinstance(value, PackageSpec) and value.get_fullname() == self.get_fullname() + +@dc.dataclass +class PackageImportSpec(PackageSpec): + path : str = dc.Field(default=None, alias="from") + alias : str = dc.Field(default=None, alias="as") \ No newline at end of file diff --git a/src/dv_flow_mgr/session.py b/src/dv_flow_mgr/session.py index 5c32ef6..3f3210a 100644 --- a/src/dv_flow_mgr/session.py +++ b/src/dv_flow_mgr/session.py @@ -24,6 +24,7 @@ import yaml import dataclasses as dc from typing import Any, Callable, Dict, List +from .fragment_def import FragmentDef from .package import Package from .package_def import PackageDef, PackageSpec from .task import Task,TaskSpec @@ -47,14 +48,15 @@ class Session(object): _task_list : List[Task] = dc.field(default_factory=list) _task_m : Dict[TaskSpec,Task] = dc.field(default_factory=dict) _task_id : int = 0 - _rundir_s : List[str] = dc.field(default_factory=list) def __post_init__(self): from .tasklib.std.pkg_std import PackageStd + from .tasklib.hdl.sim.vcs_pkg import VcsPackage from .tasklib.hdl.sim.vlt_pkg import VltPackage from .tasklib.hdl.sim.mti_pkg import MtiPackage self._pkg_m[PackageSpec("std")] = PackageStd("std") self._pkg_m[PackageSpec("hdl.sim.mti")] = MtiPackage("hdl.sim.mti") + self._pkg_m[PackageSpec("hdl.sim.vcs")] = VcsPackage("hdl.sim.vcs") self._pkg_m[PackageSpec("hdl.sim.vlt")] = VltPackage("hdl.sim.vlt") def load(self, root : str): @@ -73,27 +75,25 @@ def mkTaskGraph(self, task : str) -> Task: self._pkg_s.clear() self._task_m.clear() - self._rundir_s.clear() - self._rundir_s.append(self.rundir) - - return self._mkTaskGraph(task) + return self._mkTaskGraph(task, self.rundir) - def _mkTaskGraph(self, task : str, params : dict = None) -> Task: + def _mkTaskGraph(self, task : str, parent_rundir : str, params : dict = None) -> Task: elems = task.split(".") pkg_name = ".".join(elems[0:-1]) task_name = elems[-1] - self._rundir_s.append(os.path.join(self._rundir_s[-1], pkg_name, task_name)) - if pkg_name == "": if len(self._pkg_spec_s) == 0: raise Exception("No package context for %s" % task) pkg_spec = self._pkg_spec_s[-1] + pkg_name = pkg_spec.name else: pkg_spec = PackageSpec(pkg_name) + rundir = os.path.join(parent_rundir, pkg_name, task_name) + self._pkg_spec_s.append(pkg_spec) pkg = self.getPackage(pkg_spec) @@ -115,20 +115,19 @@ def _mkTaskGraph(self, task : str, params : dict = None) -> Task: self, params, depends) - task.rundir = self._rundir_s[-1] + task.rundir = rundir for i,d in enumerate(task.depend_refs): if d in self._task_m.keys(): task.depends.append(self._task_m[d]) else: print("mkTaskGraph: %s" % d) - task.depends.append(self._mkTaskGraph(d)) + task.depends.append(self._mkTaskGraph(d, parent_rundir)) self._task_m[task.name] = task self._pkg_s.pop() self._pkg_spec_s.pop() - self._rundir_s.pop() return task @@ -147,6 +146,7 @@ def _load_package(self, root : str, file_s : List[str]) -> PackageDef: file_s.append(root) ret = None with open(root, "r") as fp: + print("open %s" % root) doc = yaml.load(fp, Loader=yaml.FullLoader) if "package" not in doc.keys(): raise Exception("Missing 'package' key in %s" % root) @@ -167,13 +167,55 @@ def _load_package(self, root : str, file_s : List[str]) -> PackageDef: self._pkg_spec_s.append(PackageSpec(pkg.name)) print("pkg: %s" % str(pkg)) - - # TODO: read in fragments + + print("fragments: %s" % str(pkg.fragments)) + for spec in pkg.fragments: + self._load_fragment_spec(pkg, spec, file_s) self._pkg_spec_s.pop() file_s.pop() return pkg + + def _load_fragment_spec(self, pkg : PackageDef, spec : str, file_s : List[str]): + + # We're either going to have: + # - File path + # - Directory path + + if os.path.isfile(os.path.join(pkg.basedir, spec)): + self._load_fragment_file(pkg, spec, file_s) + elif os.path.isdir(os.path.join(pkg.basedir, spec)): + self._load_fragment_dir(pkg, os.path.join(pkg.basedir, spec), file_s) + else: + raise Exception("Fragment spec %s not found" % spec) + + + def _load_fragment_dir(self, pkg : PackageDef, dir : str, file_s : List[str]): + + for file in os.listdir(dir): + if os.path.isdir(os.path.join(dir, file)): + self._load_fragment_dir(pkg, os.path.join(dir, file), file_s) + elif os.path.isfile(os.path.join(dir, file)): + self._load_fragment_file(pkg, os.path.join(dir, file), file_s) + + def _load_fragment_file(self, pkg : PackageDef, file : str, file_s : List[str]): + + if file in file_s: + raise Exception("Recursive file processing @ %s: %s" % (file, ",".join(self._file_s))) + file_s.append(file) + + with open(file, "r") as fp: + doc = yaml.load(fp, Loader=yaml.FullLoader) + if "fragment" in doc.keys(): + # Merge the package definition + frag = FragmentDef(**(doc["fragment"])) + frag.basedir = os.path.dirname(file) + pkg.fragment_l.append(frag) + else: + print("Warning: file %s is not a fragment" % file) + + def getPackage(self, spec : PackageSpec) -> Package: pkg_spec = self._pkg_spec_s[-1] diff --git a/src/dv_flow_mgr/share/flow.json b/src/dv_flow_mgr/share/flow.json index b4d821a..f7af1c6 100644 --- a/src/dv_flow_mgr/share/flow.json +++ b/src/dv_flow_mgr/share/flow.json @@ -23,7 +23,6 @@ } ], "defs": { - "package-def": { "title": "Package Definition", "$$target": "#/defs/package-def", @@ -156,21 +155,23 @@ "$ref": "#/defs/param" } }, - "depends": { - "oneOf": [ - { + "oneOf": [ + { + "needs": { "type": "array", "items": { "$ref": "#/defs/task-dep" } - }, { + } + }, { + "needs": { "type": "array", "items": { "type": "string" } } - ] - } + } + ] } } } diff --git a/src/dv_flow_mgr/task.py b/src/dv_flow_mgr/task.py index 75dc419..8ab20cb 100644 --- a/src/dv_flow_mgr/task.py +++ b/src/dv_flow_mgr/task.py @@ -143,6 +143,9 @@ def getMemento(self, T) -> TaskMemento: def setMemento(self, memento : TaskMemento): self.memento = memento + async def isUpToDate(self, memento) -> bool: + return False + async def do_run(self) -> TaskData: print("do_run: %s - %d depends" % (self.name, len(self.depends))) if len(self.depends) > 0: diff --git a/src/dv_flow_mgr/task_def.py b/src/dv_flow_mgr/task_def.py index 8f1abb2..27c7a5b 100644 --- a/src/dv_flow_mgr/task_def.py +++ b/src/dv_flow_mgr/task_def.py @@ -33,7 +33,7 @@ class TaskDef(BaseModel): """Holds definition information (ie the YAML view) for a task""" name : str type : (str|TaskSpec) = dc.Field(default_factory=list) - depends : List[(str|TaskSpec)] = dc.Field(default_factory=list) + depends : List[(str|TaskSpec)] = dc.Field(default_factory=list, alias="needs") params: Dict[str,Any] = dc.Field(default_factory=dict, alias="with") def copy(self) -> 'TaskDef': diff --git a/src/dv_flow_mgr/tasklib/hdl/sim/mti_task_sim_image.py b/src/dv_flow_mgr/tasklib/hdl/sim/mti_task_sim_image.py index 0476078..96eedfe 100644 --- a/src/dv_flow_mgr/tasklib/hdl/sim/mti_task_sim_image.py +++ b/src/dv_flow_mgr/tasklib/hdl/sim/mti_task_sim_image.py @@ -15,10 +15,10 @@ class TaskMtiSimImage(VlTaskSimImage): def getRefTime(self): - if os.path.isdir(os.path.join(self.rundir, 'work.d')): + if os.path.isfile(os.path.join(self.rundir, 'work.d')): return os.path.getmtime(os.path.join(self.rundir, 'work.d')) else: - raise Exception("work.d not found") + raise Exception("work.d not found (%s)") async def build(self, files : List[str], incdirs : List[str]): if not os.path.isdir(os.path.join(self.rundir, 'work')): @@ -53,7 +53,7 @@ async def build(self, files : List[str], incdirs : List[str]): await proc.wait() with open(os.path.join(self.rundir, 'work.d'), "w") as fp: - pass + fp.write("\n") if proc.returncode != 0: raise Exception("Questa opt failed") diff --git a/src/dv_flow_mgr/tasklib/hdl/sim/vcs_pkg.py b/src/dv_flow_mgr/tasklib/hdl/sim/vcs_pkg.py new file mode 100644 index 0000000..782d33b --- /dev/null +++ b/src/dv_flow_mgr/tasklib/hdl/sim/vcs_pkg.py @@ -0,0 +1,14 @@ +import dataclasses as dc +from .pkg_hdl_sim import PackageHdlSim +from .vcs_task_sim_image import TaskVcsSimImageCtor +from .vcs_task_sim_run import TaskVcsSimRunCtor + +@dc.dataclass +class VcsPackage(PackageHdlSim): + + def __post_init__(self): + print("PackageVcs::__post_init__", flush=True) + self.tasks["SimImage"] = TaskVcsSimImageCtor() + self.tasks["SimRun"] = TaskVcsSimRunCtor() + pass + diff --git a/src/dv_flow_mgr/tasklib/hdl/sim/vcs_task_sim_image.py b/src/dv_flow_mgr/tasklib/hdl/sim/vcs_task_sim_image.py new file mode 100644 index 0000000..d510e2c --- /dev/null +++ b/src/dv_flow_mgr/tasklib/hdl/sim/vcs_task_sim_image.py @@ -0,0 +1,49 @@ +import os +import fnmatch +import dataclasses as dc +from ....fileset import FileSet +from ....package import TaskCtor +from ....task import Task, TaskParams, TaskCtorT +from ....task_data import TaskData +from ....task_memento import TaskMemento +from .vl_task_sim_image import VlTaskSimImage, VlTaskSimImageParams, VlTaskSimImageMemento +from typing import List, Tuple + +from svdep import FileCollection, TaskCheckUpToDate, TaskBuildFileCollection + +@dc.dataclass +class TaskVcsSimImage(VlTaskSimImage): + + def getRefTime(self): + if os.path.isdir(os.path.join(self.rundir, 'simv')): + return os.path.getmtime(os.path.join(self.rundir, 'simv')) + else: + raise Exception + + async def build(self, files : List[str], incdirs : List[str]): + cmd = ['vcs', '-sverilog'] + + for incdir in incdirs: + cmd.append('+incdir+%s' % incdir) + + cmd.extend(files) + + if len(self.params.top): + cmd.extend(['-top', "+".join(self.params.top)]) + + proc = await self.session.create_subprocess(*cmd, + cwd=self.rundir) + await proc.wait() + + if proc.returncode != 0: + raise Exception("VCS simv failed") + +class TaskVcsSimImageParams(VlTaskSimImageParams): + pass + +class TaskVcsSimImageMemento(VlTaskSimImageMemento): + pass + +class TaskVcsSimImageCtor(TaskCtorT): + def __init__(self): + super().__init__(TaskVcsSimImageParams, TaskVcsSimImage) diff --git a/src/dv_flow_mgr/tasklib/hdl/sim/vcs_task_sim_run.py b/src/dv_flow_mgr/tasklib/hdl/sim/vcs_task_sim_run.py new file mode 100644 index 0000000..32109a1 --- /dev/null +++ b/src/dv_flow_mgr/tasklib/hdl/sim/vcs_task_sim_run.py @@ -0,0 +1,45 @@ +import os +import fnmatch +import pydantic.dataclasses as dc +from ....fileset import FileSet +from ....package import TaskCtor +from ....task import Task, TaskParams, TaskCtorT +from ....task_data import TaskData +from ....task_memento import TaskMemento +from typing import List, Tuple + +class TaskVcsSimRun(Task): + + async def run(self, input : TaskData) -> TaskData: + vl_fileset = input.getFileSets("simBinary") + + build_dir = vl_fileset[0].basedir + + cmd = [ + os.path.join(build_dir, 'simv'), + ] + + fp = open(os.path.join(self.rundir, 'sim.log'), "w") + proc = await self.session.create_subprocess(*cmd, + cwd=self.rundir, + stdout=fp) + + await proc.wait() + + fp.close() + + output = TaskData() + output.addFileSet(FileSet(src=self.name, type="simRunDir", basedir=self.rundir)) + + return output + +class TaskVcsSimRunParams(TaskParams): + pass + +class TaskVcsSimRunMemento(TaskMemento): + pass + +class TaskVcsSimRunCtor(TaskCtorT): + def __init__(self): + super().__init__(TaskVcsSimRunParams, TaskVcsSimRun) + diff --git a/src/dv_flow_mgr/tasklib/hdl/sim/vl_task_sim_image.py b/src/dv_flow_mgr/tasklib/hdl/sim/vl_task_sim_image.py index d621f6a..490f9a7 100644 --- a/src/dv_flow_mgr/tasklib/hdl/sim/vl_task_sim_image.py +++ b/src/dv_flow_mgr/tasklib/hdl/sim/vl_task_sim_image.py @@ -41,7 +41,7 @@ async def run(self, input : TaskData) -> TaskData: info = FileCollection.from_dict(ex_memento.svdeps) in_changed = not TaskCheckUpToDate(files, incdirs).check(info, ref_mtime) except Exception as e: - print("Unexpected output-directory format. Rebuilding") + print("Unexpected output-directory format (%s). Rebuilding" % str(e)) shutil.rmtree(self.rundir) os.makedirs(self.rundir) in_changed = True @@ -56,7 +56,7 @@ async def run(self, input : TaskData) -> TaskData: await self.build(files, incdirs) output = TaskData() - output.addFileSet(FileSet(src=self.name, type="verilatorBinary", basedir=self.rundir)) + output.addFileSet(FileSet(src=self.name, type="simDir", basedir=self.rundir)) output.changed = in_changed self.setMemento(memento) diff --git a/src/dv_flow_mgr/tasklib/hdl/sim/vlt_task_sim_run.py b/src/dv_flow_mgr/tasklib/hdl/sim/vlt_task_sim_run.py index d1715c1..acf6ab3 100644 --- a/src/dv_flow_mgr/tasklib/hdl/sim/vlt_task_sim_run.py +++ b/src/dv_flow_mgr/tasklib/hdl/sim/vlt_task_sim_run.py @@ -11,7 +11,7 @@ class TaskVltSimRun(Task): async def run(self, input : TaskData) -> TaskData: - vl_fileset = input.getFileSets("verilatorBinary") + vl_fileset = input.getFileSets("simBinary") build_dir = vl_fileset[0].basedir