diff options
Diffstat (limited to 'example/interesting.v')
-rw-r--r-- | example/interesting.v | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/example/interesting.v b/example/interesting.v new file mode 100644 index 0000000..c76f92a --- /dev/null +++ b/example/interesting.v @@ -0,0 +1,36 @@ +module top(a, x); + reg [3:0] tmp; + input [3:0] a; + output reg [3:0] x; + + always @* begin + x = tmp; + tmp = a; + end +endmodule // top + +`ifndef SYNTHESIS +/* Generated by Yosys 0.9+2406 (git sha1 000fd08198, clang++ 7.1.0 -fPIC -Os) */ +module top_synth(a, x); + input [3:0] a; + wire [3:0] tmp; + output [3:0] x; + assign tmp = a; + assign x = a; +endmodule + +module main; + reg [3:0] a; + wire [3:0] x, x_synth; + + top top(a, x); + top_synth top_synth(a, x_synth); + + initial begin + a = 0; + #10 a = 1; + #10 $display("x: %d\nx_synth: %d", x, x_synth); + $finish; + end +endmodule +`endif |