%% Customize coding standard rules for Simulink to HDL workflow   

%% Create an HDL coding standard customization object 
% * Load the sfir_fixed model
% * Create a coding standard customization object _|cso|_

load_system('sfir_fixed')
cso = hdlcoder.CodingStandard('Industry');  

%% Customize the coding standard options 
%  
% * Do not show passing rules in the report.  
% * Set maximum line length to 80 characters.  
% * Check that module, instance, and entity names are between 5 and 50 characters
% long.   

cso.ShowPassingRules.enable = false;
cso.LineLength.length = 80;
cso.ModuleInstanceEntityNameLength.length = [5 50];  

%% Generate HDL code for your design
% Generate HDL code and check it according to the customized
% HDL coding standard rules. The DUT subsystem is symmetric_fir. 

makehdl('sfir_fixed/symmetric_fir','HDLCodingStandard','Industry',...
        'HDLCodingStandardCustomizations',cso, 'TargetDirectory', 'C:/coding_standard/hdlsrc')   



%% 
% Copyright 2012 The MathWorks, Inc.