Restructured Amaranth code to be able to import sibling modules
This commit is contained in:
30
re-bba/ReBba/TestBenches/SimHelpers/ExiSimHelper.py
Normal file
30
re-bba/ReBba/TestBenches/SimHelpers/ExiSimHelper.py
Normal 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
|
||||
Reference in New Issue
Block a user