Exemple #1
0
def test_bit_flip():
    bout = Out(Bit)
    bin = In(Bit)
    assert bout == BitOut
    assert bin == BitIn

    bin = In(BitIn)
    bout = Out(BitIn)
    assert bout == BitOut
    assert bin == BitIn

    bin = In(BitOut)
    bout = Out(BitOut)
    assert bout == BitOut
    assert bin == BitIn

    bin = Flip(BitOut)
    bout = Flip(BitIn)
    assert bout == BitOut
    assert bin == BitIn
Exemple #2
0
def test_reset_flip():
    ResetOut = Out(Reset)
    assert isinstance(ResetOut, ResetKind)
    assert str(ResetOut) == 'Out(Reset)'

    ResetIn = In(Reset)
    assert isinstance(ResetIn, ResetKind)
    assert str(ResetIn) == 'In(Reset)'

    resetin = In(ResetIn)
    resetout = Out(ResetIn)
    assert resetout == ResetOut
    assert resetin == ResetIn

    resetin = In(ResetOut)
    resetout = Out(ResetOut)
    assert resetout == ResetOut
    assert resetin == ResetIn

    resetin = Flip(ResetOut)
    resetout = Flip(ResetIn)
    assert resetout == ResetOut
    assert resetin == ResetIn
Exemple #3
0
def test_enable_flip():
    EnableOut = Out(Enable)
    assert isinstance(EnableOut, EnableKind)
    assert str(EnableOut) == 'Out(Enable)'

    EnableIn = In(Enable)
    assert isinstance(EnableIn, EnableKind)
    assert str(EnableIn) == 'In(Enable)'

    enablein = In(EnableIn)
    enableout = Out(EnableIn)
    assert enableout == EnableOut
    assert enablein == EnableIn

    enablein = In(EnableOut)
    enableout = Out(EnableOut)
    assert enableout == EnableOut
    assert enablein == EnableIn

    enablein = Flip(EnableOut)
    enableout = Flip(EnableIn)
    assert enableout == EnableOut
    assert enablein == EnableIn
Exemple #4
0
def test_clock_flip():
    ClockOut = Out(Clock)
    assert isinstance(ClockOut, ClockKind)
    assert str(ClockOut) == 'Out(Clock)'

    ClockIn = In(Clock)
    assert isinstance(ClockIn, ClockKind)
    assert str(ClockIn) == 'In(Clock)'

    clockin = In(ClockIn)
    clockout = Out(ClockIn)
    assert clockout == ClockOut
    assert clockin == ClockIn

    clockin = In(ClockOut)
    clockout = Out(ClockOut)
    assert clockout == ClockOut
    assert clockin == ClockIn

    clockin = Flip(ClockOut)
    clockout = Flip(ClockIn)
    assert clockout == ClockOut
    assert clockin == ClockIn