Skip to content

Commit

Permalink
Add polarity test
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardt committed May 9, 2019
1 parent 46f1b7a commit 5d59c48
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_circuit/test_declare.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ def test_declare_simple():
And2 = m.DeclareCircuit("And2", "I0", m.In(m.Bit), "I1", m.In(m.Bit), "O",
m.Out(m.Bit))
assert isinstance(And2.I0, m.BitType)


def test_declare_interface_polarity():
And2Decl = m.DeclareCircuit("And2", "I0", m.In(m.Bit), "I1", m.In(m.Bit),
"O", m.Out(m.Bit))
And2Defn = m.DefineCircuit("And2", "I0", m.In(m.Bit), "I1", m.In(m.Bit),
"O", m.Out(m.Bit))

assert And2Decl.interface.ports["I0"].isinput() == \
And2Defn.interface.ports["I0"].isinput()

0 comments on commit 5d59c48

Please sign in to comment.