File size: 1,368 Bytes
684db41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
read_rtlil <<EOF
attribute \top 1
module \top
  wire input 1 \clk
  wire inout 2 \port_b_0__io__io
  wire inout 3 \port_b_1__io__io
  wire width 8 input 4 \payload

  wire width 4 \o
  wire width 4 $5
  wire width 2 \o[0]
  wire width 2 \o[1]
  wire width 2 \o1

  cell \SB_IO \buf0
    parameter \IO_STANDARD "SB_LVCMOS"
    parameter \PULLUP 1
    parameter \PIN_TYPE 6'110001
    connect \OUTPUT_CLK \clk
    connect \D_OUT_0 \o [0]
    connect \D_OUT_1 \o1 [0]
    connect \OUTPUT_ENABLE 1'1
    connect \PACKAGE_PIN \port_b_0__io__io
  end
  cell \SB_IO \buf1
    parameter \IO_STANDARD "SB_LVCMOS"
    parameter \PULLUP 1
    parameter \PIN_TYPE 6'110001
    connect \OUTPUT_CLK \clk
    connect \D_OUT_0 \o [1]
    connect \D_OUT_1 \o1 [1]
    connect \OUTPUT_ENABLE 1'1
    connect \PACKAGE_PIN \port_b_1__io__io
  end
  cell \SB_DFF \dffsb0
    connect \C \clk
    connect \D \o [2]
    connect \Q \o1 [0]
  end
  cell \SB_DFF \dffsb1
    connect \C \clk
    connect \D \o [3]
    connect \Q \o1 [1]
  end
  cell $dff $dff
    parameter \WIDTH 4
    parameter \CLK_POLARITY 1
    connect \D $5
    connect \CLK \clk
    connect \Q \o
  end

  process $1
    assign $5 [1:0] { \payload [6] \payload [7] }
    assign $5 [3:2] { \payload [6] \payload [7] }
  end

  connect \o[0] \o [1:0]
  connect \o[1] \o [3:2]
end
EOF

synth_ice40
logger -expect-no-warnings