{"id":7976,"date":"2024-04-20T08:01:01","date_gmt":"2024-04-20T00:01:01","guid":{"rendered":""},"modified":"2024-04-20T08:01:01","modified_gmt":"2024-04-20T00:01:01","slug":"UVM--\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5","status":"publish","type":"post","link":"https:\/\/mushiming.com\/7976.html","title":{"rendered":"UVM--\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5"},"content":{"rendered":"

 1 \u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5<\/h3>\n

mirrored\u3001 desired \u548c actual value<\/span><\/span><\/p>\n

\u5728\u5e94\u7528\u5bc4\u5b58\u5668\u6a21\u578b\u65f6\uff0c \u9664\u4e86\u5229\u7528\u5b83\u7684\u5bc4\u5b58\u5668\u4fe1\u606f\uff0c \u8fd8\u53ef\u4ee5\u5229\u7528\u5b83\u6765\u8ddf\u8e2a\u5bc4\u5b58\u5668\u7684\u503c\u3002 \u8ddf\u8e2a\u5bc4\u5b58\u5668\u7684\u503c\uff0c \u4e00\u65b9\u9762\u662f\u5efa\u7acb mirrored value, \u53e6\u4e00\u65b9\u9762\u662f\u4e3a\u5efa\u7acb desired value\u3002\u5bc4\u5b58\u5668\u6a21\u578b\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5bc4\u5b58\u5668\u90fd\u5e94\u8be5\u6709\u4e24\u4e2a\u503c\uff0c\u4e00\u4e2a\u662f\u955c\u50cf\u503c\uff08mirrored value\uff09\uff0c\u4e00\u4e2a\u662f\u671f\u671b\u503c (desired value) \u3002 \u671f\u671b\u503c\u662f\u5148\u5229\u7528\u5bc4\u5b58\u5668\u6a21\u578b\u4fee\u6539\u8f6f\u4ef6\u5bf9\u8c61\u503c\uff0c \u800c\u540e\u5229\u7528\u8be5\u503c\u66f4\u65b0\u786c\u4ef6\u503c<\/strong>\uff1b \u955c\u50cf\u503c\u662f\u8868\u793a\u5f53\u524d\u786c\u4ef6\u7684\u5df2\u77e5\u72b6\u6001\u503c<\/strong>\u3002 \u955c\u50cf\u503c\u5f80\u5f80\u7531\u6a21\u578b\u9884\u6d4b\u7ed9\u51fa\uff0c \u5173\u4e8e\u9884\u6d4b\uff0c\u5728\u524d\u95e8\u8bbf\u95ee\u65f6\u901a\u8fc7\u89c2\u5bdf\u603b\u7ebf\u6216\u5728\u540e\u95e8\u8bbf\u95ee\u65f6\u901a\u8fc7\u81ea\u52a8\u9884\u6d4b\u7b49\u65b9\u5f0f\u6765\u7ed9\u51fa\u955c\u50cf\u503c\u3002 \u7136\u800c\uff0c \u955c\u50cf\u503c\u6709\u53ef\u80fd\u4e0e\u786c\u4ef6\u5b9e\u9645\u503c (hardware actual value)\u4e0d\u4e00\u81f4<\/strong>\uff0c\u4f8b\u5982\u72b6\u6001\u5bc4\u5b58\u5668\u7684\u955c\u50cf\u503c\u5c31\u65e0\u6cd5\u4e0e\u786c\u4ef6\u5b9e\u9645\u503c\u4fdd\u6301\u540c\u6b65\u66f4\u65b0<\/strong>\u3002 \u53e6\u5916\uff0c \u5982\u679c\u5176\u4ed6\u8bbf\u95ee\u5bc4\u5b58\u5668\u7684\u901a\u8def\u4fee\u6539\u4e86\u5bc4\u5b58\u5668\uff0c \u90a3\u4e48\u53ef\u80fd\u7531\u4e8e\u90a3\u4e00\u8def\u603b\u7ebf\u6ca1\u6709\u88ab\u76d1\u6d4b\uff0c \u5bfc\u81f4\u5bc4\u5b58\u5668\u7684\u955c\u50cf\u503c\u672a\u5f97\u5230\u53ca\u65f6\u66f4\u65b0\u3002<\/span><\/p>\n

prediction\u7684\u5206\u7c7b<\/span><\/span><\/strong><\/p>\n

UVM \u63d0\u4f9b\u4e86\u4e24\u79cd\u7528\u6765\u8ddf\u8e2a\u5bc4\u5b58\u5668\u503c\u7684\u65b9\u5f0f\uff0c \u6211\u4eec\u5c06\u5176\u5206\u4e3a\u81ea\u52a8\u9884\u6d4b (auto prediction)\u548c\u663e\u5f0f\u9884\u6d4b (explicit)\u3002 \u5982\u679c\u8bfb\u8005\u60f3\u4f7f\u7528\u81ea\u52a8\u9884\u6d4b\u7684\u65b9\u5f0f\uff0c\u8fd8\u9700\u8981\u8c03\u7528\u51fd\u6570 uvm_reg_map: :set_auto_predict ()<\/strong> \u3002\u4e24\u79cd\u9884\u6d4b\u65b9\u5f0f\u7684\u663e\u8457\u5dee\u522b\u5728\u4e8e\uff0c \u663e\u5f0f\u9884\u6d4b\u5bf9\u5bc4\u5b58\u5668\u6570\u503c\u9884\u6d4b\u66f4\u4e3a\u51c6\u786e\uff0c \u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u5bf9\u4e24\u79cd\u6a21\u5f0f\u7684\u5206\u6790\u5f97\u51fa\u5177\u4f53\u539f\u56e0\u3002<\/span><\/p>\n

\u81ea\u52a8\u9884\u6d4b (auto prediction) <\/strong>\uff1a<\/span>\u5982\u679c\u8bfb\u8005\u6ca1\u6709\u5728\u73af\u5883\u4e2d\u96c6\u6210\u72ec\u7acb\u7684 predictor, \u800c\u662f\u5229\u7528\u5bc4\u5b58\u5668\u7684\u64cd\u4f5c\u6765\u81ea\u52a8\u8bb0\u5f55\u6bcf\u4e00\u6b21\u5bc4\u5b58\u5668\u7684\u8bfb\u5199\u6570\u503c\uff0c \u5e76\u5728\u540e\u53f0\u81ea\u52a8\u8c03\u7528 predict()\u65b9\u6cd5\u7684\u8bdd\uff0c \u5219\u8fd9\u79cd\u65b9\u5f0f\u79f0\u4e3a\u81ea\u52a8\u9884\u6d4b<\/span>\u3002\u8fd9\u79cd\u65b9\u5f0f\u7b80\u5355\u6709\u6548\uff0c \u7136\u800c\u9700\u8981\u6ce8\u610f\uff0c \u5982\u679c\u51fa\u73b0\u5176\u4ed6\u4e00\u4e9bsequence \u76f4\u63a5\u5728\u603b\u7ebf\u5c42\u9762\u4e0a\uff0c\u5bf9\u5bc4\u5b58\u5668\u8fdb\u884c\u64cd\u4f5c\uff08\u8df3\u8fc7\u5bc4\u5b58\u5668\u7ea7\u522b\u7684 write()\/read()\u64cd\u4f5c\uff09\uff0c \u6216\u901a\u8fc7\u5176\u4ed6\u603b\u7ebf\u6765\u8bbf\u95ee\u5bc4\u5b58\u5668\u7b49\u8fd9\u4e9b\u989d\u5916\u7684\u60c5\u51b5\uff0c \u90fd\u65e0\u6cd5\u81ea\u52a8\u5f97\u5230\u5bc4\u5b58\u5668\u7684\u955c\u50cf\u503c\u548c\u9884\u671f\u503c\u3002<\/span><\/p>\n

\u663e\u5f0f\u9884\u6d4b (explicit prediction)<\/strong>\uff1a\u66f4\u4e3a\u53ef\u9760\u7684\u4e00\u79cd\u65b9\u5f0f\u662f\u5728\u7269\u7406\u603b\u7ebf\u4e0a\u901a\u8fc7\u76d1\u89c6\u5668\u6765\u6355\u6349\u603b\u7ebf\u4e8b\u52a1\uff0c \u5e76\u5c06\u6355\u6349\u5230\u7684\u4e8b\u52a1\u4f20\u9012\u7ed9\u5916\u90e8\u4f8b\u5316\u7684 predictor (\u9884\u6d4b\u5668\uff09\uff0c\u8be5 predictor \u7531 UVM \u53c2\u6570\u5316\u7c7b uvm_reg_predictor \u4f8b\u5316\u5e76\u96c6\u6210\u5728\u9876\u5c42\u73af\u5883\u4e2d<\/strong>\u3002 \u5982\u4e0b\u56fe\uff0c \u5728\u96c6\u6210\u7684\u8fc7\u7a0b\u4e2d\u9700\u8981\u5c06 adapter \u4e0e map \u7684\u53e5\u67c4\u4e5f\u4e00\u5e76\u4f20\u9012\u7ed9 predictor, \u540c\u65f6\u5c06 monitor \u91c7\u96c6\u7684\u4e8b\u52a1\u901a\u8fc7 analysis port \u63a5\u5165\u5230 predictor\u4e00\u4fa7\u3002\u8fd9\u79cd\u96c6\u6210\u5173\u7cfb\u53ef\u4ee5\u4f7f\u5f97 monitor\u4e00\u65e6\u6355\u6349\u5230\u6709\u6548\u4e8b\u52a1\uff0c \u4f1a\u53d1\u9001\u7ed9 predictor, \u518d\u7531\u5176\u5229\u7528adapter \u7684\u6865\u63a5\u65b9\u6cd5\uff0c \u5b9e\u73b0\u4e8b\u52a1\u4fe1\u606f\u8f6c\u6362\uff0c \u5e76\u5c06\u8f6c\u5316\u540e\u7684\u5bc4\u5b58\u5668\u6a21\u578b\u6709\u5173\u4fe1\u606f\u66f4\u65b0\u5230 map \u4e2d\u3002 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u7cfb\u7edf\u5c06\u91c7\u7528\u663e\u5f0f\u9884\u6d4b\u7684\u65b9\u5f0f\uff0c \u8fd9\u5c31\u8981\u6c42\u96c6\u6210\u5230\u73af\u5883\u4e2d\u7684\u603b\u7ebf UVC monitor \u9700\u8981\u5177\u5907\u6355\u6349\u4e8b\u52a1 \u7684\u529f\u80fd\u548c\u5bf9\u5e94\u7684 analysis port, \u4ee5\u4fbf\u4e8e\u540c predictor \u8fde\u63a5\u3002<\/span><\/p>\n

\"UVM--\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5<\/p>\n

\u5173\u4e8e predictor \u5728\u9876\u5c42\u73af\u5883\u4e2d\u7684\u96c6\u6210\uff0c \u8bfb\u8005\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u4e00\u6bb5\u4f8b\u7801\u7247\u6bb5\u6765\u638c\u63e1\u96c6\u6210\u65f6\u7684\u51e0\u4e2a\u8981\u7d20\uff1a<\/p>\n

class mcdf_bus_env extends uvm_env;\nmcdf_bus_agent agent;\nmcdf_rgm rgm; \nreg2mcdf_adapter reg2mcdf; \nuvm_reg_predictor #(mcdf_bus_trans) mcdf2reg_predictor; \n`uvm_component_utils(mcdf_bus_env)\n...\nfunction void build_phase(uvm_phase phase); \nagent=mcdf_bus_agent::type_id::create(\"agent\", this); \nif(!uvm_config_db#(mcdf_rgm)::get(this, \"\", \"rgm\", rgm)) begin\n`uvm_info(\"GETRGM\", \"no top-down RGM handle is assigned\", UVM_LOW) \nrgm = mcdf_rgm::type_id::create(\"rgm\", this); \n`uvm_info(\"NEWRGM\", \"created rgm instance locally\", UVM_LOW)\nend \nrgm. build() ; \nreg2mcdf = reg2mcdf_adapter::type_id::create(\"reg2mcdf\"); \nmcdf2reg_predictor = uvm_reg_predictor#(mcdf_bus_trans)::type_ id: : create (\"mcdf2reg_predcitor\", this); \nmcdf2reg_predictor.map = rgm.map; \nmcdf2reg_predictor.adapter = reg2mcdf; \nendfunction \nfunction void connect_phase(uvm_phase phase);\nrgm.map.set_sequencer(agent.sequencer, reg2mcdf); \nagent.monitor.ap.connect(mcdf2reg_predictor.bus_in);\nendfunction \nendclass <\/code><\/pre>\n

uvm_reg\u7684\u8bbf\u95ee\u65b9\u6cd5<\/span><\/span><\/p>\n

\u5728\u7ed9\u51fa\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c1\u5e94\u7528\u6a21\u5f0f\u4e4b\u524d\uff0c\u9996\u5148\u4ece\u4e0b\u8868\u4e2d\u66f4\u5168\u9762\u5730\u4e86\u89e3uvm_reg_ block\u3001 uvm_reg \u548cuvm_reg_ field \u4e09\u4e2a\u7c7b\u63d0\u4f9b\u7684\u7528\u4e8e\u8bbf\u95ee\u5bc4\u5b58\u5668\u7684\u65b9\u6cd5\u3002<\/span><\/p>\n

\"UVM--\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5<\/p>\n

 uvm_reg_ sequence \u63d0\u4f9b\u7684\u65b9\u6cd5\uff08\u5747\u662f\u9488\u5bf9\u5bc4\u5b58\u5668\u5bf9\u8c61\u7684\uff0c \u800c\u4e0d\u662f\u5bc4\u5b58\u5668\u5757\u6216\u5bc4\u5b58\u5668\u57df\uff09\u5982\u4e0b\u8868\u3002<\/p>\n

\"UVM--\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5<\/p>\n

\u7ed3\u5408mirrored value\u3001 desired value \u548c actual value, \u6211\u4eec\u9700\u8981\u7406\u89e3\u8fd94\u79cd\u65b9\u6cd5\u5728\u8c03\u7528\u65f6\uff0c \u4e09\u79cd\u6570\u503c\u7684\u53d8\u5316\u65f6\u5e8f\u5173\u7cfb\uff1a <\/p>\n

\u2022    \u5bf9\u4e8e\u524d\u95e8\u8bbf\u95ee\u7684 read()\u548c write(), \u5728\u603b\u7ebf\u4e8b\u52a1\u5b8c\u6210\u65f6\uff0c \u955c\u50cf\u503c\u548c\u671f\u671b\u503c\u624d\u4f1a\u66f4\u65b0\u4e3a\u4e0e\u603b\u7ebf\u4e0a\u76f8\u540c\u7684\u503c\uff0c \u8fd9\u79cd\u9884\u6d4b\u65b9\u5f0f\u662f\u663e\u5f0f\u9884\u6d4b\u3002<\/strong>
\u2022    \u5bf9\u4e8e peek()\u548c poke(), \u4ee5\u53ca\u540e\u95e8\u8bbf\u95ee\u6a21\u5f0f\u4e0b\u7684 read()\u548c write(), \u7531\u4e8e\u4e0d\u901a\u8fc7\u603b\u7ebf\uff0c \u9ed8\u8ba4\u91c7\u53d6\u81ea\u52a8\u9884\u6d4b\u7684\u65b9\u5f0f\uff0c \u56e0\u6b64\u5728\u65b9\u6cd5\u8c03\u7528\u8fd4\u56de\u540e\uff0c \u955c\u50cf\u503c\u548c\u671f\u671b\u503c\u4e5f\u76f8\u5e94\u4fee\u6539\u3002<\/strong><\/p>\n

\u5173\u4e8e reset()\u548c get_reset()\u7684\u7528\u6cd5\uff0c \u4e0b\u9762\u4e5f\u7ed9\u51fa\u90e8\u5206\u4f8b\u7801\u3002 \u4f8b\u5982\u786c\u4ef6\u5728\u590d\u4f4d\u89e6\u53d1\u65f6\uff0c \u4f1a\u5c06\u5185\u90e8\u5bc4\u5b58\u5668\u503c\u590d\u4f4d\uff0c \u800c\u5bc4\u5b58\u5668\u6a21\u578b\u5728\u6355\u6349\u5230\u590d\u4f4d\u4e8b\u4ef6\u65f6\uff0c \u4e3a\u4e86\u4fdd\u6301\u540c\u786c\u4ef6\u884c\u4e3a\u4e00\u81f4\uff0c \u4e5f\u5e94\u5f53\u5bf9\u5176\u590d\u4f4d\u3002 \u8fd9\u91cc\u6ce8\u610f\u7684\u662f\uff0c \u590d\u4f4d\u7684\u5bf9\u8c61\u662f\u5bc4\u5b58\u5668\u6a21\u578b\uff0c \u800c\u4e0d\u662f\u786c\u4ef6<\/strong>\u3002<\/p>\n

\n

@(negedge p_sequencer.vif.rstn); 
rgm. reset(); \/ \/ register block reset for mirrored value and desired value<\/p>\n

rgm.chnl0_ctrl_reg.reset(); \/\/ register level reset 
rgm.chnl0_ctrl_reg.pkt_len.reset(); \/\/ register field reset<\/p>\n<\/blockquote>\n

\u5728\u590d\u4f4d\u4e4b\u540e\uff0c \u7528\u6237\u4e5f\u53ef\u4ee5\u901a\u8fc7\u8bfb\u53d6\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u590d\u4f4d\u503c\uff08\u4e0e\u5bc4\u5b58\u5668\u63cf\u8ff0\u6587\u4ef6\u4e00\u81f4\uff09\uff0c \u4e0e\u524d\u95e8\u8bbf\u95ee\u83b7\u53d6\u7684\u5bc4\u5b58\u5668\u590d\u4f4d\u503c\u8fdb\u884c\u6bd4\u8f83\uff0c \u4ee5\u6b64\u5224\u65ad\u786c\u4ef6\u5404\u4e2a\u5bc4\u5b58\u5668\u7684\u590d\u4f4d\u503c\u662f\u5426\u6309\u7167\u5bc4\u5b58\u5668\u63cf\u8ff0\u53bb\u5b9e\u73b0\u3002 \u8fd9\u91cc\u7684 get_reset()\u65b9\u6cd5\u6307\u7684\u4e5f\u662f\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u590d\u4f4d\u503c\uff0c \u800c\u4e0d\u662f\u786c\u4ef6\u3002<\/strong><\/p>\n

\n

\/\/ register model reset value get and check 
rstval = rgm.chnl0_ctrl_reg. get_reset() ; 
rgm.chnl0_ctrl_reg.read (status, data, UVM_BACKDOOR, .parent(this));<\/p>\n

if(rstval != data)<\/p>\n

`uvm_error (\"RSTERR\", \"reset value read is not the desired reset value\")  <\/p>\n<\/blockquote>\n

mirror()\u65b9\u6cd5\u4e0e read()\u65b9\u6cd5\u7c7b\u4f3c\uff0c \u4e5f\u53ef\u4ee5\u9009\u62e9\u524d\u95e8\u8bbf\u95ee\u6216\u540e\u95e8\u8bbf\u95ee\uff0c \u4e0d\u540c\u7684\u662f\uff0c mirror()\u4e0d\u4f1a\u8fd4\u56de\u8bfb\u56de\u7684\u6570\u503c\uff0c \u4f46\u662f\u4f1a\u5c06\u5bf9\u5e94\u7684\u955c\u50cf\u503c\u4fee\u6539<\/strong>\u3002 \u5728\u4fee\u6539\u955c\u50cf\u503c\u4e4b\u524d\uff0c \u7528\u6237\u8fd8\u53ef\u4ee5\u9009\u62e9\u662f\u5426\u5c06\u8bfb\u56de\u7684\u503c\u4e0e\u6a21\u578b\u4e2d\u7684\u539f\u955c\u50cf\u503c\u8fdb\u884c\u6bd4\u8f83\u3002 \u4e0b\u9762\u7684\u4f8b\u7801\u5728\u66f4\u65b0\u955c\u50cf\u503c\u4e4b\u524d\uff0c \u9996\u5148\u5c06\u8bfb\u56de\u7684\u503c\u4e0e\u4e0a\u4e00\u6b21\u955c\u50cf\u503c\u505a\u4e86\u6bd4\u5bf9\uff0c \u968f\u540e\u518d\u66f4\u65b0\u955c\u50cf\u503c\u3002 \u6bd4\u5982\uff0c \u5bf9\u4e8e\u914d\u7f6e\u5bc4\u5b58\u5668\uff0c \u53ef\u4ee5\u91c7\u7528\u8fd9\u79cd\u65b9\u6cd5\u6765\u68c0\u67e5\u4e0a\u4e00\u6b21\u7684\u914d\u7f6e\u662f\u5426\u751f\u6548\uff0c \u53c8\u6216\u8005\u5bf9\u4e8e\u72b6\u6001\u5bc4\u5b58\u5668\u53ef\u4ee5\u9009\u62e9\u53ea\u66f4\u65b0\u955c\u50cf\u503c\u4e0d\u505a\u6bd4\u8f83\uff0c \u8fd9\u662f\u56e0\u4e3a\u72b6\u6001\u5bc4\u5b58\u5668\u968f\u65f6\u53ef\u80fd\u88ab\u786c\u4ef6\u5185\u90e8\u903b\u8f91\u4fee\u6539\u3002<\/p>\n

\n

\/\/ get register value and check 
rgm.chnl0_ctrl_reg.mirror(status, UVM_CHECK, UVM_FRONTDOOR,parent(this));<\/p>\n<\/blockquote>\n

\u4e0b\u9762\u7684\u65b9\u6cd5\u662f\u8fd0\u7528 set()\u548c update()\u5bf9\u5bc4\u5b58\u5668\u505a\u6279\u91cf\u4fee\u6539<\/span>\u3002 \u9996\u5148 set()\u65b9\u6cd5\u7684\u5bf9\u8c61\u662f\u5bc4\u5b58\u5668\u6a21\u578b\u81ea\u8eab\uff0c \u901a\u8fc7 set()\u53ef\u4ee5\u4fee\u6539\u671f\u671b\u503c\uff0c \u800c\u5728\u5bc4\u5b58\u5668\u914d\u7f6e\u65f6\u4e0d\u59a8\u5148\u5bf9\u5176\u6a21\u578b\u968f\u673a\u5316\uff0c \u518d\u914d\u7f6e\u4e2a\u522b\u5bc4\u5b58\u5668\u6216\u57df\uff0c \u5f53\u5bc4\u5b58\u5668\u7684\u671f\u671b\u503c\u4e0e\u955c\u50cf\u503c\u4e0d\u76f8\u540c\u65f6\uff0c \u53ef\u4ee5\u901a\u8fc7 update()\u65b9\u6cd5\u6765\u5c06\u4e0d\u76f8\u540c\u7684\u5bc4\u5b58\u5668\u901a\u8fc7\u524d\u95e8\u8bbf\u95ee\u6216\u540e\u95e8\u8bbf\u95ee\u7684\u65b9\u5f0f\u505a\u5168\u90e8\u4fee\u6539<\/strong>\u3002\u8fd9\u79cd set()\u548c update()\u7684\u65b9\u5f0f\u8f83 write()\u548c poke()\u7684\u5199\u5bc4\u5b58\u5668\u65b9\u5f0f\u66f4\u4e3a\u7075\u6d3b\u7684\u662f\uff0c\u5b83\u53ef\u4ee5\u5b9e\u73b0\u968f\u673a\u5316\u5bc4\u5b58\u5668\u914d\u7f6e\u503c\uff08\u5148\u968f\u673a\u5316\u5bc4\u5b58\u5668\u6a21\u578b\uff0c\u540e\u5c06\u968f\u673a\u503c\u7ed3\u5408\u67d0\u4e9b\u57df\u7684\u6307\u5b9a\u503c\u5199\u5165\u5230\u5bc4\u5b58\u5668\uff09\uff0c\u7ee7\u800c\u6a21\u62df\u66f4\u591a\u4e0d\u53ef\u9884\u77e5\u7684\u5bc4\u5b58\u5668\u5e94\u7528\u573a\u666f\u3002 \u53e6\u5916\uff0c update()\u5f3a\u5927\u7684\u6279\u91cf\u64cd\u4f5c\u5bc4\u5b58\u5668\u529f\u80fd\u4f7f\u5f97\u4fee\u6539\u5bc4\u5b58\u5668\u66f4\u4e3a\u4fbf\u6377\u3002 <\/p>\n

\/\/ randomize register model, set register\/field value and update to \n\/\/ hardware actual value \nvoid'(rgm. chnlO_ctrl_reg. randomize()); \nrgm.chnlO ctrl reg.pkt len.set('h3); \nrgm.chnlO ctrl reg. update (status, UVM FRONTDOOR, .parent (this)); void'(rgm.chnll_ctrl_reg.randomize()); \nrgm. chnl0_ctrl_reg. set ('h22); \nrgm.update(status, UVM FRONTDOOR, .parent(this)); <\/code><\/pre>\n

mem\u4e0ereg\u7684\u8054\u7cfb\u548c\u5dee\u522b <\/span><\/span><\/p>\n

UVM\u5bc4\u5b58\u5668\u6a21\u578b\u4e5f\u53ef\u4ee5\u7528\u6765\u5bf9\u5b58\u50a8\u5efa\u6a21\u3002uvm_mem \u7c7b\u53ef\u4ee5\u7528\u6765\u6a21\u62dfRW (\u8bfb\u5199\uff09\u3001 RO\uff08\u53ea\u8bfb\uff09\u548cWO(\u53ea\u5199\uff09\u7c7b\u578b\u7684\u5b58\u50a8\uff0c\u5e76\u4e14\u53ef\u4ee5\u914d\u7f6e\u5b58\u50a8\u6a21\u578b\u7684\u6570\u636e\u5bbd\u5ea6\u548c\u5730\u5740\u8303\u56f4\u3002 uvm_mem\u4e0d\u540c\u4e8euvm_reg \u7684\u5730\u65b9\u5728\u4e8e\uff0c\u8003\u8651\u5230\u7269\u7406\u5b58\u50a8\u4e00\u65e6\u6620\u5c04\u5230 uvm_mem \u4f1a\u5e26\u6765\u66f4\u5927\u7684\u8d44\u6e90\u6d88\u8017\uff0c\u56e0\u6b64 uvm_mem \u5e76\u4e0d\u652f\u5f85\u9884\u6d4b\u548c\u5f71\u5b50\u5b58\u50a8\uff08shadow storage) \u529f\u80fd\uff0c \u5373\u6ca1\u6709\u955c\u50cf\u503c\u548c\u671f\u671b\u503c\u3002
uvm_mem \u53ef\u4ee5\u63d0\u4f9b\u7684\u529f\u80fd\u5c31\u662f\u5229\u7528\u81ea\u5e26\u7684\u65b9\u6cd5\u53bb\u8bbf\u95ee\u786c\u4ef6\u5b58\u50a8\uff0c \u76f8\u6bd4\u4e8e\u76f4\u63a5\u5229\u7528\u786c\u4ef6\u603b\u7ebf UVC\u8fdb\u884c\u8bbf\u95ee\uff0c\u8fd9\u4e48\u505a\u7684\u597d\u5904\u5728\u4e8e\uff1a<\/span><\/p>\n

\u2022    \u7c7b\u4f3c\u4e8e\u5bc4\u5b58\u5668\u6a21\u578b\u8bbf\u95ee\u5bc4\u5b58\u5668\uff0c\u5229\u7528\u5b58\u50a8\u6a21\u578b\u8bbf\u95ee\u786c\u4ef6\u5b58\u50a8\u4fbf\u4e8e\u7ef4\u62a4\u548c\u590d\u7528\u3002<\/strong>
\u2022    \u5728\u8bbf\u95ee\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u5229\u7528\u6a21\u578b\u7684\u5730\u5740\u8303\u56f4\u6765\u6d4b\u8bd5\u786c\u4ef6\u7684\u5730\u5740\u8303\u56f4\u662f\u5426\u5168\u90e8\u8986\u76d6<\/strong>\u3002
\u2022    \u7531\u4e8e uvm_mem \u4e5f\u540c\u65f6\u63d0\u4f9b\u524d\u95e8\u8bbf\u95ee\u548c\u540e\u95e8\u8bbf\u95ee\uff0c\u8fd9\u4f7f\u5f97\u5b58\u50a8\u6d4b\u8bd5\u53ef\u4ee5\u8003\u8651\u5148\u901a\u8fc7\u540e\u95e8\u8bbf\u95ee\u9884\u5148\u52a0\u8f7d\u5b58\u50a8\u5185\u5bb9\uff0c\u800c\u540e\u901a\u8fc7\u524d\u95e8\u8bbf\u95ee\u8bfb\u53d6\u5b58\u50a8\u5185\u5bb9\uff0c\u7ee7\u800c\u505a\u6570\u636e\u6bd4\u5bf9\uff0c\u8fd9\u6837\u505a\u4e0d\u4f46\u8282\u7701\u65f6\u95f4\uff0c\u540c\u65f6\u4e5f\u5728\u6d4b\u8bd5\u65b9\u5f0f\u4e0a\u4fdd\u6301\u4e86\u4e00\u81f4\u6027\u3002\u540c\u65f6\u8fd9\u79cd\u65b9\u5f0f\u76f8\u6bd4\u4e8e\u4f20\u7edf\u524d\u540e\u6d4b\u8bd5\u65b9\u5f0f\uff08\u5229\u7528\u7cfb\u7edf\u51fd\u6570\u6216\u4eff\u771f\u5668\u51fd\u6570\u5b9e\u73b0\u5b58\u50a8\u52a0\u8f7d\uff09\uff0c\u8981\u5728UVM\u6d4b\u8bd5\u6846\u67b6\u4e2d\u66f4\u4e3a\u7edf\u4e00\u3002<\/span><\/p>\n

\u4e0e uvm_reg \u76f8\u6bd4\uff0c uvm_mem \u4e0d\u4f46\u62e5\u6709\u5e38\u89c4\u7684\u8bbf\u95ee\u65b9\u6cd5 read() \u3001 write() \u3001 peek()\u548c poke(), \u4e5f\u63d0\u4f9b\u4e86 burst_read()\u548c burst_write() \u3002<\/strong>\u4e4b\u6240\u4ee5\u989d\u5916\u63d0\u4f9b\u8fd9\u4e24\u79cd\u65b9\u6cd5\uff0c \u4e0d\u4f46\u662f\u4e3a\u4e86\u53ef\u4ee5\u66f4\u9ad8\u901f\u5730\u901a\u8fc7\u7269\u7406\u603b\u7ebf\u7684BURST\u65b9\u5f0f\u8fde\u7eed\u5b58\u50a8\uff0c\u4e5f\u662f\u4e3a\u4e86\u5c3d\u53ef\u80fd\u8d34\u5408\u5b9e\u9645\u8bbf\u95ee\u5b58\u50a8\u4e2d\u7684\u573a\u666f<\/strong>\u3002 \u8981\u5b9e\u73b0BURST\u8bbf\u95ee\u5f62\u5f0f\uff0c \u9700\u8981\u8003\u8651\u4e0b\u9762\u8fd9\u4e9b\u56e0\u7d20\uff1a<\/span><\/p>\n

\u2022    \u76ee\u524d\u6302\u8f7d\u7684\u603b\u7ebfUVC\u662f\u5426\u652f\u6301BURST\u5f62\u5f0f\u8bbf\u95ee\uff0c\u4f8b\u5982APB\u4e0d\u80fd\u652f\u6301BURST\u8bbf\u95ee\u6a21\u5f0f\u3002<\/span><\/p>\n

\u2022    \u4e0e read()\u3001 write()\u65b9\u6cd5\u76f8\u6bd4\uff0cburst_read()\u548c burst_write()\u7684\u53c2\u6570\u5217\u8868\u4e2d\u7684\u4e00\u9879uvm_reg_ data _t value[]\u91c7\u7528\u7684\u662f\u6570\u7ec4\u5f62\u5f0f\uff0c \u4e0d\u518d\u662f\u5355\u4e00\u53d8\u91cf\uff0c \u5373\u8868\u793a\u7528\u6237\u53ef\u4ee5\u4f20\u9012\u591a\u4e2a\u6570\u636e\u3002 \u800c\u5728\u540e\u53f0\uff0c\u8fd9\u4e9b\u6570\u636e\u9996\u5148\u9700\u8981\u88c5\u8f7d\u5230 uvm_reg_item \u5bf9\u8c61\u4e2d\uff0c\u88c5\u8f7d\u65f6 value \u6570\u7ec4\u53ef\u4ee5\u76f4\u63a5\u5199\u5165\uff0c \u53e6\u5916\u4e24\u4e2a\u6210\u5458\u9700\u8981\u5206\u522b\u6307\u5b9a\u4e3a element_kind = UVM_MEM , kind = UVM_BURST_READ\u3002<\/span><\/p>\n

\u2022    \u5728 adapter \u5b9e\u73b0\u4e2d\uff0c \u4e5f\u9700\u8981\u8003\u8651\u5230\u5b58\u50a8\u6a21\u578b BURST \u8bbf\u95ee\u7684\u60c5\u5f62\uff0c \u5b9e\u73b0 4 \u79cd\u8bbf\u95ee\u7c7b\u578b(uvm _access_ e) \u7684\u8f6c\u6362\uff0c\u5373UVM_READ\u3001UVM_WRITE\u3001 UVM_BURS_READ \u548cUVM_BURST_ WRITE\u3002\u5bf9\u4e8e UVM_READ \u548c UVM_WRITE \u7684\u6865\u63a5\uff0c \u5df2\u7ecf\u5728\u5bc4\u5b58\u5668\u6a21\u578b\u8bbf\u95ee\u4e2d\u5b9e\u73b0\uff0c \u800c UVM_BURST_READ \u548c UVM_BURST_WRITE\u7684\u8f6c\u6362\uff0c\u5f80\u5f80\u9700\u8981\u8003\u8651\u5199\u5165\u7684\u6570\u636e\u957f\u5ea6<\/strong>\uff0c \u4f8b\u5982\u957f\u5ea6\u662f\u5426\u662f 4\u3001 8\u3001 16 \u6216\u5176\u4ed6\u3002 \u6bd4\u5982 AHB \u603b\u7ebf\uff0c \u652f\u6301\u8fde\u7eed 4 \u4e2a\u30018 \u4e2a\u3001 16 \u4e2a\u6570\u636e\u7684\u8bfb\u5199 (INCR4 \u3001 INCR8\u3001 INCR16), \u4f46\u662f\u5982\u679c\u6570\u636e\u957f\u5ea6\u4e0d\u662f\u8fd9\u4e9b\u56fa\u5b9a\u957f\u5ea6\u65f6\uff0c adapter \u8fd8\u9700\u8981\u81ea\u5df1\u5904\u7406\u6765\u5b9e\u73b0 INCR \u7684\u8fde\u7eed\u8bbf\u95ee\u65b9\u5f0f\u3002<\/span><\/p>\n

\u2022    \u6b64\u5916\u8fd8\u9700\u8981\u8003\u8651\u4e0d\u540c\u603b\u7ebf\u7684\u5176\u4ed6\u63a7\u5236\u53c2\u6570\uff0c \u4f8b\u5982 AHB \u652f\u6301 WRAP \u6a21\u5f0f\uff0c AXI \u652f\u6301out-of-order \u6a21\u5f0f\u7b49\uff0c \u5982\u679c\u60f3\u8981\u5c06\u66f4\u591a\u7684\u603b\u7ebf\u63a7\u5236\u5c01\u88c5\u5728 adapter \u7684\u6865\u63a5\u529f\u80fd\u91cc\uff0c \u9700\u8981\u5c06\u66f4\u591a\u7684\u914d\u7f6e\u4f5c\u4e3a\u6269\u5c55\u914d\u7f6e\uff0c \u5728\u8c03\u7528\u8bbf\u95ee\u65b9\u6cd5\u65f6\u4f5c\u4e3a\u6269\u5c55\u4fe1\u606f\u7c7b\uff0c\u4f20\u5165\u5230\u5f62\u5f0f\u53c2\u6570uvm_object_extension\u3002\u5f85\u4f20\u5165\u540e\uff0c adapter \u5c06\u53ef\u4ee5\u5728\u6865\u63a5\u65b9\u6cd5\u4e2d\u62bd\u53d6\u51fa\u6269\u5c55\u4fe1\u606f\u7c7b\uff0c\u4f5c\u4e3a\u66f4\u51c6\u786e\u7684\u534f\u8bae\u8bbf\u95ee\u7684\u9650\u5b9a\u4f9d\u636e\u3002<\/span><\/p>\n

\u2022     \u5bf9\u4e8e\u66f4\u4e3a\u590d\u6742\u7684 BURST \u5f62\u5f0f\uff0c \u5982\u679c\u9700\u8981\u5b9e\u73b0\u66f4\u591a\u7684\u534f\u8bae\u914d\u7f6e\u8981\u6c42\uff0c \u90a3\u4e48\u7b14\u8005\u63a8\u8350\u76f4\u63a5\u5728\u603b\u7ebf UVC \u5c42\u9762\u53bb\u9a71\u52a8\u3002\u8fd9\u6837\u505a\u7684\u7075\u6d3b\u6027\u66f4\u5927\uff0c \u4e14\u66f4\u80fd\u5145\u5206\u5168\u9762\u7684\u6d4b\u8bd5\u5b58\u50a8\u63a5\u53e3\u7684\u534f\u8bae\u5c42\u5b8c\u5907\u6027\u3002\u56e0\u6b64\uff0c \u9a8c\u8bc1\u5e08\u5728\u4e3a\u5b58\u50a8\u6a21\u578b\u8bbf\u95ee\u5b9e\u73b0 adapter \u65b9\u6cd5\u65f6\uff0c \u9700\u8981\u8003\u8651\u7684\u662f\uff0c uvm_mem \u5c42\u9762\u7684\u65b9\u6cd5\u5e94\u8be5\u5c3d\u5458\u4fbf\u6377\u3001\u5fc5\u8981\u7684\u53c2\u6570\u5e94\u8be5\u5c11\u91cf\uff0c \u4ee5\u4fbf\u4e8e\u4f7f\u7528\u548c\u7ef4\u62a4\uff1b \u800c\u53e6\u4e00\u65b9\u9762\uff0c \u5982\u679c\u8981\u9996\u5148\u6d4b\u8bd5\u5b58\u50a8\u63a5\u53e3\u534f\u8bae\uff0c \u5219\u5e94\u8be5\u5728\u603b\u7ebf UVC \u7684\u5c42\u9762\u4e0a\u5b8c\u6210\u66f4\u5145\u5206\u7684\u9a8c\u8bc1\u3002<\/span><\/p>\n

\u5185\u5efasequences<\/span><\/span><\/p>\n

\u4e0d\u5c11\u6709\u7ecf\u9a8c\u7684 UVM \u7528\u6237\u53ef\u80fd\u4f1a\u5ffd\u7565 UVM \u9488\u5bf9\u5bc4\u5b58\u5668\u6a21\u578b\u5185\u5efa\u7684\uff08built-in) \u4e00\u4e9bsequence, \u5b9e\u9645\u4e0a\uff0c \u5c06\u8fd9\u4e9b\u81ea\u5efa\u7684\u5e8f\u5217\u4f5c\u4e3a\u9a8c\u8bc1\u9879\u76ee\u5f00\u59cb\u524d\u7684\u5065\u5eb7\u68c0\u67e5\u5fc5\u9009\u9879\uff0c \u5bf9\u6574\u4e2a\u9879\u76ee\u7684\u5e73\u7a33\u8fd0\u884c\u4f1a\u6709\u4e0d\u5c0f\u7684\u8d21\u732e\u3002 \u8fd9\u662f\u56e0\u4e3a\uff0c \u5728\u9879\u76ee\u7684\u5f00\u59cb\u9636\u6bb5\uff0c \u8bbe\u8ba1\u5185\u90e8\u7684\u903b\u8f91\u5c1a\u4e0d\u7a33\u5b9a\uff0c \u9a8c\u8bc1\u5e08\u8981\u8ddf\u4e0a\u8bbe\u8ba1\u7684\u8fdb\u5ea6\uff0c \u53ef\u4ee5\u5c55\u5f00\u9a8c\u8bc1\u7684\u90e8\u5206\u65e0\u5916\u4e4e\u662f\u7cfb\u7edf\u63a7\u5236\u4fe1\u53f7\uff08\u65f6\u949f\u3001\u590d\u4f4d\u3001 \u7535\u6e90\uff09\u548c\u5bc4\u5b58\u5668\u7684\u9a8c\u8bc1\u3002\u5728\u9879\u76ee\u65e9\u671f \uff0c \u5bc4\u5b58\u5668\u6a21\u578b\u7684\u9a8c\u8bc1\u53ef\u4ee5\u4e3a\u540e\u671f\u5404\u4e2a\u529f\u80fd\u70b9\u9a8c\u8bc1\u6253\u4e0b\u826f\u597d\u7684\u57fa\u7840\u3002 \u6bd4\u5982\uff0c \u901a\u8fc7\u5185\u5efa\u7684\u5bc4\u5b58\u5668\u5e8f\u5217\u53ef\u4ee5\u5b9e\u73b0\u5b8c\u5584\u7684\u5bc4\u5b58\u5668\u590d\u4f4d\u503c\u68c0\u67e5\uff0c \u53c8\u6bd4\u5982\u68c0\u67e5\u8bfb\u5199\u5bc4\u5b58\u5668\u7684\u8bfb\u5199\u529f\u80fd\u662f\u5426\u6b63\u5e38\u7b49\u3002
\u4e0d\u8fc7\u6709\u4e00\u4e9b\u5bc4\u5b58\u5668\u5373\u4fbf\u53ef\u4ee5\u6d4b\u8bd5\uff0c \u4e5f\u5efa\u8bae\u5c06\u5176\u4f5c\u4e3a\u4f8b\u5916\u800c\u8fc7\u6ee4\u51fa\u53bb\uff0c \u4f8b\u5982\u4e00\u4e9b\u91cd\u8981\u7684\u7cfb<\/span>\u7edf\u63a7\u5236\u4fe1\u53f7\uff08\u65f6\u949f\u3001\u590d\u4f4d\u3001\u7535\u6e90\uff09\uff0c \u5f53\u5199\u5165\u67d0\u4e9b\u503c\u4ee5\u540e\uff0c \u4f1a\u4f7f\u5f97\u7cfb\u7edf\u5168\u90e8\u6216\u5c40\u90e8\u590d\u4f4d\u3001\u65f6\u949f\u4e5f\u53ef\u80fd\u88ab\u5173\u95ed \uff0c \u8fd9\u5c31\u53ef\u80fd\u963b\u788d\u5bc4\u5b58\u5668\u7684\u4e0b\u4e00\u6b65\u68c0\u67e5\u3002 \u6240\u4ee5 UVM \u63d0\u4f9b\u4e86\u4e00\u4e9b\u7279\u6b8a\u57df\uff0c \u7528\u6765\u7981\u6b62sequence \u68c0\u67e5\u8fd9\u4e9b\u5bc4\u5b58\u5668\u6216\u5b58\u50a8\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4ece\u4e0b\u8868\u6765\u5206\u522b\u6d4f\u89c8\u6574\u7406\u51fa\u7684\u5bc4\u5b58\u5668\u548c\u5b58\u50a8\u76f8\u5173\u7684\u81ea\u5efasequence \u3002<\/span><\/p>\n

 \"UVM--\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5<\/p>\n

 \u5bc4\u5b58\u5668\u6a21\u578b\u5185\u5efa\u5e8f\u5217<\/p>\n

\"UVM--\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5 \u5b58\u50a8\u5668\u6a21\u578b\u5185\u5efa\u5e8f\u5217<\/p>\n

\u63a5\u4e0b\u6765\u6211\u4eec\u7ed9\u51fa\u4e00\u6bb5\u4f8b\u7801\uff0c\u6765\u6f14\u793a\u5982\u4f55\u5229\u7528\u5185\u5efa\u5e8f\u5217\u5b8c\u6210MCDF\u5bc4\u5b58\u5668\u6d4b\u8bd5\u4e00\u5f00\u59cb\u7684\u5065\u5eb7\u68c0\u67e5\u3002 \u4e0b\u9762\u7684\u4f8b\u7801\u5206\u522b\u6dfb\u52a0\u4e86 uvm_reg_ hw _reset_ seq\u3001 uvm_reg_ bit_ bash_ seq\u548c uvm _reg_ access_ seq \u6765\u6d4b\u8bd5\u5bc4\u5b58\u5668\u6a21\u578b\uff0c \u4ece\u4ee3\u7801\u7684\u6574\u6d01\u6027\u6765\u770b\uff0c \u7528\u6237\u5e76\u4e0d\u9700\u8981\u989d\u5916\u518d\u6dfb\u52a0\u4ec0\u4e48\uff0c \u8fd9\u79cd\u4f7f\u7528\u65b9\u5f0f\u975e\u5e38\u65b9\u4fbf\uff0c \u4e14\u53c8\u80fd\u5b8c\u6210\u5bc4\u5b58\u5668\u7684\u5927\u89c4\u6a21\u96c6\u6210\u6d4b\u8bd5\u3002 <\/p>\n

mcdf_rgm rgm; \n`uvm_object_utils(mcdf_example_seq)\n`uvm_declare_p_sequencer(mcdf_bus_sequencer)\n...\ntask body(); \nuvm_status_e status;\nuvm_reg_data_t data; \nuvm_reg_hw_reset_seq reg_rst_seq = new(); \nuvm_reg_bit_bash_seq reg_bit_bash_seq = new(); \nuvm_reg_access_seq reg_acc_seq = new(); \nif (! uvm_config_db# (mcdf_rgm)::get (null, get_full_name (), \"rgm\", rgm)) begin \n`uvm_error(\"GETRGM\", \"no top-down RGM handle is assigned\") \nend \n\/\/ wait reset asserted and release \n@(negedge p_sequencer.vif.rstn); \n@(posedge p_sequencer.vif.rstn); \n`uvm_info (\"BLTINSEQ\", \"register reset sequence started\", UVM LOW) \nreg_rst_seq.model = rgm; \nreg_rst_seq.start(m_sequencer);\n`uvm_info (\"BLTINSEQ\", \"register reset sequence finished\", UVM_LOW) \n`uvm_info(\"BLTINSEQ\", \"register bit bash sequence started\", UVM_LOW)\n\/\/reset hardware register and register model \nreg_bit_bash_seq.model = rgm; \nreg_bit_bash_seq.start(m_sequencer); \n`uvm_info(\"BLTINSEQ\", \"register bit bash sequence finished\", UVM_LOW) \n`uvm_info(\"BLTINSEQ\", \"register access sequence started\", UVM_LOW) \n\/\/reset hardware register and register model \nreg_acc_seq.model = rgm;\n`uvm info (\"BLTINSEQ\", \"register access sequence finished\", UVM LOW )\nendtask \nendclass <\/code><\/pre>\n

 \u5982\u679c\u60f3\u5c06\u4e00\u4e9b\u5bc4\u5b58\u5668\u6392\u9664\u5728\u67d0\u4e9b\u5185\u5efa\u5e8f\u5217\u6d4b\u8bd5\u8303\u56f4\u4e4b\u5916\uff0c \u53ef\u4ee5\u989d\u5916\u6dfb\u52a0\u4e0a\u9762\u5217\u8868\u4e2d\u63d0\u5230\u7684\u201c
\u7981\u6b62\u57df\u540d <\/strong>\u201d\u3002\u7531\u4e8e uvm_reg_block \u548c uvm_reg \u5747\u662f uvm_object \u7c7b\u800c\u4e0d\u662f uvm_ component \u7c7b\uff0c\u6240\u4ee5\u53ef\u4ee5\u4f7f\u7528 uvm_resource_ db \u6765\u914d\u7f6e \u201c \u7981\u6b62\u57df\u540d \u201c<\/strong>\u3002\u4e0b\u9762\u7684\u4ee3\u7801\u6458\u81ea mcdf_rgm::build()\u65b9\u6cd5\uff0c \u8fd9\u76f8\u5f53\u4e8e\u5bc4\u5b58\u5668\u6a21\u578b\u5728\u81ea\u5df1\u7684\u5efa\u7acb\u9636\u6bb5\u8bbe\u5b9a\u4e86\u4e00\u4e9b\u5c5e\u6027\u3002\u5f53\u7136\uff0c uvm_resource_ db \u7684\u914d\u7f6e\u4e5f\u53ef\u4ee5\u5728\u66f4\u9ad8\u5c42\u6307\u5b9a\uff0c \u53ea\u4e0d\u8fc7\u8003\u8651\u5230 uvm_resource_ db \u4e0d\u5177\u5907\u5c42\u6b21\u5316\u7684\u8986\u76d6\u5c5e\u6027\uff0c \u6211\u4eec\u5efa\u8bae\u53ea\u5728 \u4e00\u4e2a\u5730\u65b9\u8fdb\u884c \u201c \u7981\u6b62\u57df\u540d \u201d \u7684\u914d\u7f6e\u3002<\/p>\n

class mcdf_rgm extends uvm_reg_block;\n...\nvirtual function build(); \n\/\/ disable built-in seq attributes \nuvm_resource_db#(bit)::set ({\"REG::\", this. chnlO stat reg. get full name () } , \nNO REG ACCESS TEST\", 1); \nuvm_resource_db# (bit)::set ({ \"REG: : \", this. chnll stat reg.get full name () } , \n\"NO REG ACCESS TEST\", 1); \nuvm_resource_db#(bit):: set ({\"REG: : \", this. chnl2 stat reg. get full name () } , \n\"NO REG ACCESS TEST\", l); \nendfunction\nendclass<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"UVM--\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd51\u5bc4\u5b58\u5668\u6a21\u578b\u7684\u5e38\u89c4\u65b9\u6cd5mirrored\u3001desired\u548cactualvalue\u5728\u5e94\u7528\u5bc4\u5b58\u5668\u6a21\u578b\u65f6\uff0c\u9664\u4e86\u5229\u7528\u5b83\u7684\u5bc4\u5b58\u5668\u4fe1...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7976"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=7976"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/7976\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=7976"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=7976"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=7976"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}