diff --git a/dau_sim/integrations/cocotb.py b/dau_sim/integrations/cocotb.py index e932904..aae04a2 100644 --- a/dau_sim/integrations/cocotb.py +++ b/dau_sim/integrations/cocotb.py @@ -10,17 +10,19 @@ from __future__ import annotations from collections.abc import Mapping, Sequence -from dataclasses import dataclass from pathlib import Path +from pydantic import BaseModel, ConfigDict + DEFAULT_BUILD_ARGS = ("--timing", "-Wno-fatal") -@dataclass(frozen=True) -class CocotbProfile: +class CocotbProfile(BaseModel): """A registered cocotb bench: HDL sources, the toplevel they build, and the cocotb test module that drives it.""" + model_config = ConfigDict(frozen=True) + name: str sources: tuple[Path, ...] hdl_toplevel: str diff --git a/dau_sim/integrations/verilator_profiles.py b/dau_sim/integrations/verilator_profiles.py index 775d326..8cb8f6b 100644 --- a/dau_sim/integrations/verilator_profiles.py +++ b/dau_sim/integrations/verilator_profiles.py @@ -1,11 +1,13 @@ from __future__ import annotations -from dataclasses import dataclass from pathlib import Path +from pydantic import BaseModel, ConfigDict + + +class VerilatorProfile(BaseModel): + model_config = ConfigDict(frozen=True) -@dataclass(frozen=True) -class VerilatorProfile: name: str sources: tuple[Path, ...] top_module: str diff --git a/pyproject.toml b/pyproject.toml index f10a328..f1e000e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,6 +32,7 @@ classifiers = [ dependencies = [ "amaranth", "csp", + "pydantic", "pyslang", "typer", "rich",