文件名称:OVM源代码分析之sequence机制.pdf
文件大小:1.97MB
文件格式:PDF
更新时间:2022-09-20 07:27:26
OVM 源代码 分析 sequence 机制
目 录 1 这是一个什么样的故事...........................................................................................................6 2 这是关于谁的故事...................................................................................................................8 2.1 sequence........................................................................................................................8 2.2 sequence_item...............................................................................................................8 2.3 sequencer.....................................................................................................................10 3 故事背后的故事.....................................................................................................................13 3.1 整体架构.....................................................................................................................14 3.2 sequence_item生成.....................................................................................................14 3.2.1 my_sequence_item..........................................................................................14 3.2.2 òvm_object_utils_begin.................................................................................16 3.2.3 òvm_field_utils_begin...................................................................................18 3.2.4 òvm_object_utils_end....................................................................................19 3.3 sequencer的生成.........................................................................................................20 3.3.1 my_sequnecer..................................................................................................20 3.3.2 òvm_sequencer_utils.....................................................................................20 3.3.3 òvm_sequencer_utils_begin...........................................................................21 3.3.4 òvm_component_utils_begin.........................................................................22 3.3.5 òvm_sequencer_utils_end..............................................................................22 3.3.6 òvm_update_sequence_lib_and_item............................................................23 3.3.7 default_sequence.............................................................................................25 3.4 sequence基本类生成..................................................................................................26 3.4.1 my_sequence...................................................................................................26 3.4.2 òvm_sequence_utils_begin............................................................................27 3.4.3 òvm_sequence_utils_end...............................................................................28 3.4.4 is_relevant.......................................................................................................28 3.4.5 wait_for_relevant............................................................................................29 3.4.6 wait_for_available_sequence..........................................................................30 3.5 sequence扩展类1.......................................................................................................31 3.5.1 lock..................................................................................................................32 3.5.2 lock_req<-lock................................................................................................32 3.5.3 register_sequence<-lock_req<-lock................................................................33 3.5.4 seq_req_class...................................................................................................35 3.5.5 arb_sequence_q...............................................................................................36 3.5.6 grant_queued_locks<-lock_req<-lock.............................................................36 3.5.7 is_blocked<-grant_queued_locks<-lock_req<-lock........................................37 3.5.8 set_arbitration_completed<-grant_queued_locks<-lock_req<-lock................38 3.5.9 wait_for_arbitration_completed<-lock_req<-lock..........................................39 3.5.10 grab..................................................................................................................39 3.5.11 my_subseq_0代码..........................................................................................40 3.5.12 body.................................................................................................................41 3.5.13 start(Part I).................................................................................................41 3.5.14 kill_sequence...................................................................................................43 OVM源代码分析之sequence机制 3 telantan@gmail.com 3.5.15 stop_sequences................................................................................................47 3.5.16 start(Part II)................................................................................................48 3.5.17 start总结..........................................................................................................51 3.5.18 ovm_do_with(Part I)..................................................................................51 3.5.19 start_item.........................................................................................................53 3.5.20 m_start_item (Part I)(ovm_sequence_item)..........................................54 3.5.21 wait_for_grant.................................................................................................54 3.5.22 m_start_item (Part II)(ovm_sequence_item).........................................56 3.5.23 ovm_do_with(Part II).................................................................................57 3.5.24 ovm_do_with(Part III)...............................................................................58 3.5.25 m_finish_item (Part I)(ovm_sequence_item)........................................58 3.5.26 send_request....................................................................................................59 3.5.27 wait_for_item_done........................................................................................60 3.5.28 m_finish_item (Part II)(ovm_sequence_item).......................................61 3.5.29 ovm_do_with总结...........................................................................................61 3.5.30 my_subseq_0代码简要分析..........................................................................63 3.6 sequence扩展类2.......................................................................................................64 3.6.1 super.new.........................................................................................................65 3.6.2 body.................................................................................................................67 3.7 sequence扩展类3.......................................................................................................68 3.7.1 m_start_item(ovm_sequence)....................................................................69 3.7.2 m_finish_item(ovm_sequence)..................................................................69 3.8 my_driver的实现........................................................................................................71 3.8.1 driver.new........................................................................................................71 3.8.2 ovm_component.new(Part I)......................................................................72 3.8.3 ovm_component.new(Part II)....................................................................75 3.8.4 ovm_component.new(Part III)...................................................................77 3.8.5 set_config_int..................................................................................................78 3.8.6 get_config_int.................................................................................................79 3.8.7 apply_config_settings.....................................................................................83 3.8.8 ovm_component.new(Part IV)...................................................................88 3.8.9 run...................................................................................................................90 3.8.10 sqr_if_base......................................................................................................90 3.8.11 ovm_port_base................................................................................................92 3.8.12 ovm_seq_item_pull_port.................................................................................92 3.8.13 ovm_seq_item_pull_imp.................................................................................94 3.8.14 get_next_item..................................................................................................96 3.8.15 select_sequence...............................................................................................97 3.8.16 choose_next_request.......................................................................................98 3.8.17 item_done......................................................................................................105 3.9 my_agent的实现.......................................................................................................110 3.9.1 config机制总结.............................................................................................110 3.9.2 factory工作原理...........................................................................................113 3.9.3 ovm_object_wrapper.....................................................................................113 OVM源代码分析之sequence机制 4 telantan@gmail.com 3.9.4 factory注册方法...........................................................................................115 3.9.5 factory变更申请单.......................................................................................116 3.9.6 set_type_override_by_type...........................................................................117 3.9.7 set_type_override_by_name..........................................................................120 3.9.8 set_inst_override_by_type............................................................................122 3.9.9 set_inst_override_by_name...........................................................................123 3.9.10 create_component_by_type...........................................................................124 3.9.11 find_override_by_type..................................................................................125 3.9.12 create_component_by_name.........................................................................128 3.9.13 find_override_by_name................................................................................129 3.9.14 ovm_component内的factory接口方法.........................................................132 3.9.15 type_id::create...............................................................................................133 3.9.16 connect..........................................................................................................134 3.9.17 m_check_relationship...................................................................................138 3.9.18 resolve_bindings...........................................................................................139 3.10 my_test的实现..........................................................................................................142 3.11 run_test......................................................................................................................143 3.11.1 ovm_root.......................................................................................................144 3.11.2 ovm_phase....................................................................................................147 3.11.3 ovm_phase_func_decl...................................................................................147 3.11.4 ovm_phase_task_decl...................................................................................151 3.11.5 ovm_root.new................................................................................................151 3.11.6 insert_phase...................................................................................................156 3.11.7 run_global_phase..........................................................................................163 3.11.8 m_do_phase_all.............................................................................................170 3.11.9 global_stop_request.......................................................................................176 3.11.10 m_do_stop_all...............................................................................................178 3.11.11 do_kill_all.....................................................................................................179 3.11.12 总结..............................................................................................................180