Vengineerの戯言

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

OVM : assign_vi

Verification Engineerの戯言 : SystemVerilogの世界へようこそ

Is "assign_vi" the only way to pass interface to the components from environment??の中で
メンターのDaveさんが興味深い例をアップしていた。

上記のOVM Forumのスレッドからの引用
    class vm_wrapper #(type T=int) extends ovm_object;

        T m;

        function new(string name="");
            super.new(name);
        endfunction

    endclass 
テンプレートとして、T型を指定している一般的なクラス。

で、次がキーとなる記述
        typedef virtual intf v_intf_t;

        vm_wrapper #(v_intf_t) vintf = new();

        intf itf();

        initial begin
            v_intf.m = itf;  //PAss an actual handle interface
            set_config_object("*","wrapper",wrapper,0);
        end

    endmodule
vm_wrapperクラスのパラメータになんと、virtual intfを渡している。

こんなやり方ありなんだーと。

SystemVerilogは奥が深い。

P.S
この時点でISUは上記の記述はサポートされていなかったが、ISU 9.xではサポートされたのだろうか?
Cadence関係者の皆さん、コメントください。

検証、Verification、SystemVerilog、OVM、Open Verification Methodology