1 / 69

数字集成电路验证方法学

数字集成电路验证方法学. 2013 年 12 月 31 日. 主要内容. 验证的必要性 验证方法学介绍 验证工具介绍 演示. 主要内容. 验证的必要性 验证方法学介绍 验证工具介绍 演示. 验证的必要性. 验证的概念,验证与测试的区别。 经验表明,验证已经占到整个产品开发周期的 70% 以上,它已经成为复杂 SOC ( System on-Chip )开发中的 重要壁垒。 制造、设计和验证能力之间的鸿沟. 典型流程. 动态仿真正确. 动态仿真正确. 时序 不满足. 时序 不满足. 功能正确. 系统结构. 不合理. 系统功能. 不满足.

Download Presentation

数字集成电路验证方法学

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 数字集成电路验证方法学 2013年12月31日

  2. 主要内容 • 验证的必要性 • 验证方法学介绍 • 验证工具介绍 • 演示 共69页

  3. 主要内容 • 验证的必要性 • 验证方法学介绍 • 验证工具介绍 • 演示 共69页

  4. 验证的必要性 • 验证的概念,验证与测试的区别。 • 经验表明,验证已经占到整个产品开发周期的70%以上,它已经成为复杂SOC(System on-Chip)开发中的 重要壁垒。 • 制造、设计和验证能力之间的鸿沟 共69页

  5. 典型流程 动态仿真正确 动态仿真正确 时序 不满足 时序 不满足 功能正确 系统结构 不合理 系统功能 不满足 功能 不正确 Verification is not just very hard, it is very, very hard没有一个简单的工具可以解决你所有的验证问题。(VSIA,Virtual Socket Interface Alliance) 系统规划满足 共69页

  6. 主要内容 • 验证的必要性 • 验证方法学介绍 • 验证工具介绍 • 演示 共69页

  7. 验证方法学 • 方法学:又称方法论,是一门学问采用的方法、规则与公理;一种特定的做法或一套做法。 • 验证方法学:指完成验证过程中的一系列方法、技术和规范。 • 1.仿真技术 • 2.静态技术 • 3.物理验证 共69页

  8. 仿真技术 • 基于事件的仿真--任何一个输入的变化都被标记为事件,即常说的功能仿真,精度高,速度慢。比如Modelsim, VCS。 • 基于周期的仿真--单周期内只检查一次输入并计算设计的输出逻辑值。速度快,无时序、毛刺。比如Cyclone。 • 事务级仿真--一堆事件的集合即为事务,即常说的验证平台。 • 软硬件协同验证--需要专门的软硬件,成本高 。 共69页

  9. 传统验证系统 • DUT:Design Under Test • 适用于基于事件的仿真和基于周期的仿真。 • 适用于简单的设计。 • 缺点: • 1.可扩展性差 • 2.可重用性差 共69页

  10. 层次化的验证系统 • 适用于事务级仿真 • 优点: • 1.可扩展性好 • 2.可重用性好 共69页

  11. 为什么要用事务级仿真? 基于事件的仿真与事务级仿真的比较 共69页

  12. 事务级仿真 • RVM: Reference Verification Methodology, Synopsys公司。 • VMM:Verification Methodology Manual, ARM公司和Synopsys公司。 • AVM:Advanced Verification Methodology, Mentor公司。 • OVM:Open Verification Methodology, Cadence公司和Mentor公司 • UVM: Universal Verification Methodology, Cadence公司 共69页

  13. 为什么选用OVM? 各种验证方法学比较 共69页

  14. SystemVerilog介绍 • SystemVerilog结合了Verilog和C++的概念,具有如下新功能: • 1.面向对象编程(OOP) 、 • 2.随机约束(Constraint Random)、 • 3.断言(Assertion) 、 • 4.功能覆盖率(Functional Coverage) 。 共69页

  15. SystemVerilog介绍-面向对象编程 • OOP:Object-oriented programming • 类:定义实物的抽象特点, 包含方法和属性。 • 对象:类的实例。 • 方法:类的行为。 • 继承:子类包含类的特性。 共69页

  16. SystemVerilog介绍-随机约束 CRT:Constraint Random Test class my_transaction extends ovm_transaction; rand int data_i; constraint c_data_i { data_i >= 0; data_i < 262144; } virtual function void randomize_(); data_i = $random & 18'h3ffff; endfunction 共69页

  17. SystemVerilog介绍-断言 Assertion 示例 property p10; @(posedge clock) (io.data_check_o<=data_out_design_for_check+2)&&(io.data_check_o>=data_out_design_for_check-2); endproperty a10: assert property (p10); 共69页

  18. SystemVerilog介绍-功能覆盖率 • Functional Coverage • covergroup:覆盖率模型 • sample():采样函数 • bins: 仓 Covergroup Covkind; coverpoint tr.kind{ //kind 为4位数据 bins zero={0}; bins hi[ ] = {[8:$]};}; endgroup 共69页

  19. OVM介绍 • OVM是一种基于SystemVerilog的验证方法或者策略。OVM已经实现了一个基本的层次化验证平台,大大简化验证工程师的工作量。 • OVM可以验证HDL代码或者网表文件 • OVM特点: 1.开放性:支持所有验证工具 2.开源:OVM库都是基于SystemVerilog实现 的,可以在网上下载。 3.可靠性:两大公司共同开发维护 共69页

  20. OVM结构 • ovm_env • ovm_sequecer • ovm_agent • ovm_transcation • ovm_scoreboard • ovm_driver • ovm_monitor 共69页

  21. 静态技术 • 语法检查--用户可以自由控制需要检查的规则,如代码风格,可综合检查,DFT检查。 nlint工具。 • 静态时序分析--检查建立、保持时间以及其他延时信息是否满足设计时序要求。 Prime Time。 • 形式验证—不考虑时序信息,通常用于验证两个设计是否在功能上等效。 Formality 工具。 共69页

  22. 静态时序分析 一般来说,要分析或检验一个电路设计的时序方面的特征有两种主要手段:动态时序仿真(Dynamic Timing Simulation)和静态时序分析(Static Timing Analysis) 1.动态时序仿真:利用仿真器和延迟文件,通过反标节点延迟信息来仿真。 优点:可直观查看波形;缺点:速度慢,看不到关键路径。 2.静态时序分析:分析每条时间路径上的延迟,来查看是否存在setup/hold违反。 优点:分析速度比较快,全面;缺点:不能查看功能是否正确。 共69页

  23. 形式验证 • 所谓形式验证,就是通过比较两个设计在逻辑功能是否等同的方法来验证电路的功能。 • 优点: 1.不依赖于测试矢量,因此能提供更完全的验证; 2.可以实现RTL-to-RTL、RTL-to-gate、gate-to-gate两者之间的验证; 3.有定位功能,可以帮助你找出两个设计之间功能不等同的原因; 4.可以使用的文件格式有VHDL、Verilog、Synopsys 的.db格式,以及EDIF网表等; 5.可以实现自动的分层验证; 共69页

  24. 物理验证--版图级 • 电源电压降 • 电迁移 • 功耗 Astro布局布线工 • 天线效应 具中完成 • 串扰 共69页

  25. 主要内容 • 验证的必要性 • 验证方法学介绍 • 验证工具介绍 • 演示 共69页

  26. 如何利用OVM完成验证? 共69页

  27. 基于OVM的数字滤波器验证平台 输入信号 • 数模转化器(DAC)中的数字插值滤波器做为此验证平台的DUT • 数字插值滤波器的功能: 1.提高采样频率 2. 滤除带外(带宽20KHz)噪声 输出信号 共69页

  28. 传统的滤波器验证平台仿真结果 • 传统的验证平台:基于定向测试矢量+波形查看的方式 共69页

  29. 传统验证平台没找到BUG的原因 1.仿真时间没有足够长 2.借助波形来判断 3.没有与理想参考模型比较 基于OVM的验证平台 共69页

  30. OVM验证平台验证步骤 1.利用OVM库完成平台代码 2.启动验证工具 3.创建编译库 4.编译验证平台代码 5.启动仿真 共69页

  31. 利用OVM库完成平台代码 • 扩展OVM类 • 逐层完成: 1.接口 2.数据产生 3.驱动器 4.验证环境 5.比较器 共69页

  32. OVM平台--接口 interface io_if(); logic [17:0] data_i; logic [17:0] data_o; logic [17:0] data_check_o; modport dut_if(input data_i, output data_o);// DUT接口 modport check_if(input data_i, output data_check_o);// 比较器模块接口 Endinterface io_if my_io();//装载接口 module check(io_if.check_if io, input clock,rst,en); dut dut(.io(my_io), .clock(clock), .rst(rst), .en(rst_check)); check check(.io(my_io), .clock(clock), .rst(rst), .en(rst_check)) ; 共69页

  33. OVM平台—数据产生 class my_transaction extends ovm_transaction; rand int data_i; function new (string name = ""); super.new(name); endfunction: new //产生随机事件的约束条件 constraint c_data_i { data_i >= 0; data_i <262144; } virtual function void randomize_(); data_i = $random & 18'h3ffff; endfunction `ovm_object_utils_begin(my_transaction)//在程序中 `ovm_field_int(data_i, OVM_ALL_ON + OVM_DEC) `ovm_object_utils_end endclass: my_transaction 共69页

  34. OVM平台—驱动器 class my_driver extends ovm_driver;// `ovm_component_utils(my_driver)//注册本类,这个宏的结尾没有符号; virtual io_if v_io;//装载虚拟接口 ovm_get_port #(my_transaction) get_port;//装载与激励发生器通信的通道接口: function new(string name, ovm_component parent); super.new(name, parent); //〖建议〗验证程序中可写一些ovm_report_info的语句供提示用: ovm_report_info("", "Called my_driver::new");//在测试结果显示此函数被调用 endfunction: new 共69页

  35. function void build; super.build(); ovm_report_info("", "Called my_driver::build"); get_port = new("get_port", this);//初始化 endfunction : build virtual task run; ovm_report_info("", "Called my_driver::run"); forever begin my_transaction tx; #1600 get_port.get(tx);//从通道中取一个事件 ovm_report_info("",$psprintf("data_i = %2h",tx.data_i)); v_io.dut_if.data_i = tx.data_i; end endtask: run endclass: my_driver 共69页

  36. OVM平台—验证环境 class my_env extends ovm_env;// `ovm_component_utils(my_env)//注册本类 ovm_random_stimulus #(my_transaction) env_stimulus;//装载激励器 tlm_fifo #(my_transaction) env_fifo;//装载通道 my_driver env_driver;//装载驱动器 function new(string name = "my_env", ovm_component parent = null); super.new(name, parent); ovm_report_info("", "Called my_env::new"); endfunction: new 共69页

  37. virtual function void build; super.build(); ovm_report_info("", "Called my_env::build"); env_stimulus = new("env_stimulus", this);//初始化激励器 env_fifo = new("env_fifo", this);//初始化通道 env_driver = new("env.driver", this);//初始化驱动器 endfunction: build virtual function void connect;//设定连接关系 ovm_report_info("", "Called my_env::connect"); env_stimulus.blocking_put_port.connect(env_fifo.put_export);//激励器侧接口-放事件 env_driver.get_port.connect(env_fifo.get_export);//驱动器侧接口-取事件 endfunction: connect 共69页

  38. virtual function void configure;// ovm_report_info("", "Called my_env::configure"); env_stimulus.set_report_id_action("stimulus generation", OVM_NO_ACTION);//限制显示信息 endfunction: configure//你可删除上一行,看看有什么变化? task run(); ovm_report_info("","Called my_env::run"); endtask: run virtual function void report; ovm_report_info("", "Called my_env::report"); endfunction: report //在运行下面的run_test()函数时,以上函数将自动依次运行 endclass: my_env 共69页

  39. OVM平台—比较器 module check(io_if.check_if io, input clock,rst,en, input [17:0] data_out_design_for_check); wire [17:0] hcic_out; //参考模型 Hcic_full Hcic_full(clock, en, rst,io.data_i, hcic_out,); assign io.data_check_o= hcic_out; property p10; @(posedge clock) (io.data_check_o<=data_out_design_for_check+2)&&(io.data_check_o>=data_out_design_for_check-2)||io.data_check_o==0; endproperty a10: assert property (p10); endmodule 共69页

  40. OVM平台—顶层模块 `timescale 1ns/10ps module top; import ovm_pkg::*; import my_pkg::*; parameter clock_cycle = 100; bit clock; bit rst; bit rst_check; io_if my_io();//装载接口 dut dut(.io(my_io), .clock(clock), .rst(rst), .en(rst_check));//装载DUT check check(.io(my_io), .clock(clock), .rst(rst), .en(rst_check), .data_out_design_for_check(my_io.dut_if.data_o)); //〖建议〗在验证程序顶级模块中一般采用继承ovm_test的类包装继承 ovm_env的类 共69页

  41. class my_test extends ovm_test; `ovm_component_utils(my_test)//注册本类 my_env top_env;//装载环境-top_env function new(string name = "my_test", ovm_component parent = null); super.new(name, parent); ovm_report_info("", "Called my_test::new"); endfunction: new virtual function void build; super.build(); ovm_report_info("", "Called my_test::build"); top_env=new();//初始化 //〖建议〗在验证程序中可设定看门狗 set_global_timeout(1000000us); endfunction: build 共69页

  42. virtual function void connect; ovm_report_info("", "Called my_test::connect"); top_env.env_driver.v_io = my_io;//连接虚拟接口到驱动器的物理接口 endfunction: connect task run; my_transaction tx; tx = new(); ovm_report_info("", "Called my_test::run"); top_env.env_stimulus.generate_stimulus(tx, 2000000);//激励器产生20个事件 endtask: run endclass: my_test 共69页

  43. initial begin run_test(“my_test”); clock=0; rst=0; rst_check=0; #(32*clock_cycle) rst=1; end always #(clock_cycle/2) clock = ~clock; initialbegin $fsdbDumpfile("top.fsdb"); $fsdbDumpSVA; $fsdbDumpvars(0,top,"+all"); end endmodule: top 共69页

  44. 启动验证工具 • 利用mentor的questasim,界面和操作类似于modelsim • 环境变量source /opt/demo/questasim.env • 启动命令vsim& 共69页

  45. 脚本方式完成验证 • vlib dac_hcic //创建库 • vlog +acc -f ../rtl/ovm_rtl/compile_questa_sv.f -work dac_hcic -sv +cover // 编译整个验证平台 • vsim -c dac_hcic.top -sv_seed 100 -coverage -assertcover -assertdebug -sva -voptargs=“+acc” -pli /opt/springsoft/verdi/share/PLI/MODELSIM/LINUX/novas_fli.so //启动仿真 • view assertions //查看断言 • run -all //开始运行 • quit -sim // 结束仿真 共69页

  46. compile_questa_sv.f • +incdir+/home1t/opt/questasim/questasim/verilog_src/ovm-2.1.2/src • /home1t/opt/questasim/questasim/verilog_src/ovm-2.1.2/src/ovm_pkg.sv • +incdir+/home/liuxp/dac/rtl/ovm_rtl • +incdir+/home/liuxp/dac/rtl/dac_balise/dac_haf_cic • /home/liuxp/dac/rtl/ovm_rtl/ovm_start.sv 共69页

  47. 结果查看 断言结果查看 代码覆盖率查看 共69页

  48. 断言结果查看—Questasim下 共69页

  49. 代码断言结果查看—Verdi下 Verdi(另外一个软件,专门用作波形查看和调 试)下查看断言结果更加直观,箭头朝上就表示 断言通过,朝下表示断言失败。 共69页

  50. 代码覆盖率查看 共69页

More Related