このページの翻訳は最新ではありません。ここをクリックして、英語の最新版を参照してください。
target.Processor クラス
パッケージ: target
説明
target.Processor
クラスを使用して、ターゲット プロセッサに関する情報を提供します。たとえば、名前、製造元、言語実装などです。
target.Processor
オブジェクトの作成には関数 target.create
を使用します。
プロパティ
例
新しいハードウェア実装の作成
このクラスを使用する例については、次を参照してください。
timer オブジェクトの作成
この例では、開発用コンピューター向けの timer オブジェクトの作成方法を示します。
タイマーの関数シグネチャを作成します。この例では、関数は uint64
データ型と関数名 timestamp_x86
を返します。
timerSignature = target.create('Function'); timerSignature.Name = 'timestamp_x86'; timerSignature.ReturnType = 'uint64';
API オブジェクト内の関数を取得します。
timerApi = target.create('API'); timerApi.Functions = timerSignature; timerApi.Language = target.Language.C; timerApi.Name = 'Linux Timer API';
関数の依存関係、つまり関数を実行するために必要なソース ファイルとヘッダー ファイルを取得します。
timerDependencies = target.create('BuildDependencies'); timerDependencies.IncludeFiles = {'host_timer_x86.h'}; timerDependencies.IncludePaths = ... {'$(MATLAB_ROOT)/toolbox/coder/profile/src'}; timerDependencies.SourceFiles = {'host_timer_x86.c'};
API と依存関係を組み合わせるオブジェクトを作成します。
timerImplementation = target.create('APIImplementation'); timerImplementation.API = timerApi; timerImplementation.BuildDependencies = timerDependencies; timerImplementation.Name = 'Linux Timer Implementation';
timer オブジェクトを作成してタイマー情報に関連付けます。
timer = target.create('Timer'); timer.APIImplementation = timerImplementation; timer.Name = 'Linux Timer';
メモ
名前と値の引数を使用して、次のコマンドで timer オブジェクトを作成できます。
timer = target.create('Timer', 'Name', 'Linux Timer', ... 'FunctionName', 'timestamp_x86', ... 'FunctionReturnType', 'uint64', ... 'FunctionLanguage', target.Language.C, ... 'SourceFiles', {'host_timer_x86.c'}, ... 'IncludeFiles', {'host_timer_x86.h'}, ... 'IncludePaths', {'$(MATLAB_ROOT)/toolbox/coder/profile/src'})
タイマーとアドオンを processor オブジェクトに割り当てます。
processor = target.get('Processor', 'Intel-x86-64 (Linux 64)'); processor.Timers = timer;
Intel Core プロセッサの説明の作成
ハイパースレッディングをサポートするプロセッサである Intel® Core™ i7-8550U プロセッサの説明を作成します。
i7 = target.create('Processor', ... 'Name', 'i7-8550U', ... 'Manufacturer', 'Intel', ... 'NumberOfCores', 4, ... 'NumberOfThreadsPerCore', 2); target.add(i7);
バージョン履歴
R2019a で導入