• 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. aspect oriented vs object oriented

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 65
  • Views 15711
  • 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

aspect oriented vs object oriented

onkarkk
onkarkk over 16 years ago

 Hi,

I am new to specman, i have started studying and practicing , i could not understand the precise difference between aspect oriented programming and object oriented programming , could any one explain me in this regard.

Thanks in advance,

regards,

Krishna Kishore 

  • Cancel
  • StephenH
    StephenH over 16 years ago

    The simple answer is that OOP is a way to group functionality and properties into objects. E.g. an object could be an Ethernet packet. The object's properties are "length", "payload", "address" etc. It might have methods to mapipulate the object, e.g. to print it to the screen.

    Where common functionality is needed to be shared across different objects, we use a base object to define the common properties, then we derive new object types from that base object. This is the classic OOP "inheritance" mechanism.

    Specman adds the idea of aspects ON TOP OF OOP. It does not replace OOP, and this is very important to remember, because some things are better done as pure OOP and others better with AOP.

    An aspect is simply "a view of an object" and as the name implies, we might have multiple views of an object. OK, this probably sounds a bit high-level so here's a more concrete example. Using the Ethernet packet as an example, one may have different aspects based on the address type, e.g. is it a broadcast or unicast packet. Specman allows us to define different method implementations and other properties and constraints based on the type of packet. So a broadcast packet may implement one kind of print method, and the unicast one could define a different method.

    This lets us easily change behaviour based on properties of the object, without having to use the traditional OOP patterns approach to re-use (search Google for OOP design patterns). Specman lets us control what kind of packets we generate using declarative syntax, whereas OOP would force us to be more strict about following design patterns and using procedural code to control the packet types. Thus AOP can bring big rewards when you want to randomly generate different kinds of packet.

    Having said all this, AOP does let you do really dumb things that prevent re-use or worse, lets someone break your code by adding or changing extensions to your code when you were not expecting them. But that's where good programming practices like encapsulation come into play. And of course the Specman tool has a great set of functions to review and document automatically all the code extensions, so you can quickly see what's defined where.

    Hope this helps! There are good books out there on the topic, but even working through some of the IP Verification Kit examples that ship with Incisive Enterprise Simulator (i.e. NCSim + Specman) will help you understand how it all works. A "picture" is worth a lot of words, after all ;-)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • teamspecman
    teamspecman over 16 years ago

    Quick addition to Steven's post:

    One of the really good books on this exact subject is:

    "Aspect-Oriented Programming with the e Verification Language: A Pragmatic Guide for Testbench Developers" by David Robinson

    http://www.amazon.com/Aspect-Oriented-Programming-Verification-Language-Developers/dp/0123742102 

    Team Specman

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • onkarkk
    onkarkk over 16 years ago

    Thank you Stephen , Now i could understand the things with confidence. Thanks for your quick reply..

    regards,

    Krishna Kishore 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • onkarkk
    onkarkk over 16 years ago

     

    thank you.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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