hdlcoder.CodingStandard
HDL コーディング標準のカスタマイズ オブジェクトを作成
説明
は、コーディング標準レポートのルールや外観のカスタマイズに使用できる HDL コーディング標準のカスタマイズ オブジェクトを作成します。cso = hdlcoder.CodingStandard(standardName)
コーディング標準レポートのルールや外観をカスタマイズしない場合は、HDL コーディング標準のカスタマイズ オブジェクトを作成する必要はありません。
例
HDL コーディング標準のカスタマイズ オブジェクトの作成
コーディング標準のカスタマイズ オブジェクト "cso" を作成します。
cso = hdlcoder.CodingStandard('Industry');
コーディング標準のオプションのカスタマイズ
コーディング標準レポートに受け渡しルールを表示しない。
if-else の入れ子の最大深さを 2 に設定する。
行の長さのチェックを無効にする。
cso.ShowPassingRules.enable = false; cso.IfElseNesting.depth = 2; cso.LineLength.enable = false;
HDL の codegen コンフィギュレーションとコーディング標準のカスタマイズ オブジェクトの作成
hdlcfg = coder.config('hdl');
コーディング標準とコーディング標準のカスタマイズ オブジェクトを指定します。
hdlcfg.HDLCodingStandard = 'Industry'; hdlcfg.HDLCodingStandardCustomizations = cso; hdlcfg.TreatRealsInGeneratedCodeAs = 'None';
HDL コードとテスト ベンチの生成
テスト ベンチ関数の名前を指定します。この例では、設計関数は mlhdlc_dti.m、テスト ベンチ関数は mlhdlc_dti_tb.m です。
hdlcfg.TestBenchName = 'mlhdlc_dti_tb';
設計の HDL コードを生成し、カスタマイズした HDL コーディング標準のルールに従ってコードをチェックします。
codegen -config hdlcfg mlhdlc_dti
### Begin MATLAB to HDL Code Generation...
### Working on DUT: mlhdlc_dti.
### Using TestBench: mlhdlc_dti_tb.
### Begin VHDL Code Generation
### Working on mlhdlc_dti as <a href="matlab:edit('/tmp/Bdoc25b_2988451_707604/tpf3976775/hdlcoder-ex26183455/codegen/mlhdlc_dti/hdlsrc/mlhdlc_dti.vhd')">mlhdlc_dti.vhd</a>.
### Generating Resource Utilization Report <a href="matlab:hdlcoder.report.openDdg('/tmp/Bdoc25b_2988451_707604/tpf3976775/hdlcoder-ex26183455/codegen/mlhdlc_dti/hdlsrc/resource_report.html')">resource_report.html</a>.
### Generating Optimization report
### To rerun codegen evaluate the following commands...
---------------------
cgi = load('/tmp/Bdoc25b_2988451_707604/tpf3976775/hdlcoder-ex26183455/codegen/mlhdlc_dti/hdlsrc/codegen_info.mat');
inVals = cgi.CodeGenInfo.inVals;
cfg = cgi.CodeGenInfo.codegenSettings;
codegen -config cfg -args inVals -report
---------------------
### Industry Compliance report with 0 errors, 1 warnings, 4 messages.
### Generating Industry Compliance Report <a href="matlab:web('/tmp/Bdoc25b_2988451_707604/tpf3976775/hdlcoder-ex26183455/codegen/mlhdlc_dti/hdlsrc/mlhdlc_dti_Industry_report.html')">mlhdlc_dti_Industry_report.html</a>
### Generating HDL Conformance Report <a href="matlab:web('/tmp/Bdoc25b_2988451_707604/tpf3976775/hdlcoder-ex26183455/codegen/mlhdlc_dti/hdlsrc/mlhdlc_dti_hdl_conformance_report.html')">mlhdlc_dti_hdl_conformance_report.html</a>.
### HDL Conformance check complete with 0 errors, 0 warnings, and 0 messages.
### Code generation successful: To view the report, open('codegen/mlhdlc_dti/hdlsrc/html/report.mldatx')
HDL コーディング標準のカスタマイズ オブジェクトの作成
sfir_fixed モデルを読み込む
コーディング標準のカスタマイズ オブジェクト "
cso" を作成する
load_system('sfir_fixed') cso = hdlcoder.CodingStandard('Industry');
コーディング標準のオプションのカスタマイズ
レポートに受け渡しルールを表示しない。
行の最大長を 80 文字に設定する。
モジュール、インスタンス、エンティティの名前の長さが 5 ~ 50 文字であることをチェックする。
cso.ShowPassingRules.enable = false; cso.LineLength.length = 80; cso.ModuleInstanceEntityNameLength.length = [5 50];
設計の HDL コードの生成
HDL コードを生成し、カスタマイズした HDL コーディング標準のルールに従ってチェックします。DUT サブシステムは symmetric_fir です。
makehdl('sfir_fixed/symmetric_fir','HDLCodingStandard','Industry',... 'HDLCodingStandardCustomizations',cso, 'TargetDirectory', 'C:/coding_standard/hdlsrc')
### Working on the model <a href="matlab:open_system('sfir_fixed')">sfir_fixed</a>
### Generating HDL for <a href="matlab:open_system('sfir_fixed/symmetric_fir')">sfir_fixed/symmetric_fir</a>
### Using the config set for model <a href="matlab:configset.showParameterGroup('sfir_fixed', { 'HDL Code Generation' } )">sfir_fixed</a> for HDL code generation parameters.
### Running HDL checks on the model 'sfir_fixed'.
### Begin compilation of the model 'sfir_fixed'...
### Working on the model 'sfir_fixed'...
### Working on... <a href="matlab:configset.internal.open('sfir_fixed', 'GenerateModel')">GenerateModel</a>
### Begin model generation 'gm_sfir_fixed'...
### Copying DUT to the generated model....
### Model generation complete.
### Generated model saved at <a href="matlab:open_system('C:\coding_standard\hdlsrc\sfir_fixed\gm_sfir_fixed.slx')">C:\coding_standard\hdlsrc\sfir_fixed\gm_sfir_fixed.slx</a>
### Begin VHDL Code Generation for 'sfir_fixed'.
### Working on sfir_fixed/symmetric_fir as C:\coding_standard\hdlsrc\sfir_fixed\symmetric_fir.vhd.
### Code Generation for 'sfir_fixed' completed.
### Industry Compliance report with 4 errors, 0 warnings, 2 messages.
### Generating Industry Compliance Report <a href="matlab:web('C:\coding_standard\hdlsrc\sfir_fixed\symmetric_fir_Industry_report.html')">symmetric_fir_Industry_report.html</a>
### Generating HTML files for code generation report at <a href="matlab:hdlcoder.report.openDdg('C:\coding_standard\hdlsrc\sfir_fixed\html\index.html')">index.html</a>
### Creating HDL Code Generation Check Report file:///C:/coding_standard/hdlsrc/sfir_fixed/symmetric_fir_report.html
### HDL check for 'sfir_fixed' complete with 0 errors, 1 warnings, and 0 messages.
### HDL code generation complete.
入力引数
カスタマイズする HDL コーディング標準を指定します。standardName の値は HDLCodingStandard プロパティの値と一致しなければなりません。
例: 'Industry'
出力引数
HDL コーディング標準のカスタマイズ。HDL コーディング標準のカスタマイズ オブジェクトとして返されます。
バージョン履歴
R2014b で導入
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)