我们在sequence中往driver发包时,最常用的方法就是使用uvm_do()系列宏,偶尔会使用方法start_item()和finish_item()的组合,极个别场景下会 使用`uvm_create()和`uvm_send()宏,极极个别场景下还会看到create_item()方法的使用,这些宏和方法有什么区别,各自使用场景有什么局限和注意事项,他们分别定义在了UVM源代码...
uvm_component parent = null); super.new(name, parent); endfunction virtual function void build_phase(uvm_phase phase); super.build_phase(phase); env_h = env::type_id::create("env_h", this); seq = sequence_in::type_id::create("seq", this...
uvm_do_on_pri_with宏第一个参数可以传入sequence,也可以传入transaction。 uvm_do_on宏第一参数是sequence。uvm_do_on_pri_with宏中调用宏uvm_create_on。 create_item通过工厂模式创建sequence实例 调用set_item_context()函数,给成员变量m_sequencer, m_parent_sequence赋值,参考上节分析。此处parent_sequence默认...
`uvm_field_int(vlan_info2, UVM_ALL_ON) `uvm_field_int(vlan_info3, UVM_ALL_ON) `uvm_field_int(vlan_info4, UVM_ALL_ON) end `uvm_field_int(ether_type, UVM_ALL_ON) `uvm_field_array_int(pload, UVM_ALL_ON) `uvm_field_int(crc, UVM_ALL_ON|UVM_NOPACK) `uvm_field_int(is_vl...
1.采用uvm_create & uvm_send宏 注1:`uvm_create与`uvm_send宏的第一个参数都可以是sequencer的指针,也可以是transaction的指针; (1)uvm_create/uvm_create_on调用uvm_sequence_base的create_item函数,并利用factory机制进行seq或seq_item的例化; (2)uvm_rand_send系列宏与uvm_send宏的区别在于前者包含了trans...
里面有个uvm_create_on函数,其定义如下: 这里面又调用ceate_item函数,创建一个SEQ_OR_ITEM。create_item函数是uvm_sequence_base类的一个函数,为此,这就说明了uvm_do系列宏只能在sequence类里面用。 create_item宏定义如下: 最终调用factory.create_object_by_type来实例化SEQ_OR_ITEM。并且指定SEQ_OR_ITEM的m_...
除了在component中通过my_dirver::type_id::create("drv",this)这种方式创建,也可以直接调用factory.create_component_by_name/type的方式创建,上面提到的uvm_root中的run_test()就是这样创建test_case实例的。 UVM Facotry 的使用: The OVM/UVM Factory & Factory Overrides How They Work - Why They Are Impo...
uvm_do系列的其他七个宏其实都是用uvm_do_on_pri_with宏来实现的。如uvm_do宏:`define uvm_do(SEQ_OR_ITEM) `uvm_do_on_pri_with(SEQ_OR_ITEM, m_sequencer, -1, {}) uvm_create与uvm_send `uvm_create(m_trans):uvm_create宏的作用是实例化transaction ...
uvm_create宏的作用就是实例化transaction,实例化之后,可以对其做更多的处理,处理完毕再使用`uvm_send宏发送出去。 好了,今天的分享就到这里了,希望对你的学习有一点帮助。持续更新,欢迎关注。觉得有帮助的朋友,希望能够点个赞鼓励一下!!你的每个鼓励都是我持续创作的动力!
如果约束条件只是用来将发送数据设置为特定的值,可以用用户定义的任务来代替宏。 class simple_seq_do_with extends uvm_sequence #(simple_item); task do_rw(int addr, int data); item= simple_item::create("item",,get_full_name()); item.addr.rand_mode(0); ...