examples: determine divider.sv path at runtime

This commit is contained in:
Fischer Moseley 2024-11-27 08:39:41 -08:00
parent 0421cf38c0
commit ea6a264f0c
1 changed files with 3 additions and 1 deletions

View File

@ -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)