YosysHQ / sby

SymbiYosys (sby) -- Front-end for Yosys-based formal verification flows
Other
402 stars 74 forks source link

Blackbox #288

Closed AdamKeith1 closed 3 months ago

AdamKeith1 commented 3 months ago

Is there a means to blackbox modules in sby?

georgerennie commented 3 months ago

Yes, using the Yosys blackbox command in the scripts section. e.g. the following yosys script blackboxes the module bb, so it just exists in top as a cell with the blackbox attribute set and contents ignored.

read_verilog <<EOT
module top(input a, output y);
bb b(.a(a), .y(y));
endmodule

module bb(input a, output y);
assign y = !a;
endmodule
EOT

blackbox bb
prep -top top -flatten
show
AdamKeith1 commented 3 months ago

Do I actually need to include the SV in the [scripts] section or is that just for reference?

georgerennie commented 3 months ago

Oh thats just for reference. SBY is a wrapper around yosys, and the scripts section is just a set of yosys commands. You can see a list of available yosys commands by starting yosys (yosys on the command line) and running help.

I will also add that a lot of questions about language support etc are probably more likely to get responses if filed as issues on the main Yosys repo rather than SBY, as that is where the code for most stuff actually lies, however things relating to the actual SBY configuration files and formal engines are better placed here.

AdamKeith1 commented 3 months ago

Do you know if this works for vhdl modules as well or just SV?

georgerennie commented 3 months ago

Yosys makes no distinction internally, a module could have come from either SV or VHDL or something else, it works with a somewhat generic netlist representation.