Skip to content

Commit

Permalink
examples: determine divider.sv path at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
fischermoseley committed Nov 27, 2024
1 parent 0421cf3 commit ea6a264
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/amaranth/ethernet_io_core.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from pathlib import Path
from time import sleep

from amaranth import *
Expand Down Expand Up @@ -44,7 +45,8 @@ def elaborate(self, platform):
("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)
Expand Down

0 comments on commit ea6a264

Please sign in to comment.