SystemVerilog use FORCE__SV in class

Source: Internet
Author: User

1. Direct force a value, such as 0/1/a, can be in Class directly force the value of a variable, such as Force Dut.timer=timer, if the timer is a dynamic variable, the compiler will error "class data Is isn't allowed in the non-procedural context. "The simple solution is to define the timer as static Type 3. If the 2 cannot be simply defined as a static type, you can borrow the Interface/bind module to achieve, specifically in the interface to add Trigger/dis-trigger/value three values, in the interface using always block Force dut signal, in class to drive trigger/value/ Dis-trigger

In summary, is the force dut signal on the right side must be a static value

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.