In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "what is the use of Callback". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
The callback in Systemverilog specifies a called callback method and a callback hook that invokes callback method.
Callback method is usually dummy method and can be overridden by inheritance.
The temp () method is callback hook,callback_1 () and the callback_2 () method is callback method. When the temp () method is called with quit, the callback_1 () and callback_2 () methods are called automatically, and callbackmethod can also be overridden by inheritance.
The most commonly used callback hook in SV is the randomize () method, which has two callback method:pre_randomize () and post_randomize (), which are executed before and after the randomize () method.
Callback is a mechanism that changes the behavior of verification components without changing the code of verification components (driver, monitor, generator).
Can be used to
Inject errorsPut the transaction in the scoreboardGather functional coverage data
Base class:
Class transactor; virtual task pre_send (); endtask virtual task post_send (); endtask task send (); this.pre_send (); this.post_send (); endtask: sendendclass: transactor
Subcategory:
Class my_transactor extend transactor; virtual task pre_send (); / / This function is implemented here endtask virtual task post_send ();... / / This function is implemented here endtaskendclass: my_transactor
The base class transactor has three task, two of which are declared as virtual task without any behavior, and are then called by another task send.
Virtual task pre_send () and post_send () are called callback taskes.
In this way, we can change the behavior of task send in transactor by changing callback taskes in my_ transactor, a subclass of the base class transactor, without having to modify its code.
This is the end of the content of "what's the use of Callback"? thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.