ImageVerifierCode 换一换
格式:DOCX , 页数:32 ,大小:708.85KB ,
资源ID:722279      下载积分:12 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/722279.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(uvm实战学习笔记.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

uvm实战学习笔记.docx

1、uvm实战学习笔记uvm实战-学习笔记UVM实战(卷1) 学习笔记看了第1/2/3/4/5/6/8/9.1 这几个章节。 第一章是综述,第二章是一个具体的例子,学习笔记从第三章相关内容开始。我个人觉得UVM重要的部分(特点的部分):1) factory机制(override config_db)2) TLM传递3) phase机制4) sequence-sequencer 以及virtual seq/sqr内容中的截图基本来自于 UVM源代码、书自带的例子和uvm1.1应用指南及源代码分析这个PDF里的。 需要结合书(UVM实战(卷1)第1版)来看这个笔记。第3章 UVM基础3.1 uvm_c

2、omponent和uvm_object常用的类名字:这个图是从作者张强的uvm1.1应用指南及源代码分析里截得,不如书上3.1.1里的图好。uvm_sequencer也是代码里必须有的,所以我加了uvm_sequenceruvm_void是一个空的虚类。在src/base/uvm_misc.svh中定义:红框的是我们搭testbench的时候用的比较多的基类。常用的uvm_object派生类:sequencer给driver的transaction要派生自uvm_sequence_item,不要派生自uvm_transaction 所有的sequence要派生自uvm_sequence或者uv

3、m_sequence的派生类,可以理解为sequence是sequence_item的组合(集合)。 driver向sequencer索要item,sequencer检查是否有sequence要发送item,当发现有item待发送时,就把这个item发给driver.常用的uvm_component派生类: 所有的driver要派生自uvm_driver. driver用来把sequence_item中的信息驱动到DUT端口上,从transaction-level向signal-level的转换。 uvm_driver需要参数(REQ RSP),比uvm_component增加了几个成员。重要

4、的是seq_item_port和req/rsp. (src/comps/uvm_driver.svh) monitor/scoreboard 派生自 uvm_monitor和uvm_scoreboard, 但是uvm_monitor和uvm_scoreboard并没有在uvm_component基础上做扩展。 src/comps/uvm_monitor.svh sequencer要派生自uvm_sequencer. sequencer做了很多扩展,但是如果我们自己写的sequencer里没有增加成员的话,可以直接写如下代码:typedef uvm_sequencer #(传递的sequence

5、_item类名) sequencer类名; 因为sequencer在agent中例化,所以一般写在agent类文件里。 reference_model派生自uvm_component. agent要派生自uvm_agent. uvm_agent里多了一个is_active的成员。一般根据这个active来决定是否实例化driver和sequencer. is_active变量的数值需要在env的build_phase里设置完成(可以直接设置,也可以用uvm_config_db#(int):set)。 env要派生自uvm_env. uvm_env没有对uvm_component扩展。 src/

6、comps/uvm_env.svh 所有的test都要派生自uvm_test或者它的派生类。uvm_test也没扩展 src/comps/uvm_test.svhuvm_object和uvm_component的macromacro非常重要,事关把这些类的对象注册到factory机制中去。uvm_object macro1)对于uvm_sequence_item就统一用(假设不用parameter):uvm_object_utils_begin(item类名). field_automationuvm_object_utils_end2)对于uvm_sequence,要加上uvm_object

7、_utils(sequence 类名)可能还需要uvm_declare_p_sequencer(sequencer类名)的声明uvm_component macro对于driver monitor reference_model scoreboard sequencer case agent env这些uvm_component派生类都要加上:uvm_component_utils(类名)uvm_component里的成员也可以像uvm_object里成员一样,用field_automation机制。field_automation机制:对于uvm_object派生类来说,field_auto

8、mation机制让对象自动有的copy compare print pack unpack等函数,简化了实现uvm_component派生类里一些function/task的工作量对于uvm_component派生类来说,field_automation机制最重要的是 可以在build_phase中自动获取uvm_config_db#():set()的数值(必须加super.build_phase(phase))- 也就是不用写 uvm_config_db#():get() 注意: field_automation的macro的类型要和uvm_config_db的参数类型一致:如下示例代码,

9、field_int vs uvm_config_db#(bit47:0) 这个时候super.build_phase()是不起作用的。想要起作用的话,需要用clone = new + copy 源代码中可以看到clone函数一上来会做一次create,然后调copy函数src/base/uvm_object.svh3.2 UVM的树形结构uvm_component的new/create要注意第一个参数是名字,第二个参数是parent指针。UVM真正的树根是“uvm_top”. 根据上面这个树结构,可以看出一个个component的parent是什么。uvm_top的parent是null。 当

10、一个component在实例化的时候,如果parent参数设成null,那么parent参数会被仿真器自动设置成uvm_root的实例uvm_top. 在6.6.1章节里也提到了,sequence在uvm_config_db#():get()的时候,第一个参数设成“null”,实际就是uvm_root:get() 3.5.1章节也提到了这个 层次结构函数:get_parent() get_child(string name) 这两个分别获取parent指针和指定名字的child指针。get_children(ref uvm_component children$) 获取所有的child指针ge

11、t_num_children() 获取child个数get_first_child(ref string name) get_next_child(ref string name) 获取child的名字(反映到string name上),返回值是0/1两种情况应用参考代码如下(改动的2.5.2例子中的my_agent.sv): 注意:上述代码是在connet_phase中实现的。上述代码的打印结果如下:my_agents name is uvm_test_top.env.i_agt, parents full path is uvm_test_top.env, children num is

12、3uvm_test_top.env.i_agt 0 child: drv - full path:uvm_test_top.env.i_agt.drvuvm_test_top.env.i_agt 1 child: mon - full path:uvm_test_top.env.i_agt.monuvm_test_top.env.i_agt 2 child: sqr - full path:uvm_test_top.env.i_agt.sqrThis should be i_agt. my_agents name is uvm_test_top.env.i_agtuvm_test_top.en

13、v.i_agt first child name is drvuvm_test_top.env.i_agt next child name is monuvm_test_top.env.i_agt next child name is sqrmy_agents name is uvm_test_top.env.o_agt, parents full path is uvm_test_top.env, children num is 1uvm_test_top.env.o_agt 0 child: mon - full path:uvm_test_top.env.o_agt.monUVM_WAR

14、NING /tools/synopsys/vcs/G-2012.09/etc/uvm/src/base/uvm_component.svh(1846) 0: uvm_test_top.env.o_agt NOCHILD Component with name drv is not a child of component uvm_test_top.env.o_agtThis should be o_agt. my_agents name is uvm_test_top.env.o_agtuvm_test_top.env.o_agt first child name is mon3.3 fiel

15、d automation 机制注意数组类型的field macro比一般的要少real和event的macro. 一般的对于enum类型有3个参数,而数组的只有2个参数。 联合数组的macro比较多常用函数需要注意 pack unpack pack_bytes unpack_bytes pack_ints unpack_ints 返回值都是bit个数。field-automation标记位17bit中 bit0copy bit1no_copy bit2compare bit3no_compare bit4print bit5no_print bit6record bit7no_record bit8pack bit9no_packUVM_ALL_ON是 b000000101010101UVM_ALL_ON|UVM_NO_PACK 这样就会忽略掉pack bitfield-automation的macro可以和if结合起来,参考3.3.4的代码 uvm_object_utils_begin(my_transaction) uvm_field_int(dmac, UVM_ALL_ON) uvm_field_int(smac, UV

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1