aboutsummaryrefslogtreecommitdiff
path: root/src/test/resources/blackboxes/LargeParamTester.fir
blob: 81d9dd2b5380cb32cbedf482de27d476295cf873 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
; SPDX-License-Identifier: Apache-2.0
circuit LargeParamTester :
  extmodule LargeParam :
    output out : UInt<1>

    defname = LargeParamUnsigned
    parameter WIDTH = 1
    parameter DATA = 0

  extmodule LargeParam_1 :
    output out : UInt<128>

    defname = LargeParamUnsigned
    parameter WIDTH = 128
    parameter DATA = 9223372036854775807000

  extmodule LargeParam_2 :
    output out : SInt<128>

    defname = LargeParamSigned
    parameter WIDTH = 128
    parameter DATA = -9223372036854775807000

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

    inst mod1 of LargeParam
    inst mod2 of LargeParam_1
    inst mod3 of LargeParam_2

    when not(reset) :
      when neq(mod1.out, UInt(0)) :
        printf(clock, UInt(1), "Assertion failed\nTest Failed!\n")
        stop(clock, UInt(1), 1)
      when neq(mod2.out, UInt<128>(9223372036854775807000)) :
        printf(clock, UInt(1), "Assertion failed\nTest Failed!\n")
        stop(clock, UInt(1), 1)
      when neq(mod3.out, SInt<128>(-9223372036854775807000)) :
        printf(clock, UInt(1), "Assertion failed\nTest Failed!\n")
        stop(clock, UInt(1), 1)
      stop(clock, UInt(1), 0)