From ea6a264f0cc80abf198497293657d9c13e2616b8 Mon Sep 17 00:00:00 2001 From: Fischer Moseley <42497969+fischermoseley@users.noreply.github.com> Date: Wed, 27 Nov 2024 08:39:41 -0800 Subject: [PATCH] examples: determine divider.sv path at runtime --- examples/amaranth/ethernet_io_core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/amaranth/ethernet_io_core.py b/examples/amaranth/ethernet_io_core.py index e2919ac..b9319d6 100644 --- a/examples/amaranth/ethernet_io_core.py +++ b/examples/amaranth/ethernet_io_core.py @@ -1,3 +1,4 @@ +from pathlib import Path from time import sleep from amaranth import * @@ -44,7 +45,8 @@ class EthernetIOCoreExample(Elaboratable): ("i", "clk", ClockSignal()), ("o", "ethclk", ethclk.clk), ) - platform.add_file("divider.sv", open("../common/divider.sv")) + divider_sv_path = Path(__file__).parent / "../common/divider.sv" + platform.add_file("divider.sv", open(divider_sv_path)) # Add Manta as a submodule m.submodules.manta = DomainRenamer("ethclk")(self.manta)