Diva34 Posted April 14, 2015 Report Posted April 14, 2015 Which is best method to start , randomize and end the sequence among the `uvm_do, start_item, `uvm_create, `uvm_send and the others and why? Please explain. Quote
dave_59 Posted April 14, 2015 Report Posted April 14, 2015 The best method is not to use the macros at all. Learn the basics without the use of the macros. See http://verificationhorizons.verificationacademy.com/volume-7_issue-2/articles/stream/are-ovm-and-uvm-macros-evil-a-cost-benefit-analysis_vh-v7-i2.pdf ljepson74 1 Quote
bhunter1972 Posted April 14, 2015 Report Posted April 14, 2015 Totally disagree with the above answer. The best is to use the macros. Religion aside for a second, it all depends on the situation: If you want to create a sequence on a sequencer, randomize it, and send it, then `uvm_do does all that for you. If you want to create a sequence, set some values inside of it, and then send it, then the combination of `uvm_create and `uvm_send is best. If you need constraints, use the _with macros. If it's on another sequencer, use the _on macros. Mix and match as appropriate. As for whether to use macros or not, I agree that it's best to know what they all do under the hood. However, macros always have two benefits: 1. They reduce the amount of code that you have to type, which reduces the number of mistakes you need to debug. 2. If the underlying code of the macros is later improved, you don't need to change any code anywhere at any time. You get the improvements for free. Quote
David Black Posted April 16, 2015 Report Posted April 16, 2015 On the other hand, in order to use the macros correctly, you must learn what each of the macros does. Depending on whether you are using these for sequence_item's (transactions) or sub-sequences, there are only three or four basic steps in either one. Since the experts disagree, we suggest you learn both ways and only once you fully appreciate the differences make a selection. If you don't learn both ways, you may find yourself confused when you stumble over code written by somebody else. tudor.timi 1 Quote
gordon.mcgregor Posted April 19, 2015 Report Posted April 19, 2015 You may find this blog post useful that I wrote on this topic. http://www.fivecomputers.com/much-ado-about-nothing.html Quote
ljepson74 Posted April 24, 2015 Report Posted April 24, 2015 By "best", I believe you mean the "best method for someone who is new to UVM". As someone who has been using UVM for a few years, but is still pretty green with it, here are my thoughts. Avoid the `uvm_do macros until you can comfortably work without them. (And in my case, I still don't use them. In my early UVM days, they just led to a lot of confusion for me, as I looked at examples of the different ways to do things.) I found that sticking with the following got me going when I was floundering in the assorted examples online showing different ways to send sequences. `uvm_create(item) start_item(item); // randomize item and/or assign to it here. finish_item(item); I strongly agree with the following. "The [‘uvm_do] macros also obscure a very simple interface for executing sequences and sequence items. Although 18 in number, they are inflexible and provide a small subset of the possible ways of executing. If none of the [‘uvm_do] macro flavors provide the functionality you need, you will need to learn how to execute sequences without the macros. And once you’ve learned that, you might as well code smartly and avoid them all together. " -from Adam Erickson whitepaper -http://events.dvcon.org/2011/proceedings/papers/09_1.pdf Quote
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.