OBDD(Ordered Binary Decision Diagram)的最经典的范例就是时序电路的逻辑验证工具CMU SMV,根据SMV 新的开源实现(https://nusmv.fbk.eu/)完成如下工作: 1.下载安装并运行NuSMV,先跑自带的例子 2.进一步理解SMV如何基于OBDD来实现
操作过程:
1.打开网站,下载NuSMV-2.7.0-win64软件。
同时下载开源文件:abp4.smv,pci.smv,counter.smv三个文件
2.配置环境
3.运行自带开源文件
以最后一个开源示例解释:
C:\Users\haron>NuSMV D:\下载文件\NuSMV-2.7.0-win64\counter.smv
*** This is NuSMV 2.7.0 (compiled on Thu Oct 24 17:56:00 2024)
*** Enabled addons are: compass
*** For more information on NuSMV see http://nusmv.fbk.eu
*** or email to nusmv-users@list.fbk.eu.
*** Please report bugs to <Please report bugs to nusmv-users@fbk.eu>
*** Copyright © 2010-2024, Fondazione Bruno Kessler
*** This version of NuSMV is linked to the CUDD library version 2.4.1
*** Copyright © 1995-2004, Regents of the University of Colorado
*** This version of NuSMV is linked to the MiniSat SAT solver.
*** See http://minisat.se/MiniSat.html
*** Copyright © 2003-2006, Niklas Een, Niklas Sorensson
*** Copyright © 2007-2010, Niklas Sorensson
– specification AG (AF bit2.carry_out) is true
源文件:这是一个同步3位时序逻辑电路
MODULE main
VAR
bit0 : counter_cell(TRUE); //定义为0//
bit1 : counter_cell(bit0.carry_out); //定义为1//
bit2 : counter_cell(bit1.carry_out); //定义为2//
SPEC
AG AF bit2.carry_out //逢三为AG,表示True;否则为AF,表示False//
MODULE counter_cell(carry_in)
VAR
value : boolean; //布尔值//
ASSIGN
init(value) := FALSE;
next(value) := value xor carry_in; //异或操作//
DEFINE
carry_out := value & carry_in; //与操作//