Verification Engineerの戯言
// Iterate over every command in the file and process it begin while (this.get_next_cmd()) begin this.process_cmd(); end endのprocess_cmd関数は、次のように定義されています。
function bit vmm_xvc_manager::process_cmd(); `ifdef VMM_DETAILED_MSGS if (this.log.start_msg(vmm_log::INTERNAL_TYP , vmm_log::DEBUG_SEV )) begin this.log.text($psprintf("%s, line %0d:%s", this.testfile, this.linec, this.line)); this.log.end_msg(); end `endif // is it a known command?? if (this.try_scenario()) return 1; if (this.try_action()) return 1; if (this.try_verbosity()) return 1; if (this.try_log()) return 1; if (this.try_xvctrace()) return 1; if (this.try_covfile()) return 1; if (this.try_stoponerror()) return 1; if (this.try_stoponevent()) return 1; if (this.try_event()) return 1; if (this.try_mapevent()) return 1; if (this.try_interrupt()) return 1; if (this.try_execute()) return 1; `vmm_error(this.log, $psprintf("%s, line %0d: Unknown command '%s'.", this.testfile, this.linec, this.argv[0]) ); endfunction: process_cmdthis.try_xxx関数を実行し、この関数の戻り値が1のとき、対応するコマンドが存在したことを示します。
すべてのthis.try_xxx関数の戻り値が0のときは、対応するコマンドが存在しないことになり、エラーとなります。
vmm_errorマクロが実行されます。vmm_errorマクロが実行されると、エラーになり、シミュレーションが終了します。
従って、process_cmd関数の最後までは実行されないので、戻り値が無くてもいいのですが、
やっぱり、最後にreturn 0がほしいところです。
それとも、process_cmd関数の戻り値は無いvoidにすべきです。
検証、Verification、SystemVerilog、VMM、Verification Methodology Manual