Vengineerの妄想(準備期間)

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

mm_vxc_managerクラスの実装(その1)

Verification Engineerの戯言

オープンソースVMMでは、vmm_xvc_managerクラスも実装されています。
vmm_xvc_managerクラスは、VMM本のAppendix C XVC STANDARD LIBRARY SPECIFICATIONで定義されています。
公開関数およびタスクは、new関数runタスクのみです(VMM本にはrunタスクのみ解説があります)。
runタスクはつぎのような引数を持ちます。
    task run( string testfile );
引数のtestfileは、テストシナリオのファイル名です。

では、実装ファイルを見ていきましょう。実装ファイルは、std_lib/vmm_vxc_manager.svです。

new関数は、特別なんにもやっていません。
    function vmm_xvc_manager::new(string name);
        super.new(name);
    endfunction: new
runタスクは、それなりのコードです。
    task vmm_xvc_manager::run(string testfile);

        // Start all known xvcs
        foreach (this.xvcQ[i]) begin
            this.xvcQ[i].start_xactor();
        end
 
        // Provide the file to be executed to the C-TCL interpreter
        // which pre-processes the file
        vmm_xvc_tcl_execute_file(testfile);

        // Iterate over every command in the file and process it
        begin
            while (this.get_next_cmd()) begin
                this.process_cmd();
           end
        end

        // Execute only if there are no errors in the testfile
        if (this.log.get_message_count(vmm_log::FATAL_SEV + vmm_log::ERROR_SEV,
                                       "/./", "/./") > 0) begin
            `vmm_fatal(this.log, "Unable to execute testfile because of errors");
        end
        else
            this.execute();
    endtask: run
    1)、すべてのVXCを起動する
    2)、テストシナリオファイルを読み込む
    3)、読み込んだテストシナリオファイル内のすべてのコマンドを解析する
    4-1)、エラー発生ときは、Fatal Errorになる
    4-2)、コマンドを実行する

次回は、2)のテストシナリオファイルを読み込むvmm_xvc_tcl_execute_file関数をみていきます。

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