fault
fault copied to clipboard
Using fault with magma.circuit.sequential
Creating a tester fails when the circuit is defined using circuit.sequential:
The following code snippet fails complaining about a bad type for CLK
import magma as m
from fault import Tester
def test_reg():
Data = m.Bits[16]
@m.circuit.sequential
class Reg:
def __init__(self):
self.value : Data = Data(0)
def __call__(self, in_: Data, en: m.Bit) -> Data:
retvalue = self.value
if en:
self.value =in_
else:
self.value = self.value
return retvalue
tester = Tester(Reg, Reg.CLK)
Is there a different way I am supposed to send the Tester the CLK port?