From 3102468806e3f1d03ced81d5a896f52fceb5db0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Nguyen?= Date: Fri, 1 Apr 2022 17:10:19 +0200 Subject: [PATCH] dut: add processor interface. --- power_fv/__init__.py | 8 ++++++++ power_fv/dut.py | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 power_fv/dut.py diff --git a/power_fv/__init__.py b/power_fv/__init__.py index 45b5fd1..b55b1ca 100644 --- a/power_fv/__init__.py +++ b/power_fv/__init__.py @@ -1,2 +1,10 @@ from importlib import metadata __version__ = metadata.version(__package__) + + +from .dut import * + + +__all__ = [ + "Interface", +] diff --git a/power_fv/dut.py b/power_fv/dut.py new file mode 100644 index 0000000..ba071ce --- /dev/null +++ b/power_fv/dut.py @@ -0,0 +1,22 @@ +from amaranth import * + + +__all__ = ["Interface"] + + +class Interface(Record): + """POWER-FV interface. + + The interface between the formal testbench and the processor-under-test. + + Attributes + ---------- + stb : Signal + Instruction strobe. Asserted when the processor retires an instruction. Other signals are + only valid when ``stb`` is asserted. + """ + def __init__(self, *, name=None, src_loc_at=0): + layout = [ + ("stb", 1), + ] + super().__init__(layout, name=name, src_loc_at=1 + src_loc_at)