Vengineerの妄想(準備期間)

人生は短いけど、長いです。人生を楽しみましょう!

interface class


SytemVerilog-2012の規格書にもありますが、これの8.26 Interface classesによると、
引用
    An interface class shall only contain
        pure virtual methods(see8.21),
        type declarations(see6.18) and 
        parameter declarations (see 6.20, 8.25). 

    Constraint blocks, covergroups and nested classes (see 8.23) shall not be allowed in an interface class. 

    An interface class shall not be nested within another class. 

    An interface class can inherit from one or more interface classes through the extends keyword, 
        meaning that it inherits all the member types, 
        pure virtual methods and parameters of the interface classes it extends, 
       except for any member types and parameters that it may hide. 

    In the case of multiple inheritance, name conflicts may occur which must be resolved (see 8.26.6).

で、pure virtual methodでなくてはいけない。

そして、
引用
    Classes can implement one or more interface classes through the implements keyword. 
    
    No member types or parameters are inherited through the implements keyword. 

    A subclass implicitly implements all of the interface classes implemented by its superclass.     

implementsでクラスの継承を行うことになります。

では、今までのクラス(class)とinterface classの違いはなんでしょうか?

8.26.2 Extends versus implements に次のようにあります。
引用
     A class or virtual class
        o may not extend an interface class
        o may implement zero or more interface classes
        o may extend at most one other class or virtual class
        o may not implement a class or virtual class
        o may simultaneously extend a class and implement interface classes

     An interface class
        o may extend zero or more interface classes 
        o may not implement an interface class
        o may not extend a class or virtual class
        o may not implement a class or virtual class
とあります。

いかがでしょうか?

検証、Verification、SystemVerilog