CallbackCustomProgrammingMethod
クラス: hdlcoder.ReferenceDesign
パッケージ: hdlcoder
ワークフロー アドバイザーの [ターゲット デバイスをプログラム] タスクで実行されるカスタム コールバック関数の関数ハンドル
構文
CallbackCustomProgrammingMethod
説明
CallbackCustomProgrammingMethod
は、HDL ワークフロー アドバイザーで [ターゲット デバイスをプログラム] タスクの実行時に実行されるコールバック関数の関数ハンドルを登録します。hRD
が hdlcoder.ReferenceDesign
クラスを使用して作成したリファレンス設計オブジェクトの場合は、次の構文を使用して関数ハンドルを登録します。
hRD.CallbackCustomProgrammingMethod = @my_reference_design.callback_CustomProgrammingMethod;
コールバック関数を定義するには、MATLAB® 関数を定義するファイルを作成して MATLAB パスに追加します。コールバック関数には任意の名前を使用できます。この例では、関数の名前は callback_PostBuildBitstream
で、リファレンス設計パッケージ フォルダー +my_reference_design
にあります。
このコールバック関数で、ターゲット デバイスをプログラムするカスタム プログラミング メソッドを指定できます。次のコード例は、コールバック関数の作成方法を示しています。
function [status, log] = callback_CustomProgrammingMethod(infoStruct) % Reference design callback function for custom programming method % % infoStruct: information in structure format % infoStruct.ReferenceDesignObject: current reference design registration object % infoStruct.BoardObject: current board registration object % infoStruct.ParameterStruct: custom parameters of the current reference design, in struct format % infoStruct.HDLModelDutPath: the block path to the HDL DUT subsystem % infoStruct.BitstreamPath: the path to the generated FPGA bitstream file % infoStruct.ToolProjectFolder: the path to synthesis tool project folder % infoStruct.ToolProjectName: the synthesis tool project name % infoStruct.ToolCommandString: the command for running a tcl file % % status: process run status % status == true means process run successfully % status == false means process run failed % log: output log string status = true; log = sprintf('Run custom programming method callback...\n'); % Enter your commands for custom programming here % ... % ... end
HDL ワークフロー アドバイザーで、HDL Coder™ により、ターゲット SoC デバイスをプログラムするカスタム プログラミング メソッドが選択されます。カスタム プログラミング メソッドを指定していない場合は、ターゲット デバイスをプログラムするオプションとして [JTAG]
と [ダウンロード]
が HDL Coder から提示されます。
コールバック関数を作成するときに、引数 infoStruct
を関数に渡します。この引数には、リファレンス設計とボードに関する情報が structure
形式で含まれます。この情報を使用して、ビルド プロセスとビットストリーム生成のカスタム設定を指定します。
バージョン履歴
R2016a で導入