• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Functional Verification
  3. Driver class outside program block

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 64
  • Views 14469
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Driver class outside program block

archive
archive over 18 years ago

Hello, I have a query in what ways driver class to be implemented. I referred some example in the SystemVerilog book(I have not referred all examples only few), in all the example I referred the driver class is implemented in the program block, the major reason what iam thinking for the driver class to implement in the program block is, the driver need to drive value to the DUT, and the DUT interface block will be visible to the Driver class since the program Test block will have the interface/DUT signal as an input, so using a task in the driver class we can drive/monitor DUT pins. Driver class inside the program block ------------------------------------- program test(and_gate_if_u and_gate_if); class driver; task drive #10 and_gate_if_u.a What I wanted I need to implement the Drive class outside the program block i.e in a separate file inorder to make the class generic so that in all the program TEST I will make use of Driver class; in that case I will be using tasks to drive DUT signals, in that case since iam implementing the drive class outside the class how I will have the access to the interface block or the signal blocks in DUT? To give a better idea of the above scenario I have given the code bellow, Driver class outside program block ----------------------------------- program test(and_gate_if_u and_gate_if); initial begin driver d1; d1 = new(); d1.drive end endprogram Driver Class ------------ class driver; task drive // Here I need to drive and_gate module signal ‘a’ and ‘b’ how to drive // Since this class is implemented in a different file the interface won’t // visible to this driver class endtask endclass Sundar


Originally posted in cdnusers.org by sundar_80
  • Cancel
Parents
  • archive
    archive over 18 years ago

    Hello Ajeetha,
    Thanks a lot for your reply, i have one more doubt can you please let me know why we are using virtual for and_gate_if?

    Sundarraj


    Originally posted in cdnusers.org by sundar_80
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • archive
    archive over 18 years ago

    Hello Ajeetha,
    Thanks a lot for your reply, i have one more doubt can you please let me know why we are using virtual for and_gate_if?

    Sundarraj


    Originally posted in cdnusers.org by sundar_80
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information