3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-06 14:24:08 +00:00

tristate example

This commit is contained in:
Matt Venn 2022-06-13 13:51:04 +02:00
parent a200043709
commit b42b6445b8
3 changed files with 50 additions and 0 deletions

View file

@ -0,0 +1,13 @@
# Tristate demo
Run
sby -f tristate.sby pass
to run the pass task. This uses the top module that exclusively enables each of the submodules.
Run
sby -f tristate.sby fail
to run the fail task. This uses the top module that allows submodule to independently enable its tristate outputs.

View file

@ -0,0 +1,19 @@
[tasks]
pass
fail
[options]
mode prove
depth 5
[engines]
smtbmc
[script]
read -sv tristates.v
pass: prep -top top_pass
fail: prep -top top_fail
flatten; tribuf -formal
[files]
tristates.v

View file

@ -0,0 +1,18 @@
`default_nettype none
module module1 (input wire active, output wire tri_out);
assign tri_out = active ? 1'b0 : 1'bz;
endmodule
module module2 (input wire active, output wire tri_out);
assign tri_out = active ? 1'b0 : 1'bz;
endmodule
module top_pass (input wire clk, input wire active1, input wire active2, output wire out);
module1 module1 (.active(active1), .tri_out(out));
module2 module2 (.active(!active1), .tri_out(out));
endmodule
module top_fail (input wire clk, input wire active1, input wire active2, output wire out);
module1 module1 (.active(active1), .tri_out(out));
module2 module2 (.active(active2), .tri_out(out));
endmodule