uvmʵս-ѧϰ±Ê¼Ç ÁªÏµ¿Í·þ

·¢²¼Ê±¼ä : ÐÇÆÚËÄ ÎÄÕÂuvmʵս-ѧϰ±Ê¼Ç¸üÐÂÍê±Ï¿ªÊ¼ÔĶÁ4f6326b027d3240c8447efe9

¶ÔÓÚ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_automation»úÖÆÈöÔÏó×Ô¶¯ÓеÄcopy compare print pack unpackµÈº¯Êý£¬¼ò»¯ÁËʵÏÖuvm_componentÅÉÉúÀàÀïһЩfunction/taskµÄ¹¤×÷Á¿

¶ÔÓÚuvm_componentÅÉÉúÀàÀ´Ëµ£¬field_automation»úÖÆ×îÖØÒªµÄÊÇ ¿ÉÒÔÔÚbuild_phaseÖÐ×Ô¶¯»ñÈ¡uvm_config_db#()::set()µÄÊýÖµ£¨±ØÐë¼Ósuper.build_phase(phase)£©---- Ò²¾ÍÊDz»ÓÃд uvm_config_db#()::get()

×¢Ò⣺ field_automationµÄmacroµÄÀàÐÍÒªºÍuvm_config_dbµÄ²ÎÊýÀàÐÍÒ»Ö£º

ÈçÏÂʾÀý´úÂ룬 field_int vs uvm_config_db#(bit[47:0]) Õâ¸öʱºòsuper.build_phase()ÊDz»Æð×÷Óõġ£

ÏëÒªÆð×÷ÓõĻ°£¬ÐèÒªÓÃ

clone = new + copy Ô´´úÂëÖпÉÒÔ¿´µ½cloneº¯ÊýÒ»ÉÏÀ´»á×öÒ»´Îcreate£¬È»ºóµ÷copyº¯Êý src/base/uvm_object.svh

3.2 UVMµÄÊ÷Ðνṹ

uvm_componentµÄnew/createҪעÒâµÚÒ»¸ö²ÎÊýÊÇÃû×Ö£¬µÚ¶þ¸ö²ÎÊýÊÇparentÖ¸Õë¡£ UVMÕæÕýµÄÊ÷¸ùÊÇ¡°uvm_top¡±. ¸ù¾ÝÉÏÃæÕâ¸öÊ÷½á¹¹£¬¿ÉÒÔ¿´³öÒ»¸ö¸öcomponentµÄparentÊÇʲô¡£uvm_topµÄparentÊÇnull¡£ µ±Ò»¸ö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Ö¸Õë get_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_agent's name is uvm_test_top.env.i_agt, parent's full path is uvm_test_top.env, children num is 3

uvm_test_top.env.i_agt 0 child: drv --> full path:uvm_test_top.env.i_agt.drv uvm_test_top.env.i_agt 1 child: mon --> full path:uvm_test_top.env.i_agt.mon uvm_test_top.env.i_agt 2 child: sqr --> full path:uvm_test_top.env.i_agt.sqr This should be i_agt. my_agent's name is uvm_test_top.env.i_agt uvm_test_top.env.i_agt first child name is drv uvm_test_top.env.i_agt next child name is mon uvm_test_top.env.i_agt next child name is sqr

my_agent's name is uvm_test_top.env.o_agt, parent's full path is uvm_test_top.env, children num is 1

uvm_test_top.env.o_agt 0 child: mon --> full path:uvm_test_top.env.o_agt.mon UVM_WARNING /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_agt'

This should be o_agt. my_agent's name is uvm_test_top.env.o_agt uvm_test_top.env.o_agt first child name is mon

3.3 field automation »úÖÆ

×¢ÒâÊý×éÀàÐ͵Äfield macro±ÈÒ»°ãµÄÒªÉÙrealºÍeventµÄmacro. Ò»°ãµÄ¶ÔÓÚenumÀàÐÍÓÐ3¸ö²ÎÊý£¬¶øÊý×éµÄÖ»ÓÐ2¸ö²ÎÊý¡£ ÁªºÏÊý×éµÄmacro±È½Ï¶à

³£Óú¯ÊýÐèҪעÒâ pack unpack pack_bytes unpack_bytes pack_ints unpack_ints ·µ»ØÖµ¶¼ÊÇbit¸öÊý¡£

field-automation±ê¼Çλ

17bitÖÐ bit0?copy bit1?no_copy bit2?compare bit3?no_compare bit4?print bit5?no_print bit6?record bit7?no_record bit8?pack bit9?no_pack UVM_ALL_ONÊÇ ¡®b000000101010101

UVM_ALL_ON|UVM_NO_PACK ÕâÑù¾Í»áºöÂÔµôpack bit

field-automationµÄmacro¿ÉÒÔºÍif½áºÏÆðÀ´£¬²Î¿¼3.3.4µÄ´úÂë `uvm_object_utils_begin(my_transaction) `uvm_field_int(dmac, UVM_ALL_ON) `uvm_field_int(smac, UVM_ALL_ON) if(is_vlan)begin `uvm_field_int(vlan_info1, UVM_ALL_ON) `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_vlan, UVM_ALL_ON | UVM_NOPACK) `uvm_object_utils_end

Õâ¸öis_vlan±äÁ¿¿ÉÒÔÔÚsequenceÀïÔ¼Êø³É0»ò1£¬À´ÊµÏÖvlan»ò·Çvlan

ps£º ÎÒ¾õµÃÕâ¸öµØ·½´úÂëÆäʵд³ÉÏñ3.3.3ÀïµÄÓÐÒ»¸öcrc_errorµÄrand bitµÄ¸üºÏÀíһЩ¡£È»ºócrc_errorÊÇUVM_ALL_ON|UVM_NOPACK£¬¶øcrcÊÇUVM_ALL_ON

3.4 UVM´òÓ¡ÐÅÏ¢¿ØÖÆ

get_report_verbosity_level()

set_report_verbosity_level(UVM_HIGH) Ö»¶Ôµ±Ç°µ÷ÓõÄcomponentÆð×÷ÓÃ

set_report_verbosity_level_hier(UVM_HIGH) ¶Ôµ±Ç°¼°ÏÂÃæËùÓеÄcomponentÆð×÷Óà simv +UVM_VERBOSITY=UVM_HIGH ÃüÁîÐз½Ê½ ------ ÎÒ¾õµÃÓÃÕâ¸ö¾Í¿ÉÒÔÁË ÖØÔØ´òÓ¡ÐÅÏ¢£º

set_report_severity_override(UVM_WARNING,UVM_ERROR);