sanketshah Posted December 13, 2012 Report Share Posted December 13, 2012 Can I use uvm_config_db::set and get in run_phase?? Quote Link to comment Share on other sites More sharing options...
dave_59 Posted December 13, 2012 Report Share Posted December 13, 2012 The only requirement is that you do a set before a get if you want to get what you set. If you do both in the run_phase, then you need some other synchronization mechanism. Quote Link to comment Share on other sites More sharing options...
sanketshah Posted December 13, 2012 Author Report Share Posted December 13, 2012 Thanks Dave. Here is my real concern. I set an initial value of flag in build_phase of upper layer component. Down component is also getting the value using get function build_phase. Now my upper level component may change this flag multiple time in run_phase. Can I see that updated value in lower level without calling get in run_phase? Quote Link to comment Share on other sites More sharing options...
dave_59 Posted December 13, 2012 Report Share Posted December 13, 2012 Rather than setting and getting values from the configuration database, it is much more efficient to create a configuration object, use the configuration database to set and get a handle to the object once, and then modify the configuration object members as needed. See https://verificationacademy.com/cookbook/Config/Overview Quote Link to comment Share on other sites More sharing options...
sanketshah Posted December 13, 2012 Author Report Share Posted December 13, 2012 The problem is any component can set and get same flag any time. But they wont do at the same time? in which component do i use set and get? or Do I need set and get in both component? Basically, I have flag which I am sharing between component and any one of them can modify it and also read it. Quote Link to comment Share on other sites More sharing options...
dave_59 Posted December 13, 2012 Report Share Posted December 13, 2012 You probably need to explain a little more what this flag is for. There may be other mechanisms in the UVM to do what you need. You should not be using the configuration data base as a synchronization mechanism. Quote Link to comment Share on other sites More sharing options...
sanketshah Posted December 13, 2012 Author Report Share Posted December 13, 2012 Okay Dave. Let me try explaining a better way. I have two components C1 and C2. they both run state machine individually based on the transactions they are receiving plus the value of flags, which are shared between them. In both state machines one of the state in each is programming. When C1 is programming(signal c1_active) C2 can not program. c1_active,which is shared signal, prevents C2 from programming. and When C2 is programming(signal c2_active) and C1 ask to program C2 will quit(disable c2_active) and C1 will start programming. So C1 should be able to set c1_active, C2 should be able to set c2_active, C1 should be able to disable c2_active, and C2 should be able to read c1_active. Let me if you have further doubt. Quote Link to comment Share on other sites More sharing options...
yangyuf Posted January 7, 2013 Report Share Posted January 7, 2013 To my understanding, you can use uvm_config_db. Try the following: 1): define a class (calss c1_c2_status), incldue c1_active / c2_active in it. 2): then create an object (c1_c2_status status;) in compoent C1 and C2 (but don't create it). 3): create an object (c1_c2_status status_top) in your env (you need create this object). And in build phase. use uvm_config_db to pass the handle of status_top to C1.status and C2.status. 4): then both compoent C1 an C2 can r/w c1_active, c2_active. The same as dave_59 has said before. Please see below: Rather than setting and getting values from the configuration database, it is much more efficient to create a configuration object, use the configuration database to set and get a handle to the object once, and then modify the configuration object members as needed. See https://verificationacademy.com/cookbook/Config/Overview Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.