14 Mar Resource Database
Configuration Database 페이지에 소개된 uvm_config_db
와 유사하게 resource database를 관리하는 uvm_resource_db
에 대해 소개한다. 하지만 일반적으로 uvm_resource_db
대신 uvm_config_db
를 사용하는 것이 권장되기 때문에 세부적인 내용까지 자세히 다루지는 않는다. 이유는 아래에서 설명한다.
먼저 uvm_resource_db
의 사용법은 다음과 같다. 아래에 기술된 set
, read_by_name
외에도 read_by_type
, get_by_name
, get_by_type
, write_by_name
, write_by_type
등이 있다.
class my_test extends uvm_test; // ... function void build_phase(uvm_phase phase); // ... // set resource database uvm_resource_db#(int)::set("uvm_test_top.env", "my_int", 1024); endfunction: build_phase endclass: my_test
class my_env extends uvm_env; // ... function void build_phase(uvm_phase phase); // ... // get resource database if (!uvm_resource_db#(int)::read_by_name("uvm_test_top.env", "my_int", my_int)) begin my_int = -1; end `uvm_info(get_type_name(), $sformatf("my_int = %1d", my_int), UVM_MEDIUM) endfunction: build_phase endclass: my_env
uvm_config_db
는 uvm_resource_db
에 한 단계 layer를 추가한 것으로서 uvm_resource_db
가 할 수 있는 모든 기능을 동일하게 수행할 수 있다. uvm_resource_db
는 ‘last write wins’ 방식에 의해 동작하는 반면, uvm_config_db
는 ‘parent wins’ 방식을 사용하는 대표적인 차이가 있다. 일반적으로 build_phase
에서 configuration, resource control을 하는 경우가 많은데, build_phase
는 top-down 순서로 진행되기 때문에 uvm_resource_db
사용 시, 의도와 다르게 동작할 여지가 있다. 참고로 start_of_simulation_phase
부터 run_phase
등의 경우 uvm_config_db
도 ‘last write wins’ 방식으로 동작한다.
아래에서 볼 수 있듯, instance를 지정하기 위해 string만을 사용하는 uvm_resource_db
와 달리, uvm_component 정보와 string을 함께 사용하는 uvm_config_db
는 testbench hierarchy를 기술할 때 typo와 같은 실수의 여지를 줄여주는 장점이 있다. uvm_resource_db
는 scope를 지정하기 위한 string으로 hierarchy에 있지 않은 임의의 path를 지정할 수도 있지만, 이는 권장되는 UVM 사용 방식은 아니다.
// uvm_resource_db static function void set(input string scope, input string name, T val, input uvm_object accessor = null)
// uvm_resource_db static function bit read_by_name(input string scope, input string name, inout T val, input uvm_object accessor = null)
// uvm_config_db static function void set(uvm_component cntxt, string inst_name, string field_name, T value)
// uvm_config_db static function bit get(uvm_component cntxt, string inst_name, string field_name, inout T value)
위에서 언급한 이유로 인해 특별한 이유가 없다면 uvm_resource_db
대신 uvm_config_db
를 사용할 것을 권장한다.
References
- https://www.vmmcentral.com/uvm_vmm_ik/files3/base/uvm_resource_db-svh.html
- https://verificationacademy.com/forums/uvm/what-difference-between-uvmconfigdb-and-uvmresourcedb
Jung Ik Moon
Verification Engineer
Unknown
Posted at 22:34h, 14 Septembercan value be written in agent using write_by_name and read in environment using read_by_name or it is not possible in reading in higher hierarchy while writing in lower hierarchy.
Another question is can’t we set in lower hierarchy and get in higher hierarchy.
IKS
Posted at 22:36h, 14 SeptemberIt doesn’t actually matter where you set and get.
What matters is the scope and the name.
As long as they match, it should work.
Same applies to write_by_name and read_by_name.
BTW, uvm_resource_db is not recommended.
Use uvm_config_db instead.
खिलौना अश्लील
Posted at 15:48h, 30 Marchलड़की हस्तमैथुन अश्लील qqyyooppxx.DunVYTqHcRp
समूह सेक्स के बारे में बतावल गइल बा
Posted at 23:48h, 30 Marchखिलौना अश्लील बा hjkvbasdfzxzz.osc1z3dZJ6O
विंटेज और युवा पोर्न
Posted at 19:12h, 01 Aprilबीबीडब्ल्यू अश्लील txechdyzxca.LylN4LGOvWl
व्यभिचारी पति अश्लील
Posted at 02:34h, 03 Aprilमिशनरी शैली की अश्लीलता hkyonet.iMjIGtxjqoY
ladesbet funny ਸੈਕਸ ਪੋਰਨ
Posted at 13:40h, 05 Aprilladesbet ਹਾਰਡਕੋਰ ਪੋਰਨੋਗ੍ਰਾਫੀ ladesinemi.DH4kpNaE9Oo
ladesbet フィスティングポルノ
Posted at 15:21h, 05 Aprilladesbet ヴィンテージポルノ ladestinemi.xZEANgTNnwM