Merge pull request #1814 from YosysHQ/mmicko/pyosys_makefile
[yosys.git] / tests / simple / paramods.v
1
2 module pm_test1(a, b, x, y);
3
4 input [7:0] a, b;
5 output [7:0] x, y;
6
7 inc #(.step(3)) inc_a (.in(a), .out(x));
8 inc #(.width(4), .step(7)) inc_b (b, y);
9
10 endmodule
11
12 // -----------------------------------
13
14 module pm_test2(a, b, x, y);
15
16 input [7:0] a, b;
17 output [7:0] x, y;
18
19 inc #(5) inc_a (.in(a), .out(x));
20 inc #(4, 7) inc_b (b, y);
21
22 endmodule
23
24 // -----------------------------------
25
26 module pm_test3(a, b, x, y);
27
28 input [7:0] a, b;
29 output [7:0] x, y;
30
31 inc inc_a (.in(a), .out(x));
32 inc inc_b (b, y);
33
34 defparam inc_a.step = 3;
35 defparam inc_b.step = 7;
36 defparam inc_b.width = 4;
37
38 endmodule
39
40 // -----------------------------------
41
42 module inc(in, out);
43
44 parameter width = 8;
45 parameter step = 1;
46
47 input [width-1:0] in;
48 output [width-1:0] out;
49
50 assign out = in + step;
51
52 endmodule
53