aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/blackboxes/SimpleExtModuleTester.fir
blob: 7118ec9f4c76891e2a89b2aa84cb212036a5eae2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; See LICENSE for license details.
circuit SimpleExtModuleTester :
  extmodule SimpleExtModule :
    input foo : UInt<16>
    output bar : UInt<16>

  module SimpleExtModuleTester :
    input clock : Clock
    input reset : UInt<1>

    inst dut of SimpleExtModule

    dut.foo <= UInt(1234)

    when not(reset) :
      when neq(dut.bar, UInt(1234)) :
        printf(clock, not(reset), "Assertion failed\nTest Failed!\n")
        stop(clock, not(reset), 1)
      else :
        stop(clock, not(reset), 0)