Clock Verification IP

news2025/6/19 19:54:51

Clock Verification IP

IP 参数及接口

在这里插入图片描述

IP 例化界面

在这里插入图片描述

相关函数

start_clock

//产生时钟 
<hierarchy_path>.IF.start_clock

stop_clock

//停止时钟 
<hierarchy_path>.IF.stop_clock

set_initial_value

//设置时钟初始值为 0
<hierarchy_path>IF.set_initial_value(0)
//设置时钟初始值为 1
<hierarchy_path>IF.set_initial_value(1)

set_clk_prd

//设置时钟周期、占空比、抖动是能、抖动范围
<hierarchy_path>IF.set_clk_prd(
    .user_period(200),
    .user_duty_cycle(0.3),
    .user_jitter_on(1),
    .user_jitter_min_range(0.0),
    .user_jitter_max_range(0.01)
    );

set_clk_frq

//设置时钟频率、占空比、抖动是能、抖动范围
<hierarchy_path>IF.set_clk_prd(
    .user_frequency(10000000),
    .user_duty_cycle(0.3),
    .user_jitter_on(1),
    .user_jitter_min_range(0.0),
    .user_jitter_max_range(0.01)
    );

set_master_mode

//设置 CLK_VIP 模式为 Master
< hierarchy_path>.set_master_mode();

set_passthrough_mode

//设置 CLK_VIP 模式为 passthrough
< hierarchy_path>.set_passthrough_mode();

参考代码

`timescale 1ps / 1ps
`include "clk_monitor.sv"


module clk_vip_0_exdes_tb(
  );

  wire                                                                     clk_out;

  //Declare monitor for master CLK VIP 
  clk_monitor#(10.0)                                       mst_monitor;
  //Declare monitor for passthrough CLK VIP 
  clk_monitor#(10.0)                                       passthrough_monitor;

  initial begin

    /*******************************************************************************************   
    *    The hierarchy path of the CLK VIP's interface is passed to the monitor when it is newed
    *    construct mst_monitor and assign the master clk vip interface to its virtual interface
    *    construct passthrough_monitor and assign the passthrough clk vip interface to its
    *    virtual interface
    *******************************************************************************************/
    mst_monitor =new("Clk mst_monitor",clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_mst.inst.IF);
    passthrough_monitor =new("Clk passthrough_monitor",clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.IF);

    /******************************************************************************************* 
    switch passthrough VIP into runtime master mode
    *     8.1 start clock-- this will generate the default clk with period(default passthrough clk
    *         vip period) with no jitter,  duty cycle 50%
    *     8.2 turn on mst_monitor clk check with expected clk settings
    *******************************************************************************************/
    clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.set_master_mode();
    #1ns;
    clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.IF.set_initial_value(0);
    clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.IF.start_clock();
    passthrough_monitor.enable_clk_check(
    .expected_period(10.0),
    .expected_duty_cycle(0.50),
    .expected_jitter(0.0)
    );
    #(10.0*10*1ns);
    /*******************************************************************************************  
    *     9.1 update clock by calling set_clk_prd with clock period, duty cycle,jitter on/off,
    *        jitter minmum range, jitter maximum range,if jitter is on,it means
    *        that the jitter is randomized picked between jitter minmum range and jitter maximum
    *        range)
    *     9.2 turn on the monitor check with expected clock period, duty cycle and jitter
    *******************************************************************************************/
    clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.IF.set_clk_prd(
    .user_period(1000),
    .user_duty_cycle(0.3),
    .user_jitter_on(1),
    .user_jitter_min_range(0.0),
    .user_jitter_max_range(0.01)
    );
    passthrough_monitor.enable_clk_check(
    .expected_period(1000),
    .expected_duty_cycle(0.3),
    .expected_jitter(0.01)
    );
    #4000ns;
    /******************************************************************************************* 
    *   10.1 update clock by calling set_clk_frq with clock frequency, duty cycle,jitter on/off,
    *        jitter minmum range, jitter maximum range,if jitter is on,it means 
    *        that the jitter is randomized picked between jitter minmum range and jitter maximum
    *        range)
    *    10.2 turn on the monitor check with expected clock period, duty cycle and jitter
    *******************************************************************************************/
    clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.IF.set_clk_frq(
    .user_frequency(10000000),
    .user_duty_cycle(0.7),
    .user_jitter_on(0),
    .user_jitter_min_range(0.0),
    .user_jitter_max_range(0.00)
    );
    passthrough_monitor.enable_clk_check(
    .expected_period(100),
    .expected_duty_cycle(0.7),
    .expected_jitter(0)
    );
    #810ns;
    /*******************************************************************************************  
    * update clock again with different period and duty cycle
    *******************************************************************************************/
    clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.IF.set_clk_prd(
    .user_period(200),
    .user_duty_cycle(0.4),
    .user_jitter_on(1),
    .user_jitter_min_range(0.0),
    .user_jitter_max_range(0.02)
    );
    passthrough_monitor.enable_clk_check(
    .expected_period(200),
    .expected_duty_cycle(0.4),
    .expected_jitter(0.0)
    );
    #1080ns;
    /******************************************************************************************* 
    * stop clock and disable passthrough monitor
    *******************************************************************************************/
    clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.IF.stop_clock();
    passthrough_monitor.disable_clk_check();
    #1;
    /*******************************************************************************************  
    * set clk_vip_passthrough back into passthrough mode
    *******************************************************************************************/
    clk_vip_0_exdes_tb.DUT.ex_design.clk_vip_passthrough.inst.set_passthrough_mode();
    #(10*1ns);
    $display("EXAMPLE TEST DONE : Test Completed Successfully");
    $finish;
  end


  chip DUT(
  .clk_out(clk_out)
  );

endmodule

官方手册:pg291-clk-vip

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1503484.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Solidity攻击合约:“被偷走的资金”

在以太坊智能合约开发中&#xff0c;Solidity是最常用的编程语言。然而&#xff0c;由于代码编写不当或缺乏安全意识&#xff0c;合约可能面临各种攻击。本文将通过一个简单的Solidity合约示例&#xff0c;展示一个潜在的攻击合约&#xff0c;并分析其相对于原本合约的危害以及…

TS项目实战三:Express实现登录注册功能后端

使用express实现用户登录注册功能&#xff0c;使用ts进行代码开发&#xff0c;使用mysql作为数据库&#xff0c;实现用户登录、登录状态检测、验证码获取接口及用户注册相关接口功能的实现。 源码下载&#xff1a;[点击下载] (https://download.csdn.net/download/m0_37631110/…

设计模式-行为型模式-观察者模式

观察者模式定义了一种一对多的依赖关系&#xff0c;让多个观察者对象同时监听某一个主题对象。这个主题对象在状态发生变化时&#xff0c;会通知所有观察者对象&#xff0c;使它们能够自动更新自己。[DP] //首先是Observer接口&#xff0c;定义了观察者需要实现的更新方法&…

【Claude 3】一文谈谈Anthropic(Claude) 亚马逊云科技(Bedrock)的因缘际会

文章目录 前言1. Anthropic的诞生2. Anthropic的“代表作”——Claude 3的“三驾马车”3. 亚马逊云科技介绍4. 强大的全托管服务平台——Amazon Bedrock5. 亚马逊云科技(AWS)和Anthropic的联系6. Claude 3模型与Bedrock托管平台的关系7. Clude 3限时体验入口分享【⚠️截止3月1…

[贰],万能开篇HelloWorld

1&#xff0c;新建项目 File/New/Project Android/Android Application Project 输入程序名字HelloWorld Next Next 选择Blank Activity 修改为HelloWorldActivity 2&#xff0c;异常点 No resource found that matches the given name Theme.AppCompat.Light import andro…

c++中string的使用!!!(适合初学者 浅显易懂)

我们先初步的认识一下string,string底层其实是一个模版类 typedef basic_string<char> string; 我们先大致的把string的成员函数列举出来 class string { private: char * str; size_t size; size_t capacity; }; 1.string的六大默认函数 1.1 构造函数、拷贝构造 注&am…

Hadoop生态选择(一)

一、项目框架 1.1技术选型 技术选型主要考虑因素:维护成本、总成本预算、数据量大小、业务需求、行业内经验、技术成熟度。 数据采集传输:Flume&#xff0c;Kafka&#xff0c;DataX&#xff0c;Maxwell&#xff0c;Sqoop&#xff0c;Logstash数据存储:MySQL&#xff0c;HDFS…

【数据库】多表查询:子查询|关联查询 inner join 、left join、right join

一、外键&#xff1a; 就是把一张表的主键拿到另一张表中作为一个普通的字段 通过外键 可以把两张表连接起来 比如&#xff0c;下面【部门】表里的主键 拿到【员工】表里做普通字段&#xff08;外键&#xff09; 员工 部门 1员工&#xff0c;XXX&#xff0c;1部门 1部门&a…

CraxsRat7.4 安卓手机远程管理软件

CRAXSRAT 7.4 最新视频 https://v.douyin.com/iFjrw2aD/ 官方网站下载 http://craxsrat.cn/ 不要问我是谁&#xff0c;我是活雷锋。 http://craxsrat.cn/ CraxsRat CraxsRat7 CraxsRat7.1 CraxsRat7.2 CraxsRat7.3 CraxsRat7.4

[java基础揉碎]super关键字

super关键字: 基本介绍 super代表父类的引用&#xff0c;用于访问父类的属性、方法、构造器 super给编程带来的便利/细节 1.调用父类的构造器的好处(分工明确&#xff0c;父类属性由父类初始化&#xff0c;子类的属性由子类初始化) 2.当子类中有和父类中的成员(属性和方法)重…

R语言更新版本

目录 一、更新R语言 1、安装最新的R语言版本 2、移动之前安装的packages 3、将Rstudio连接到最新的R语言 二、Rstudio更新 一、更新R语言 1、安装最新的R语言版本 查看当前R语言版本&#xff1a; R.version.string 下载最新的R语言安装包&#xff1a;R: The R Project…

链表|19.删除链表的倒数第N个节点

力扣题目链接 struct ListNode* removeNthFromEnd(struct ListNode* head, int n) {//定义虚拟头节点dummy 并初始化使其指向headstruct ListNode* dummy malloc(sizeof(struct ListNode));dummy->val 0;dummy->next head;//定义 fast slow 双指针struct ListNode* f…

SkyWalking链路追踪上下文TraceContext的traceId生成的实现原理剖析

结论先行 【结论】 SkyWalking通过字节码增强技术实现&#xff0c;结合依赖注入和控制反转思想&#xff0c;以SkyWalking方式将追踪身份traceId编织到链路追踪上下文TraceContext中。 是不是很有趣&#xff0c;很有意思&#xff01;&#xff01;&#xff01; 【收获】 skywal…

CSS的盒子模型:掌握网页设计的基石!

&#x1f90d; 前端开发工程师、技术日更博主、已过CET6 &#x1f368; 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 &#x1f560; 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》 &#x1f35a; 蓝桥云课签约作者、上架课程《Vue.js 和 E…

C#学习:初识各类应用程序

编写我们第一个程序——Hello,World! 1.编程不是“学”出来的&#xff0c;而是“练”出来的 2.在反复应用中积累&#xff0c;忽然有一天就会顿悟 3.学习原则&#xff1a; 3.1从感官到原理 3.2从使用别人的到创建自己的 3.3必需亲自动手 3.4必需学以致用&#xff0c;紧跟实际…

P4551 最长异或路径

最长异或路径 题目描述 给定一棵 n n n 个点的带权树&#xff0c;结点下标从 1 1 1 开始到 n n n。寻找树中找两个结点&#xff0c;求最长的异或路径。 异或路径指的是指两个结点之间唯一路径上的所有边权的异或。 输入格式 第一行一个整数 n n n&#xff0c;表示点数…

机器人扫地 二分答案

#include<bits/stdc.h> using namespace std; int i,n,a[100009],k,ans0; bool check(int mid){int pos0,t;//pos前面清扫过的位置for(i0;i<k;i){ //已经清扫的位置还没到当前机器人的位置a[i]//一个位置机器人是要去回&#xff0c;一个格子消耗两个时间 tmid;//贪心…

turtle绘制小猪佩奇

turtle绘制小猪佩奇 import turtle as t 使用python的turtle绘制小猪佩奇 # 设置线条粗细为4 t.pensize(4) # 使海龟不可见 #t.hideturtle() # 后续表示三原色的r,g,b必须在0~255之间 t.colormode(255) # 设置画笔颜色和填充颜色 t.color((255, 155, 192), "pink")…

记录汇川:IO隔离编程

IO隔离&#xff1a;方便程序修改 无论是输入点坏了还是输出点坏了&#xff0c;或者人为接错线&#xff0c;或者对调点&#xff0c;我们只需要更改IO隔离得输入输出就可以了。方便。 停止按钮外接常闭&#xff0c;里面也使用常闭&#xff0c;为了断线检测功能(安全)&#xff…

【vue2基础教程】vue指令

文章目录 前言一、内容渲染指令1.1 v-text1.2 v-html1.3 v-show1.4 v-if1.5 v-else 与 v-else-if 二、事件绑定指令三、属性绑定指令总结 前言 Vue.js 是一款流行的 JavaScript 框架&#xff0c;广泛应用于构建交互性强、响应速度快的现代 Web 应用程序。Vue 指令是 Vue.js 中…