=========================================== write_smt2 - write design to SMT-LIBv2 file =========================================== .. raw:: latex \begin{comment} .. cmd:def:: write_smt2 :title: write design to SMT-LIBv2 file .. code:: yoscrypt write_smt2 [options] [filename] :: Write a SMT-LIBv2 [1] description of the current design. For a module with name '' this will declare the sort '_s' (state of the module) and will define and declare functions operating on that state. The following SMT2 functions are generated for a module with name ''. Some declarations/definitions are printed with a special comment. A prover using the SMT2 files can use those comments to collect all relevant metadata about the design. ; yosys-smt2-module (declare-sort |_s| 0) The sort representing a state of module . (define-fun |_h| ((state |_s|)) Bool (...)) This function must be asserted for each state to establish the design hierarchy. ; yosys-smt2-input ; yosys-smt2-output ; yosys-smt2-register ; yosys-smt2-wire (define-fun |_n | (|_s|) (_ BitVec )) (define-fun |_n | (|_s|) Bool) For each port, register, and wire with the 'keep' attribute set an accessor function is generated. Single-bit wires are returned as Bool, multi-bit wires as BitVec. ; yosys-smt2-cell (declare-fun |_h | (|_s|) |_s|) There is a function like that for each hierarchical instance. It returns the sort that represents the state of the sub-module that implements the instance. (declare-fun |_is| (|_s|) Bool) This function must be asserted 'true' for initial states, and 'false' otherwise. (define-fun |_i| ((state |_s|)) Bool (...)) This function must be asserted 'true' for initial states. For non-initial states it must be left unconstrained. (define-fun |_t| ((state |_s|) (next_state |_s|)) Bool (...)) This function evaluates to 'true' if the states 'state' and 'next_state' form a valid state transition. (define-fun |_a| ((state |_s|)) Bool (...)) This function evaluates to 'true' if all assertions hold in the state. (define-fun |_u| ((state |_s|)) Bool (...)) This function evaluates to 'true' if all assumptions hold in the state. ; yosys-smt2-assert (define-fun |_a | ((state |_s|)) Bool (...)) Each $assert cell is converted into one of this functions. The function evaluates to 'true' if the assert statement holds in the state. ; yosys-smt2-assume (define-fun |_u | ((state |_s|)) Bool (...)) Each $assume cell is converted into one of this functions. The function evaluates to 'true' if the assume statement holds in the state. ; yosys-smt2-cover (define-fun |_c | ((state |_s|)) Bool (...)) Each $cover cell is converted into one of this functions. The function evaluates to 'true' if the cover statement is activated in the state. Options: .. code:: yoscrypt -verbose :: this will print the recursive walk used to export the modules. .. code:: yoscrypt -stbv :: Use a BitVec sort to represent a state instead of an uninterpreted sort. As a side-effect this will prevent use of arrays to model memories. .. code:: yoscrypt -stdt :: Use SMT-LIB 2.6 style datatypes to represent a state instead of an uninterpreted sort. .. code:: yoscrypt -nobv :: disable support for BitVec (FixedSizeBitVectors theory). without this option multi-bit wires are represented using the BitVec sort and support for coarse grain cells (incl. arithmetic) is enabled. .. code:: yoscrypt -nomem :: disable support for memories (via ArraysEx theory). this option is implied by -nobv. only $mem cells without merged registers in read ports are supported. call "memory" with -nordff to make sure that no registers are merged into $mem read ports. '_m' functions will be generated for accessing the arrays that are used to represent memories. .. code:: yoscrypt -wires :: create '_n' functions for all public wires. by default only ports, registers, and wires with the 'keep' attribute are exported. .. code:: yoscrypt -tpl :: use the given template file. the line containing only the token '%%' is replaced with the regular output of this command. .. code:: yoscrypt -solver-option