首页 > 其他分享 >sv实验3

sv实验3

时间:2022-09-27 23:57:11浏览次数:46  
标签:rand tests name sv chnl 实验 basic test

 

 验证结构

 

 

 

 随机约束

实验3相比实验2引入了随机约束,主要体现在chnl_trans类中。实验2中的数据内容由generator的get_trans函数产生,而实验3在chnl_trans类产生。

class chnl_trans;
    rand bit[31:0] data[];
    rand int ch_id;
    rand int pkt_id;
    rand int data_nidles;
    rand int pkt_nidles;
    bit rsp;
    local static int obj_id = 0;
    // USER TODO 1.1.
    // Specify constraint to match the chnl_basic_test request
    constraint cstr{
      data.size inside {[4:8]};
      foreach(data[i]) data[i] == 'hC000_0000 + (this.ch_id<<24) + (this.pkt_id<<8) + i;
      soft ch_id == 0;
      soft pkt_id == 0;
      data_nidles inside {[0:2]};
      pkt_nidles inside {[1:10]};
    };
...
...

更加灵活的控制

 

2.6

 

  initial begin 
    basic_test = new();
    burst_test = new();
    fifo_full_test = new();
    tests["chnl_basic_test"] = basic_test;
    tests["chnl_burst_test"] = burst_test;
    tests["chnl_fifo_full_test"] = fifo_full_test;
    if($value$plusargs("TESTNAME=%s", name)) begin
      if(tests.exists(name)) begin
        tests[name].set_interface(chnl0_if, chnl1_if, chnl2_if);
        tests[name].run();
      end
      else begin
        $fatal($sformatf("[ERRTEST], test name %s is invalid, please specify a valid name!", name));
      end
    end
    else begin
      $display("NO runtime optiont TEST=[testname] is configured, and run default test chnl_basic_test");
      tests["chnl_basic_test"].set_interface(chnl0_if, chnl1_if, chnl2_if);
      tests["chnl_basic_test"].run(); 
    end
  end

通过仿真窗口的命令灵活运行test,避免了重复编译。

 

 测试平台的结构

标签:rand,tests,name,sv,chnl,实验,basic,test
From: https://www.cnblogs.com/ycz-/p/16736481.html

相关文章

  • Python第四章实验报告
    一.实验项目名称:《零基础学Python》第四章的14道实例和4道实战二.实验环境:IDLE(Python3.964-bit)三.实验目的和要求:熟练掌握Python序列的应用四.实验过程:实例01输出......
  • 实验3:OpenFlow协议分析实践
    基础要求一、拓扑文件#!/usr/bin/envpythonfrommininet.netimportMininetfrommininet.nodeimportController,RemoteController,OVSControllerfrommininet.......
  • 实验3:OpenFlow协议分析实践
    实验3:OpenFlow协议分析实践一、实验目的1.能够运用wireshark对OpenFlow协议数据交互过程进行抓包;2.能够借助包解析工具,分析与解释OpenFlow协议的数据包交互过程与......
  • 实验3 OpenFlow协议分时实践
    基础实验抓包分析step1:搭建拓扑并配置相应IPstep2:Pingall并抓包step3:分析(1)hello包表示含义:控制器6633端口发送“我最高能支持OpenFlow1.0”信息给交换机43826端......
  • 实验3:OpenFlow协议分析实践
    一、实验目的1.能够运用wireshark对OpenFlow协议数据交互过程进行抓包;2.能够借助包解析工具,分析与解释OpenFlow协议的数据包交互过程与机制。二、实验环境Ubuntu......
  • 实验3:OpenFlow协议分析实践
    实验3:OpenFlow协议分析实践一、实验要求1.基本要求(1)拓扑文件#!/usr/bin/envpythonfrommininet.netimportMininetfrommininet.nodeimportController,RemoteC......
  • Python实验报告(第四周
    一、实验目的和要求学会应用列表、元组、字典等序列;二、实验环境软件版本:Python3.1064_bit三、实验过程1、实例1:输出每日一贴(1)在IDLE中创建一个名称为tips.py的文......
  • 实验2:Open vSwitch虚拟交换机实践
    (一)基础要求执行ovs-vsctlshow命令、以及p0和p1连通性测试的执行结果截图开启MininetCLI并执行pingall命令的截图上述目录下查看OVS流表的命令结果截图wireshark......
  • 实验3:OpenFlow协议分析实践
    实验3:OpenFlow协议分析实践一、拓扑文件二、wireshark抓包分析(1)OFPT_HELLO控制器6633端口(最高支持OpenFlow1.0)--->交换机58074端口交换机58074端口(最高支持Open......
  • 实验3:OpenFlow协议分析实践
    一、基础要求032002205.py拓扑文件#!/usr/bin/envpythonfrommininet.netimportMininetfrommininet.nodeimportController,RemoteController,OVSControllerf......