aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various/split_shiftx.v
blob: dfcea388065e0eae034f80350d9a38d0065c98eb (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
module split_shiftx_test01(i, s, o);
  wire [3:0] _0_;
  input [8:0] i;
  output [2:0] o;
  input [1:0] s;
  \$macc  #(
    .A_WIDTH(32'd4),
    .B_WIDTH(32'd0),
    .CONFIG(10'h282),
    .CONFIG_WIDTH(32'd10),
    .Y_WIDTH(32'd4)
  ) _1_ (
    .A({ 2'h3, s }),
    .B(),
    .Y(_0_)
  );
  \$shiftx  #(
    .A_SIGNED(32'd0),
    .A_WIDTH(32'd9),
    .B_SIGNED(32'd1),
    .B_WIDTH(32'd5),
    .Y_WIDTH(32'd3)
  ) _2_ (
    .A(i),
    .B({ 1'h0, _0_ }),
    .Y(o)
  );
endmodule

// Sign bit is 1
module split_shiftx_test02(i, s, o);
  wire [3:0] _0_;
  input [8:0] i;
  output [2:0] o;
  input [1:0] s;
  \$macc  #(
    .A_WIDTH(32'd4),
    .B_WIDTH(32'd0),
    .CONFIG(10'h282),
    .CONFIG_WIDTH(32'd10),
    .Y_WIDTH(32'd4)
  ) _1_ (
    .A({ 2'h3, s }),
    .B(),
    .Y(_0_)
  );
  \$shiftx  #(
    .A_SIGNED(32'd0),
    .A_WIDTH(32'd9),
    .B_SIGNED(32'd1),
    .B_WIDTH(32'd5),
    .Y_WIDTH(32'd3)
  ) _2_ (
    .A(i),
    .B({ 1'h1, _0_ }),
    .Y(o)
  );
endmodule

// Non constant $macc
module split_shiftx_test03(i, s, o);
  wire [3:0] _0_;
  input [8:0] i;
  output [2:0] o;
  input [1:0] s;
  \$macc  #(
    .A_WIDTH(32'd4),
    .B_WIDTH(32'd0),
    .CONFIG(10'h282),
    .CONFIG_WIDTH(32'd10),
    .Y_WIDTH(32'd4)
  ) _1_ (
    .A({ s, s }),
    .B(),
    .Y(_0_)
  );
  \$shiftx  #(
    .A_SIGNED(32'd0),
    .A_WIDTH(32'd9),
    .B_SIGNED(32'd1),
    .B_WIDTH(32'd5),
    .Y_WIDTH(32'd3)
  ) _2_ (
    .A(i),
    .B({ 1'h0, _0_ }),
    .Y(o)
  );
endmodule

// Wrong constant $macc
module split_shiftx_test04(i, s, o);
  wire [3:0] _0_;
  input [8:0] i;
  output [2:0] o;
  input [1:0] s;
  \$macc  #(
    .A_WIDTH(32'd4),
    .B_WIDTH(32'd0),
    .CONFIG(10'h282),
    .CONFIG_WIDTH(32'd10),
    .Y_WIDTH(32'd4)
  ) _1_ (
    .A({ 2'h2, s }),
    .B(),
    .Y(_0_)
  );
  \$shiftx  #(
    .A_SIGNED(32'd0),
    .A_WIDTH(32'd9),
    .B_SIGNED(32'd1),
    .B_WIDTH(32'd5),
    .Y_WIDTH(32'd3)
  ) _2_ (
    .A(i),
    .B({ 1'h0, _0_ }),
    .Y(o)
  );
endmodule