aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/blackboxes/SimpleExtModuleTester.fir
blob: 892f593b216fb867b6db6fd5cd4a005ba1f0d6f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
; SPDX-License-Identifier: Apache-2.0
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)