class usb_simple_sequence extends uvm_sequence #(usb_transfer);rand int unsigned sequence_length;constraint reasonable_seq_len { sequence_length < 10 };//Constructorfunction new(string name=”usb_simple_bulk_sequence”);super.new(name);endfunction//Register with factory`uvm_object_utils(usb_simple_bulk_sequence)//the body() task is the actual logic of the sequencevirtual task body();repeat(sequence_length)`uvm_do_with(req, {//Setting the device_id to 2req.device_id == 8’d2;//Setting transfer type to BULKreq.type == usb_transfer::BULK_TRANSFER;})endtask : bodyendclass |
class usb_simple_bulk_test extends uvm_test;…virtual function void build_phase(uvm_phase phase );…uvm_config_db#(uvm_object_wrapper)::set(this, "sequencer_obj.main_phase","default_sequence", usb_simple_sequence::type_id::get());…endfunction : build_phaseendclass |
task pre_start()if(starting_phase != null)starting_phase.raise_objection(this);endtask : pre_starttask post_start()if(starting_phase != null)starting_phase.drop_objection(this);endtask : post_start |
class usb_simple_bulk_test extends uvm_test;usb_simple_sequence seq;…virtual function void main_phase(uvm_phase phase );…//User need to set the starting_phase as sequence start methodis explicitly called to invoke the sequenceseq.starting_phase = phase;seq.start();…endfunction : main_phaseendclass |
class usb_simple_sequence extends uvm_sequence #(usb_transfer);rand int unsigned sequence_length;constraint reasonable_seq_len { sequence_length < 10 };…virtual task body();usb_transfer::type_enum local_type;bit[7:0] local_device_id;//Get the values for the variables in case toplevel//test/sequence sets it.uvm_config_db#(int unsigned)::get(null, get_full_name(),“sequence_length”, sequence_length);uvm_config_db#(usb_transfer::type_enum)::get(null,get_full_name(), “l(fā)ocal_type”, local_type);uvm_config_db#(bit[7:0])::get(null, get_full_name(),?“l(fā)ocal_device_id”, local_device_id);repeat(sequence_length)`uvm_do_with(req, {req.device_id == local_device_id;req.type == local_type;})endtask : bodyendclass |
uvm_config_db#()::set中使用的參數(shù)類型和字符串(第三個參數(shù))應該與uvm_config_db#()::get中使用的類型相匹配,否則將無法正確配置。這個地方如果出錯會非常痛苦,但好在不需要經(jīng)常修改,痛苦一次就好。另外,這幾個配置項是隨機類型,相應的配置值也需要滿足約束范圍。class usb_complex_sequence extends uvm_sequence #(usb_transfer);//Object of simple sequence used for sending bulk transferusb_simple_sequence simp_seq_bulk;//Object of simple sequence used for sending interrupt transferusb_simple_sequence simp_seq_int;…virtual task body();//Variable for getting device_id for bulk transferbit[7:0] local_device_id_bulk;//Variable for getting device_id for interrupt transferbit[7:0] local_device_id_int;//Variable for getting sequence length for bulkint unsigned local_seq_len_bulk;//Variable for getting sequence length for interruptint unsigned local_seq_len_int;//Get the values for the variables in case top level//test/sequence sets it.uvm_config_db#(int unsigned)::get(null, get_full_name(),“l(fā)ocal_seq_len_bulk”,local_seq_len_bulk);uvm_config_db#(int unsigned)::get(null, get_full_name(),“l(fā)ocal_seq_len_int”,local_seq_len_int);uvm_config_db#(bit[7:0])::get(null, get_full_name(),“l(fā)ocal_device_id_bulk”,local_device_id_bulk);uvm_config_db#(bit[7:0])::get(null, get_full_name(),“l(fā)ocal_device_id_int”,local_device_id_int);//Set the values for the variables to the lowerlevel//sequence/sequence item, which we got from//above uvm_config_db::get.//Setting the values for bulk sequenceuvm_config_db#(int unsigned)::set(null, {get_full_name(),”.”,”simp_seq_bulk”}, “sequence_length”,local_seq_len_bulk);uvm_config_db#(usb_transfer::type_enum)::set(null, {get_full_name(),“.”,“simp_seq_bulk”} , “l(fā)ocal_type”,usb_transfer::BULK_TRANSFER);uvm_config_db#(bit[7:0])::set(null, {get_full_name(), “.”,”simp_seq_bulk”}, “l(fā)ocal_device_id”,local_device_id_bulk);//Setting the values for interrupt sequenceuvm_config_db#(int unsigned)::set(null, {get_full_name(),”.”,”simp_seq_int”}, “sequence_length”,local_ seq_len_int);uvm_config_db#(usb_transfer::type_enum)::set(null, {get_full_name(),“.”,“simp_seq_int”} , “l(fā)ocal_type”,usb_transfer::INT_TRANSFER);uvm_config_db#(bit[7:0])::set(null,{get_full_name(),“.”,”simp_seq_bulk”},“l(fā)ocal_device_id”,local_device_id_int);`uvm_do(simp_seq_bulk)simp_seq_bulk.get_response();`uvm_send(simp_seq_int)simp_seq_int.get_response();endtask : bodyendclass |
印度海得拉巴和馬薩諸塞州波士頓2022年4月20日 /美通社/ -- 全球領先的生命科學組織數(shù)據(jù)和分析提供商Excelra宣布,對價值和證據(jù)領域快速發(fā)展的年輕技術公...
關鍵字: ce(全球TMT2022年2月21日訊)愛立信IoT Accelerator推出一款可靠、安全的蜂窩物聯(lián)網(wǎng)平臺,使全球電信運營商(CSP)和企業(yè)能夠在數(shù)千萬臺設備上拓展其物聯(lián)網(wǎng)業(yè)務。愛立信發(fā)布IoT Accelerator...
關鍵字: ce 蜂窩物聯(lián)網(wǎng) 物聯(lián)網(wǎng)平臺英國倫敦和印度海得拉巴2022年2月10日 /美通社/ -- 數(shù)據(jù)科學和分析領導者Excelra 與人工智能先驅(qū)X-Chem之間的全新合作將加速臨床前藥物發(fā)現(xiàn),幫助...
關鍵字: ce靈活工作安排和“大辭職”潮無意間提高網(wǎng)絡風險,值此之際,人工智能將加強安全團隊 英國劍橋2022年1月28日 /美通社/ -- 網(wǎng)絡安全人工智...
關鍵字: ce(全球TMT2022年1月29日訊)網(wǎng)絡安全人工智能領域的全球領導者Darktrace宣布,其自主響應技術現(xiàn)將在端點上采取行動 -- 完善Darktrace Antigena產(chǎn)品系列,該產(chǎn)品系列已覆蓋SaaS應用程序、...
關鍵字: 人工智能 網(wǎng)絡安全 ce