TestBench书写 .pptVIP

  • 9
  • 0
  • 约1.09万字
  • 约 43页
  • 2018-04-28 发布于福建
  • 举报
TestBench书写

TestBench的书写 TestBench的目标 TestBench的基本框架 书写TestBench的几种主要方法 HDL调试的主要方式 提高模拟验证效率的主要方法 综合前后模拟验证结果一致性的确定 TestBench的目标 测试、验证HDL代码的正确性; 测试、验证Design的功能、时序正确性; 待测试、验证的模块加载到模拟验证环境; 产生模拟验证所需的输入激励; 对输入激励码,构造出其对应的正确输出结果; 提供一种机制,自动判断Design的正确性 The Simulation Environment This is a simplified picture of the overall simulation environment. This section concentrates on testbench development strategies. HDL代码调试 输入激励码的产生方式 由其它硬件/软模型产生待验证模块所需的输入激励码; 用HDL代码生成(On-the-fly); 事先产生所需的输入激励码并存于相应的文件中,使用时从文件中读取 由其它硬件/软模型产生 待验证模块所需的输入激励码 优点: 能较全面模拟、验证Design在各种情形下的正确性; 自动产生待验证模块的输入激励码 易于管理、验证速度快 缺点: 必须有相应模块的硬件/软件模型支持; 必须有专门的验证环境支持; 代价昂贵 使用领域: 模型(Protocol)验证、系统模拟、设计投片前的确认。 用HDL代码生成DUT的输入激励码 注意事项: 将时钟信号、置/复位信号与其它信号分开并分别加以处理; 注意各种(各组)输入信号的时序关系; 注意所采用的延时表示方式(绝对延时/相对延时); 注意各种输入激励与时钟信号的关系 用HDL代码生成DUT的输入激励码 输入激励码产生方式: 用单独的always语句或assign赋值语句产生时钟信号; 用简单的initial语句块产生置/复位信号的激励; 在initial语句块中用循环语句块产生按一定规律变化的信号的激励码; 用Task过程产生特殊信号的输入激励; 用三态buffer产生或监控Bidirectional信号的激励; 必要时预估DUT的输出变化情形并加以比较 用HDL代码生成DUT的输入激励码 用HDL代码生成DUT的输入激励码 用HDL代码生成DUT的输入激励码 在initial语句块中用循环结构描述具有一定变化规则的输入激励信号 用HDL代码生成DUT的输入激励码 用HDL代码生成DUT的输入激励码 Using Verilog Tasks Use Verilog tasks in your testbench to encapsulate repeated operations. Using Concurrent Statements Use fork-join blocks in your testbench to concurrently activate parallel tasks. Applying Stimulus Some common stimulus application techniques include: In-line stimulus,applied from an initial block Stimulus applied from a loop or always block Stimulus applied from an array of vectors or integers Stimulus that is recorded during one simulation and played back in another simulation In-Line Stimulus In-line stimulus has the following characteristics: You list the variables only when their values change You can easily define complex timing relationships between signals The testbench can become very long for tests of real designs Stimulus From Loops Stimulus applied from a loop has the following characteristics: For each iteration you assign a new stimulus vector The timing re

文档评论(0)

1亿VIP精品文档

相关文档