Restructured Amaranth code to be able to import sibling modules

This commit is contained in:
2022-01-22 19:28:29 +01:00
parent 7780e14887
commit 4a2d2b4881
91 changed files with 518 additions and 356 deletions

View File

@@ -0,0 +1,30 @@
from typing import Callable
from ReBba.Components.ExiClock import ClockState
from amaranth import Const, Elaboratable, Signal
def empty():
yield None
def exiClockCycle(exiClock: Signal, AfterHigh: Callable = empty, AfterFalling: Callable = empty, AfterLow: Callable = empty, AfterRising: Callable = empty):
yield exiClock.eq(ClockState.HIGH)
yield
yield from AfterHigh()
yield
yield exiClock.eq(ClockState.FALLING)
yield from AfterFalling()
yield exiClock.eq(ClockState.LOW)
yield
yield from AfterLow()
yield
yield exiClock.eq(ClockState.RISING)
yield from AfterRising()
def resetDut(rst: Signal):
yield
yield rst.eq(Const(1))
yield
yield rst.eq(Const(0))
yield