Vengineerの妄想(準備期間)

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

OVM-VMM Encapsulation Library(その2)

Verification Engineerの戯言

ovm_vmm_sequencerクラスも、sv/ovm_vmm_interop.svhファイルで定義されています
    class ovm_vmm_sequencer #(type T=vmm_data, type CH=vmm_channel) extends ovm_sequencer;
        //If you want to use the channel specialization. Should never be necessary,
        //but provides some compile time checking.
        CH channel;

        function new(string name, ovm_component parent);
            super.new(name,parent);
            `ovm_update_sequence_lib_and_item(ovm_vmm_data#(T))
        endfunction

ovm_vmm_sequencerクラスは、ovm_sequencerクラスを継承します。
そして、テンプレートとして、2つのクラスT=vmm_dataCH=vmm_channelを使います。
T=vmm_dataは、ovm_sequence_itemとして使います。
また、CH=vmm_channelの方は、メンバー変数として使います。
        //The run task is free running. It gets the next item and sends to
        //a channel, very much the way a vmm_scenario_generator works.
        task run;
            //The actual item that the sequencer will produce
            ovm_vmm_data#(T) item;
            ovm_sequence_item tmp;

            //Need to start the sequencer. This sets up the default sequence running.
            fork super.run; join_none

            //may want to add timeout for channel not connected, or may want to 
            //put the check just before the put.
            wait(channel != null);

            //The simple get/put/trigger loop.
            while(1) begin
                get_next_item(tmp);
                $cast(item, tmp);
                ovm_report_info("OVM_VMM_IOP", "Sending an item from sequencer to vmm channel", OVM_MEDIUM);
                channel.put(item.trans);
                item_done();
            end
        endtask
runタスクget_next_item(tmp)で獲得したものを$cast(item, tmp)ovm_vmm_data#(T)型のitem
代入した後に、channel.put(item.trans)で送信しています。
クラス・リファレンスには、item_done_trigger()になっていますが、ソースコードでは、item_done()になっています。
OVM 2.0のクラス・リファレンスのovm_sequencerクラスの説明では、item_done()になっているので、
ドキュメントが間違っていることになります。
        `ovm_declare_sequence_lib
        `ovm_component_registry(ovm_vmm_sequencer#(T,CH),"")
        `ovm_get_type_name_func(ovm_vmm_sequencer#(T,CH))

    endclass
この部分は、ovm_vmm_sequencer#(T,CH)を登録しています。
このovm_vmm_sequencerクラスを使うことで、vmm_dataクラスを継承するクラスのデータをVMMのBFMへ転送できるようになりました。

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