class usb_simple_sequence extends uvm_sequence #(usb_transfer); rand int unsigned sequence_length; constraint reasonable_seq_len { sequence_length < 10 }; //Constructor function 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 sequence virtual task body(); repeat(sequence_length) `uvm_do_with(req, { //Setting the device_id to 2 req.device_id == 8’d2; //Setting transfer type to BULK req.type == usb_transfer::BULK_TRANSFER; }) endtask : body endclass |
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_phase endclass |
task pre_start() if(starting_phase != null) starting_phase.raise_objection(this); endtask : pre_start task 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 method is explicitly called to invoke the sequence seq.starting_phase = phase; seq.start(); … endfunction : main_phase endclass |
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 : body endclass |
uvm_config_db#()::set
中使用的參數(shù)類型和字符串(第三個(gè)參數(shù))應(yīng)該與uvm_config_db#()::get
中使用的類型相匹配,否則將無法正確配置。這個(gè)地方如果出錯(cuò)會(huì)非常痛苦,但好在不需要經(jīng)常修改,痛苦一次就好。另外,這幾個(gè)配置項(xiàng)是隨機(jī)類型,相應(yīng)的配置值也需要滿足約束范圍。class usb_complex_sequence extends uvm_sequence #(usb_transfer); //Object of simple sequence used for sending bulk transfer usb_simple_sequence simp_seq_bulk; //Object of simple sequence used for sending interrupt transfer usb_simple_sequence simp_seq_int; … virtual task body(); //Variable for getting device_id for bulk transfer bit[7:0] local_device_id_bulk; //Variable for getting device_id for interrupt transfer bit[7:0] local_device_id_int; //Variable for getting sequence length for bulk int unsigned local_seq_len_bulk; //Variable for getting sequence length for interrupt int 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 sequence uvm_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 sequence uvm_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 : body endclass |
印度海得拉巴和馬薩諸塞州波士頓2022年4月20日 /美通社/ -- 全球領(lǐng)先的生命科學(xué)組織數(shù)據(jù)和分析提供商Excelra宣布,對(duì)價(jià)值和證據(jù)領(lǐng)域快速發(fā)展的年輕技術(shù)公...
關(guān)鍵字: ce(全球TMT2022年2月21日訊)愛立信IoT Accelerator推出一款可靠、安全的蜂窩物聯(lián)網(wǎng)平臺(tái),使全球電信運(yùn)營(yíng)商(CSP)和企業(yè)能夠在數(shù)千萬臺(tái)設(shè)備上拓展其物聯(lián)網(wǎng)業(yè)務(wù)。愛立信發(fā)布IoT Accelerator...
關(guān)鍵字: ce 蜂窩物聯(lián)網(wǎng) 物聯(lián)網(wǎng)平臺(tái)英國(guó)倫敦和印度海得拉巴2022年2月10日 /美通社/ -- 數(shù)據(jù)科學(xué)和分析領(lǐng)導(dǎo)者Excelra 與人工智能先驅(qū)X-Chem之間的全新合作將加速臨床前藥物發(fā)現(xiàn),幫助...
關(guān)鍵字: ce靈活工作安排和“大辭職”潮無意間提高網(wǎng)絡(luò)風(fēng)險(xiǎn),值此之際,人工智能將加強(qiáng)安全團(tuán)隊(duì) 英國(guó)劍橋2022年1月28日 /美通社/ -- 網(wǎng)絡(luò)安全人工智...
關(guān)鍵字: ce(全球TMT2022年1月29日訊)網(wǎng)絡(luò)安全人工智能領(lǐng)域的全球領(lǐng)導(dǎo)者Darktrace宣布,其自主響應(yīng)技術(shù)現(xiàn)將在端點(diǎn)上采取行動(dòng) -- 完善Darktrace Antigena產(chǎn)品系列,該產(chǎn)品系列已覆蓋SaaS應(yīng)用程序、...
關(guān)鍵字: 人工智能 網(wǎng)絡(luò)安全 ce