fault icon indicating copy to clipboard operation
fault copied to clipboard

Using fault with magma.circuit.sequential

Open rdaly525 opened this issue 5 years ago • 0 comments

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?

rdaly525 avatar Nov 28 '19 02:11 rdaly525