Vengineerの妄想(準備期間)

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

vmm_vxc_managerクラスの実装(その7)

Verification Engineerの戯言

vmm_vxc_managerクラスEXECUTEコマンドシンタックスは、
    [E]X[ECUTE] <sid> {<sid>}
です。<sid>は、シナリオIDです。1つのEXECUTEコマンドで複数のシナリオIDを指定できます。
また、EXECUTEコマンドを複数記述できます。
ただし、EXECUTEコマンドはファイルの最後でなければいけません。
たとえば、
    x 1 2
    x 3
のようになります。xのように省略することができ、かつ、小文字でも問題ありません
シナリオIDは、1, 2, 3になります。1番目の行はシナリオIDの1と2を、2番目はシナリオIDの3を指定しています。

では、この記述がどのように処理されるかをtry_execute関数の中を見てみましょう!
    function bit vmm_xvc_manager::try_execute();
     
        if (this.argv[0].tolower() != "execute") begin
            return 0;
        end
        try_execute = 1;
        //put out any messages caught in the parser
        if (this.errMsg.len() > 0) begin
            `vmm_fatal(this.log, this.errMsg);
            return 1;
        end 

        // Terminate any scenario being defined
        if (this.current_sc != null) begin
            this.save_scenario(this.current_sc);
            this.current_sc = null;
        end
前半は、コマンドのチェックです。
        //Put each of the scenario arguments in the list 
        //   of scenarios to be executed.
        begin
            vmm_xvc_scenario scenario;
            for (int i = 1; i < this.argv.size(); i++) begin
                //check if its in the defined scenario q
                scenario = this.lookup_scenario(this.argv[i]);
                if (scenario == null) begin
                    `vmm_error(this.log, 
                               $psprintf("%s, line %0d: Scenario %s has not been defined !",
                                         this.testfile, 
                                         this.linec, 
                                         this.argv[i])
                               );
                    continue;
                end
                this.exec_scenarios.push_back(scenario);
            end
        end
    endfunction: try_execute 
後半は、指定したシナリオIDがシナリオとして存在するかをチェックし、this.exec_scenariosに登録します。
    this.exec_scenarios.push_back(scenario);
[ vmm_vxc_managerクラスの実装(その7)]で説明したthis.exec_scenario'''ですね!

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