Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using fault with magma.circuit.sequential #176

Open
rdaly525 opened this issue Nov 28, 2019 · 0 comments
Open

Using fault with magma.circuit.sequential #176

rdaly525 opened this issue Nov 28, 2019 · 0 comments

Comments

@rdaly525
Copy link

rdaly525 commented Nov 28, 2019

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 rdaly525 reopened this Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant