function paramsTab = getTabDialogSchema(this, schemaName, hdlcc) %#ok
%GETTABDIALOGSCHEMA   Get the tabDialogSchema.

%   Author(s): P. Costa, J. Sun, et-al.
%   Copyright 2005-2023 The MathWorks, Inc.

tag = [getWidgetTagPrefix(this),'GlbSettingsPanel_'];
src = hdlcc.getCLI;
cs = hdlcc.getSourceObject.getConfigSet;
enableWidget = strcmpi(cs.ReadOnly, 'off');

currRow = 1;
[widgets_main, currRow] = getSharedWidgets(this, src, enableWidget, currRow, 'main', tag);

clkinputOP = 'ClockInputs';
clkinput_lbl.Type = 'text';
clkinput_lbl.Name = DAStudio.message('HDLShared:hdldialog:clockInputs');
clkinput_lbl.RowSpan = [currRow currRow];
clkinput_lbl.ColSpan = [3 3];

clkinput.Type = 'combobox';
clkinput.ObjectProperty = clkinputOP;
clkinput.Tag = [tag clkinputOP];
clkinput_lbl.Buddy = clkinput.Tag;
clkinput.RowSpan = [currRow currRow];
clkinput.ColSpan = [4 4];
clkinput.Source = src;
clkinput.Mode = true;
clkinput.DialogRefresh = true;
clkinput.Enabled = enableWidget;
clkinput.Entries = {DAStudio.message('HDLShared:hdldialog:clockInputsSingle'),...
    DAStudio.message('HDLShared:hdldialog:clockInputsMultiple')};
currRow = currRow+1;

% Over sampling
oversampOP = 'Oversampling';
oversamp_lbl.Type = 'text';
oversamp_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsOversampling');
oversamp_lbl.RowSpan = [currRow currRow];
oversamp_lbl.ColSpan = [1 1];

oversamp.Type = 'edit';
oversamp.ObjectProperty = oversampOP;
oversamp.Tag = [tag oversampOP];
oversamp_lbl.Buddy = oversamp.Tag;
oversamp.RowSpan = [currRow currRow];
oversamp.ColSpan = [2 2];
oversamp.Source = src;
oversamp.Mode = true;
oversamp.Enabled = enableWidget;

clockEdgeOP = 'ClockEdge';
clockedge_lbl.Type = 'text';
clockedge_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsClockEdge');
clockedge_lbl.RowSpan = [currRow currRow];
clockedge_lbl.ColSpan = [3 3];

clockedge.Type = 'combobox';
clockedge.ObjectProperty = clockEdgeOP;
clockedge.Tag = [tag clockEdgeOP];
clockedge_lbl.Buddy = clockedge.Tag;
clockedge.RowSpan = [currRow currRow];
clockedge.ColSpan = [4 4];
clockedge.Source = src;
clockedge.Mode = true;
clockedge.DialogRefresh = true;
clockedge.Enabled = enableWidget;
clockedge.Entries = {DAStudio.message('HDLShared:hdldialog:clockEdgeRising'),...
    DAStudio.message('HDLShared:hdldialog:clockEdgeFalling')};

%
% Clock Settings group
%
clksg.Type = 'group';
clksg.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingClockSettingGroup');
clksg.Items = [widgets_main, {clkinput_lbl, clkinput, oversamp_lbl, oversamp,...
    clockedge_lbl, clockedge}];
clksg.LayoutGrid = [4 4];
clksg.ColStretch = [0 1 0 1];
clksg.Tag = [tag, 'ClockSettingsGroup'];

% Build the tabs with the additional settings grouped into three tabs
genTab = builtGeneralTab(this, src, enableWidget);
prtsTab = builtPortsTab(this, src, enableWidget);
codingTab = builtCodingTab(this, src, enableWidget);
advTab = builtAdvancedTab(this, src,enableWidget);

codingstdTab = builtCodingStandardsTab( this, src, enableWidget );
%codingstdTab  = [];
floatingpointTab = builtFloatingPointTab( this, src, enableWidget );

tabBody.Type = 'tab';
tabBody.Tabs = {genTab, prtsTab, codingTab, codingstdTab, advTab, floatingpointTab};
tabBody.Tag = [tag, 'Body'];
%tabBody.ActiveTab = this.HDLGSActiveTab;

% Created for this tabs use; Using a package function.
tabBody.TabChangedCallback = 'hdlcoderui.changehdlconfigtab';

%
% Additional settings group
%
tabg.Type = 'group';
tabg.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingAdditionalSettingGroup');
tabg.Items = {tabBody};
tabg.LayoutGrid = [1 1];

paramsTab.Items = {clksg,tabg};
paramsTab.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsComponentName');
%% CSHTAG
paramsTab.Tag = [getWidgetTagPrefix(this) 'GlobalSettingsPanel'];
end

%--------------------------------------------------------------------------
function generalTab = builtGeneralTab(this, hObjCLI, enableWidget)
% Widgets on the "General" tab
tag = 'ConfigSet_HDLCoder_GlbSettingsPanel_';

currRow = 1;
[genTabwidgets, currRow] = getSharedWidgets(this, hObjCLI, enableWidget, currRow, 'general', tag);
tag = [tag, 'General_'];

VhdlArchNameOP = 'VHDLArchitectureName';

lblVhdlArchName.Type = 'text';
lblVhdlArchName.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingVHDLArchitectureName');
lblVhdlArchName.Tag = [tag,VhdlArchNameOP,'_lbl'];
lblVhdlArchName.RowSpan = [currRow currRow];
lblVhdlArchName.ColSpan = [3 3];

VhdlArchName.Tag = [tag, VhdlArchNameOP];
lblVhdlArchName.Buddy = VhdlArchName.Tag;
VhdlArchName.Type = 'edit';
VhdlArchName.ObjectProperty = VhdlArchNameOP;
VhdlArchName.RowSpan = [currRow, currRow];
VhdlArchName.ColSpan = [4,4];
VhdlArchName.Mode = true;
VhdlArchName.DialogRefresh = true;
VhdlArchName.Source = hObjCLI;
VhdlEnabled = strcmpi(hObjCLI.TargetLanguage, 'VHDL');
VhdlArchName.Enabled = VhdlEnabled;

currRow = currRow + 1;

ModulePrefixOP = 'ModulePrefix';
lblModulePrefix.Type = 'text';
lblModulePrefix.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingModulePrefix');
lblModulePrefix.RowSpan = [currRow currRow];
lblModulePrefix.ColSpan = [3 3];

txtModulePrefix.Type = 'edit';
txtModulePrefix.ObjectProperty = ModulePrefixOP;
txtModulePrefix.Tag = [tag txtModulePrefix.ObjectProperty];
lblModulePrefix.Buddy = txtModulePrefix.Tag;
txtModulePrefix.RowSpan = [currRow currRow];
txtModulePrefix.ColSpan = [4 4];
txtModulePrefix.Mode = true;
txtModulePrefix.Source = hObjCLI;
txtModulePrefix.Enabled = enableWidget;

currRow = currRow + 1;

EnablePrefixOP = 'EnablePrefix';
lblEnablePrefix.Type = 'text';
lblEnablePrefix.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingEnablePrefix');
lblEnablePrefix.Tag = [tag,EnablePrefixOP,'_lbl'];
lblEnablePrefix.RowSpan = [currRow, currRow];
lblEnablePrefix.ColSpan = [1 1];

txtEnablePrefix.Type = 'edit';
txtEnablePrefix.Tag = [tag,EnablePrefixOP];
lblEnablePrefix.Buddy = txtEnablePrefix.Tag;
txtEnablePrefix.ObjectProperty = EnablePrefixOP;
txtEnablePrefix.RowSpan = [currRow currRow];
txtEnablePrefix.ColSpan = [2 2];
txtEnablePrefix.Source = hObjCLI;
txtEnablePrefix.Mode = true;
txtEnablePrefix.Enabled = enableWidget;

TimingControllerPostfix.OP = 'TimingControllerPostfix';
TimingControllerPostfix.lbl.Type = 'text';
TimingControllerPostfix.lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingTimingCtlrPostfix');
TimingControllerPostfix.lbl.RowSpan = [currRow currRow];
TimingControllerPostfix.lbl.ColSpan = [3 3];

TimingControllerPostfix.txt.Type = 'edit';
TimingControllerPostfix.txt.ObjectProperty = TimingControllerPostfix.OP;
TimingControllerPostfix.txt.Tag = [tag TimingControllerPostfix.txt.ObjectProperty];
TimingControllerPostfix.lbl.Buddy = TimingControllerPostfix.txt.Tag;
TimingControllerPostfix.txt.RowSpan = [currRow, currRow,];
TimingControllerPostfix.txt.ColSpan = [4 4];
TimingControllerPostfix.txt.Mode = true;
TimingControllerPostfix.txt.Source = hObjCLI;
TimingControllerPostfix.txt.Enabled = enableWidget;

currRow = currRow + 1;


PipelinePostfixOP = 'PipelinePostfix';
lblPipelinePostfix.Type = 'text';
lblPipelinePostfix.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingPipelinePostfix');
lblPipelinePostfix.Tag = [tag,PipelinePostfixOP,'_lbl'];
lblPipelinePostfix.RowSpan = [currRow currRow];
lblPipelinePostfix.ColSpan = [1 1];

txtPipelinePostfix.Type = 'edit';
txtPipelinePostfix.Tag = [tag,PipelinePostfixOP];
lblPipelinePostfix.Buddy = txtPipelinePostfix.Tag;
txtPipelinePostfix.ObjectProperty = PipelinePostfixOP;
txtPipelinePostfix.RowSpan = [currRow currRow];
txtPipelinePostfix.ColSpan = [2 2];
txtPipelinePostfix.Source = hObjCLI;
txtPipelinePostfix.Mode = true;
txtPipelinePostfix.Enabled = enableWidget;

currRow = currRow+1;

VhdlLibraryNameOP = 'VHDLLibraryName';

lblVhdlLibraryName.Type = 'text';
lblVhdlLibraryName.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingVHDLLibraryName');%'VHDL library name';
lblVhdlLibraryName.Tag = [tag,VhdlLibraryNameOP,'_lbl'];
lblVhdlLibraryName.RowSpan = [currRow currRow];
lblVhdlLibraryName.ColSpan = [1 1];

VhdlLibraryName.Tag = [tag, VhdlLibraryNameOP];
lblVhdlLibraryName.Buddy = VhdlLibraryName.Tag;
VhdlLibraryName.Type = 'edit';
VhdlLibraryName.ObjectProperty = VhdlLibraryNameOP;
VhdlLibraryName.RowSpan = [currRow, currRow];
VhdlLibraryName.ColSpan = [2,2];
VhdlLibraryName.Mode = true;
VhdlLibraryName.DialogRefresh = true;
VhdlLibraryName.Source = hObjCLI;
VhdlEnabled = strcmpi(hObjCLI.TargetLanguage, 'VHDL');
VhdlLibraryName.Enabled = VhdlEnabled;
currRow = currRow+1;

UseSingleLibOP = 'UseSingleLibrary';
UseSingleLib.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingUseSingleLibrary');
UseSingleLib.Tag = [tag UseSingleLibOP];
UseSingleLib.Type = 'checkbox';
UseSingleLib.ObjectProperty = UseSingleLibOP;
UseSingleLib.RowSpan = [currRow currRow];
UseSingleLib.ColSpan = [1 4];
UseSingleLib.Mode = true;
UseSingleLib.DialogRefresh = true;
UseSingleLib.Source = hObjCLI;
UseSingleLib.Enabled = VhdlEnabled & enableWidget;
currRow = currRow+1;

spacer.Type = 'panel';
spacer.RowSpan = [currRow currRow];
spacer.ColSpan = [1 4]; %#ok<STRNU>

grpGeneral.Type = 'panel';
grpGeneral.Name = '';
grpGeneral.RowSpan = [1 currRow];
grpGeneral.ColSpan = [1 4];
grpGeneral.LayoutGrid = [currRow 4];
grpGeneral.ColStretch = [0 1 0 1];
grpGeneral.RowStretch = [zeros(1, currRow-1) 1];
grpGeneral.Tag = [tag, 'GeneralGroup'];
grpGeneral.Items = [genTabwidgets, {lblEnablePrefix,...
    txtEnablePrefix,...
    lblPipelinePostfix,...
    txtPipelinePostfix....
    lblModulePrefix,...
    txtModulePrefix,...
    TimingControllerPostfix.lbl,...
    TimingControllerPostfix.txt,...
    UseSingleLib, ...
    lblVhdlLibraryName,...
    VhdlLibraryName, ...
    lblVhdlArchName, ...
    VhdlArchName
    }];

% General tab panel
generalTab.Name  = DAStudio.message('HDLShared:hdldialog:hdlglblsettingGeneralGroup');
generalTab.Items = {grpGeneral};
end

%--------------------------------------------------------------------------
function portsTab = builtPortsTab(this, hObjCLI, enableWidget)
% Widgets on the "Ports" tab
tag = 'ConfigSet_HDLCoder_GlbSettingsPanel_';

currRow = 1;
[prtsTabwidgets, currRow] = getSharedWidgets(this, hObjCLI, enableWidget, currRow, 'ports', tag);
tag = [tag 'Ports_'];

currRow = currRow+1;

% Minimize Clock Enables
minClockEnableOP = 'MinimizeClockEnables';
minClockEnable.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingMinimizeClockEnables');
minClockEnable.Type = 'checkbox';
minClockEnable.ObjectProperty = minClockEnableOP;
minClockEnable.Source = hObjCLI;
minClockEnable.Tag = [tag minClockEnableOP];
minClockEnable.RowSpan = [currRow currRow];
minClockEnable.ColSpan = [1 1];
minClockEnable.Mode = true;
minClockEnable.Enabled = enableWidget;
currRow = currRow+1;

% Minimize Global Resets
minimizeGlobalResetsOP = 'MinimizeGlobalResets';
minimizeGlobalResets.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingMinimizeGlobalResets');
minimizeGlobalResets.Type = 'checkbox';
minimizeGlobalResets.ObjectProperty = minimizeGlobalResetsOP;
minimizeGlobalResets.Source = hObjCLI;
minimizeGlobalResets.Tag = [tag minimizeGlobalResetsOP];
minimizeGlobalResets.RowSpan = [currRow currRow];
minimizeGlobalResets.ColSpan = [1 1];
minimizeGlobalResets.Mode = true;
minimizeGlobalResets.Enabled = enableWidget;
currRow = currRow+1;

% Use trigger as signal clock
triggerAsClockOP = 'TriggerAsClock';
triggerAsClock.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsTriggerAsClock');
triggerAsClock.Type = 'checkbox';
triggerAsClock.ObjectProperty = triggerAsClockOP;
triggerAsClock.Source = hObjCLI;
triggerAsClock.Tag = [tag triggerAsClockOP];
triggerAsClock.RowSpan = [currRow currRow];
triggerAsClock.ColSpan = [1 1];
triggerAsClock.Mode = true;
triggerAsClock.Enabled = enableWidget;
currRow = currRow+1;

% enable Simulink test points in HDL code
enableTestpointsOP = 'EnableTestpoints';
enableTestpoints.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsEnableTestpoints');
enableTestpoints.Type = 'checkbox';
enableTestpoints.ObjectProperty = enableTestpointsOP;
enableTestpoints.Source = hObjCLI;
enableTestpoints.Tag = [tag enableTestpointsOP];
enableTestpoints.RowSpan = [currRow currRow];
enableTestpoints.ColSpan = [1 1];
enableTestpoints.Mode = true;
enableTestpoints.Enabled = enableWidget;
currRow = currRow+1;

% scalarize vector port
scalarizePort_OP = 'ScalarizePorts';
scalarizePort_lbl.Type = 'text';
scalarizePort_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsScalarizePorts');
scalarizePort_lbl.RowSpan = [currRow currRow];
scalarizePort_lbl.ColSpan = [1, 1];
scalarizePort_lbl.Enabled = strcmpi(hObjCLI.TargetLanguage, 'vhdl');

scalarizePort_drop.Type = 'combobox';
scalarizePort_drop.ObjectProperty = scalarizePort_OP;
scalarizePort_drop.Tag = [tag scalarizePort_drop.ObjectProperty];
scalarizePort_drop.Buddy = scalarizePort_drop.Tag;
scalarizePort_drop.RowSpan = [currRow currRow];
scalarizePort_drop.ColSpan = [2, 3];
scalarizePort_drop.Source = hObjCLI;
scalarizePort_drop.Mode = true;
scalarizePort_drop.DialogRefresh = true;
scalarizePort_drop.Visible = true;
scalarizePort_drop.Enabled = strcmpi(hObjCLI.TargetLanguage, 'vhdl');
scalarizePort_drop.MatlabMethod = 'hdlcoderui.hdlglblsettings.dialogCallback';
scalarizePort_drop.MatlabArgs   = {'ScalarizePorts', hObjCLI, '%dialog', '%tag'};
scalarizePort_drop.Entries = {'off',...
                              'on',...
                              DAStudio.message('HDLShared:hdldialog:DUTLevel')};
if strcmpi(hObjCLI.ScalarizePorts, 'off')
    value = 0;
elseif strcmpi(hObjCLI.ScalarizePorts, 'on')
    value = 1 ;
elseif strcmpi(hObjCLI.ScalarizePorts, 'DUTLevel')
    value = 2;
else
    value = 0;
end
scalarizePort_drop.Value = value;
currRow = currRow + 1;

dataPortGroup.Type = 'group';
dataPortGroup.LayoutGrid = [3 3];
dataPortGroup.Items = prtsTabwidgets;
dataPortGroup.Tag = [tag, 'DataPortGroup'];
dataPortGroup.RowSpan = [1 3];
dataPortGroup.ColSpan = [1 3];

globalPortGroup.Type = 'group';
globalPortGroup.LayoutGrid = [8 3];
globalPortGroup.Items = {minimizeGlobalResets, minClockEnable, triggerAsClock, enableTestpoints, scalarizePort_lbl, scalarizePort_drop};
globalPortGroup.Tag = [tag, 'GlobalPortGroup'];
globalPortGroup.ColSpan = [1 3];
globalPortGroup.RowSpan = [5 8];

portPanel.Type = 'panel';
portPanel.RowSpan = [1 currRow];
portPanel.ColSpan = [1 3];
portPanel.LayoutGrid = [currRow 3];
portPanel.ColStretch = [0 0 1];
portPanel.RowStretch = [zeros(1, currRow) 1];%[0 0 0 0 1];
portPanel.Tag = [tag, 'PortsGroup'];

portPanel.Items = {dataPortGroup, globalPortGroup};

% General tab panel
portsTab.Name  = DAStudio.message('HDLShared:hdldialog:hdlglblsettingPortsGroup');
portsTab.Items = {portPanel};
end

%--------------------------------------------------------------------------
% build coding standards choice & customization tables
function codingstdTab = builtCodingStandardsTab( this, hObjCLI, enableWidget )

MsgCatName = @(x) DAStudio.message(['HDLShared:hdldialog:',x]);

TabSpace = '     ';

tag = 'ConfigSet_HDLCoder_GlbSettingsPanel_CodingStandards_';
currRow = 2;
grpAdvanced.Type = 'panel';
grpAdvanced.RowSpan = [1 currRow];
grpAdvanced.ColSpan = [1 6];
grpAdvanced.LayoutGrid = [currRow 10];
grpAdvanced.ColStretch = 0;
grpAdvanced.RowStretch = [zeros(1, currRow) 1];
grpAdvanced.Tag = [tag, 'CodingStandardGroup'];

% top-row
rtype_cbOP = 'HDLCodingStandard';
rtype_lbl.Type = 'text';
rtype_lbl.Name = MsgCatName('hdlglblsettingsCodingStandard');
rtype_lbl.RowSpan = [currRow currRow];
rtype_lbl.ColSpan = [1 1];
rtype_lbl.DialogRefresh = 1;

rtype_cb.Type = 'combobox';
rtype_cb.ObjectProperty = rtype_cbOP;
rtype_cb.Tag = [tag,'option'];
rtype_lbl.Buddy = rtype_cb.Tag;
rtype_cb.RowSpan = [currRow currRow];
rtype_cb.ColSpan = [2 2];
rtype_cb.Source = hObjCLI;
rtype_cb.Mode = true;
rtype_cb.Enabled = enableWidget;
rtype_cb.Entries = {'None','Industry'};
rtype_cb.DialogRefresh = 1;

top_group.Name = MsgCatName('hdlglblsettingsCodingStandard_ChooseCSO');
top_group.Type = 'group';
top_group.Items = {rtype_lbl,rtype_cb};
top_group.LayoutGrid = [currRow, 2];
top_group.ColStretch = [0 0 0 0 0 1];
top_group.ColSpan = [1 6];
top_group.RowSpan = [currRow, currRow];

currRow = currRow + 1;

startCol = 1; endCol = 6; endCol1 = 0;

inIndustryMode = strncmpi('INDUSTRY',hObjCLI.HDLCodingStandard,length(hObjCLI.HDLCodingStandard));

%% Boolean rules
% Reporting Section
% show passing rules only
filterpassing_chk.Type = 'checkbox';
filterpassing_chk.Tag = [tag,'ShowPassingRules'];
filterpassing_chk.RowSpan = [currRow currRow]-currRow+1;
filterpassing_chk.ColSpan = [startCol endCol];
filterpassing_chk.Name = MsgCatName('csoShowPassingRules');
filterpassing_chk.Enabled = enableWidget & inIndustryMode;

report_group.Name = MsgCatName('hdlglblsettingsCodingStandard_reporting_options');
report_group.Type = 'group';
report_group.Items = {filterpassing_chk};
report_group.LayoutGrid = [currRow, currRow];
report_group.ColStretch = [0 0 0 1 1 1];
report_group.ColSpan = [1 6];
report_group.RowSpan = [currRow, currRow];

currRow = currRow + 2;
row_start = currRow;
currRow = currRow + 1;

% detect dupe names - same row as above
dupeNames_chk.Type = 'checkbox';
dupeNames_chk.Tag = [tag,'DetectDuplicateNamesCheck'];
dupeNames_chk.RowSpan = [currRow currRow]-row_start;
dupeNames_chk.ColSpan = [startCol endCol]+endCol1;
dupeNames_chk.Name = MsgCatName('csoDetectDuplicateNamesCheck');
dupeNames_chk.Enabled = enableWidget & inIndustryMode;
dupeNames_chk.Source = this;
currRow = currRow + 2;

% detect kw usage
kwUsage_chk.Type = 'checkbox';
kwUsage_chk.Tag = [tag,'HDLKeywords'];
kwUsage_chk.RowSpan = [currRow currRow]-row_start;
kwUsage_chk.ColSpan = [startCol endCol];
kwUsage_chk.Name = MsgCatName('csoHDLKeywords');
kwUsage_chk.Enabled = enableWidget & inIndustryMode;
currRow  = currRow + 2;

modname_chk.Type = 'checkbox';
modname_chk.Tag = [tag,'ModuleInstanceEntityNameLength'];
modname_chk.RowSpan = [currRow currRow]-row_start;
modname_chk.ColSpan = [startCol endCol];
modname_chk.Name = MsgCatName('csoEntityName');
modname_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

modname_min.Type = 'edit';
modname_min.Tag = [tag,'ModuleInstanceEntityNameLength_min'];
modname_min.RowSpan = [currRow currRow]-row_start;
modname_min.ColSpan = [startCol, startCol+1];
modname_min.Name = [TabSpace,MsgCatName('csoMin')];
modname_min.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 1;

modname_max.Type = 'edit';
modname_max.Tag = [tag,'ModuleInstanceEntityNameLength_max'];
modname_max.RowSpan = [currRow currRow]-row_start;
modname_max.ColSpan = [startCol, startCol+1];
modname_max.Name = [TabSpace,MsgCatName('csoMax')];
modname_max.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 1;

% SignalPortParamNames
sigport_name_chk.Type = 'checkbox';
sigport_name_chk.Tag = [tag,'SignalPortParamNameLength'];
sigport_name_chk.RowSpan = [currRow currRow]-row_start;
sigport_name_chk.ColSpan = [startCol endCol];
sigport_name_chk.Name = MsgCatName('csoSignalName');
sigport_name_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 1;

sigport_name_min.Type = 'edit';
sigport_name_min.Tag = [tag,'SignalPortParamNameLength_min'];
sigport_name_min.RowSpan = [currRow currRow]-row_start;
sigport_name_min.ColSpan = [startCol, 1+startCol];
sigport_name_min.Name = [TabSpace,MsgCatName('csoMin')];
sigport_name_min.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 1;

sigport_name_max.Type = 'edit';
sigport_name_max.Tag = [tag,'SignalPortParamNameLength_max'];
sigport_name_max.RowSpan = [currRow currRow]-row_start;
sigport_name_max.ColSpan = [startCol, startCol+1];
sigport_name_max.Name = [TabSpace,MsgCatName('csoMax')];
sigport_name_max.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 1;

param1_group.Name = MsgCatName('hdlglblsettingsCodingStandard_group1');
param1_group.Type = 'group';
param1_group.LayoutGrid = [row_start, currRow+1];
param1_group.ColStretch = [0 0 0 1 1 1];
param1_group.ColSpan = [1 6];
param1_group.RowSpan = [row_start, currRow];

% update later.
param1_group.Items = {};
currRow = currRow + 1;

%% Category 2 : RTL description rules customization
row_start = currRow ;
currRow = currRow + 2;

% MinimizeClockEnable
mincenable_chk.Type = 'checkbox';
mincenable_chk.Tag = [tag,'MinimizeClockEnable'];
mincenable_chk.RowSpan = [currRow, currRow]- row_start;
mincenable_chk.ColSpan = [startCol endCol];
mincenable_chk.Name = MsgCatName('csoMinimizeClockEnableCheck');
mincenable_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% RemoveResetCheck
removereset_chk.Type = 'checkbox';
removereset_chk.Tag = [tag,'RemoveResetCheck'];
removereset_chk.RowSpan = [currRow, currRow]- row_start;
removereset_chk.ColSpan = [startCol endCol];
removereset_chk.Name = MsgCatName('csoRemoveResetCheck');
removereset_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% AsynchronousResetCheck
asyncreset_chk.Type = 'checkbox';
asyncreset_chk.Tag = [tag,'AsynchronousResetCheck'];
asyncreset_chk.RowSpan = [currRow, currRow]- row_start;
asyncreset_chk.ColSpan = [startCol endCol];
asyncreset_chk.Name = MsgCatName('csoAsynchronousResetCheck');
asyncreset_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% MinimizeVariableUsage
minvarUsage_chk.Type = 'checkbox';
minvarUsage_chk.Tag = [tag,'MinimizeVariableUsage'];
minvarUsage_chk.RowSpan = [currRow, currRow]- row_start;
minvarUsage_chk.ColSpan = [startCol endCol];
minvarUsage_chk.Name = MsgCatName('csoMinimizeVariableUsage');
minvarUsage_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% RAMInitializationWarning
ramWarn_chk.Type = 'checkbox';
ramWarn_chk.Tag = [tag,'InitialStatements'];
ramWarn_chk.RowSpan = [currRow currRow]-row_start;
ramWarn_chk.ColSpan = [startCol endCol];
ramWarn_chk.Name = MsgCatName('csoInitialStatements');
ramWarn_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% ConditionalRegionCheck
currRow = currRow + 2;
condregion_chk.Type = 'checkbox';
condregion_chk.RowSpan = [currRow currRow]-row_start;
condregion_chk.ColSpan = [startCol endCol];
condregion_chk.Name = MsgCatName('csoConditionalRegionCheck');
condregion_chk.Tag = [tag,'ConditionalRegionCheck'];
condregion_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 1;

condregion_min.Type = 'edit';
condregion_min.Tag = [tag,'ConditionalRegionCheck_length'];
condregion_min.RowSpan = [currRow+1 currRow+1]-row_start;
condregion_min.ColSpan = [startCol, 1+startCol];
condregion_min.Name = [TabSpace,MsgCatName('csoConditionalRegionCheckLength')];
condregion_min.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% if chain
currRow = currRow + 2;
ifchain_chk.Type = 'checkbox';
ifchain_chk.RowSpan = [currRow currRow]-row_start;
ifchain_chk.ColSpan = [startCol endCol];
ifchain_chk.Name = MsgCatName('csoIfElseChain');
ifchain_chk.Tag = [tag,'IfElseChain'];
ifchain_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 1;

ifchain_min.Type = 'edit';
ifchain_min.Tag = [tag,'IfElseChain_length'];
ifchain_min.RowSpan = [currRow+1 currRow+1]-row_start;
ifchain_min.ColSpan = [startCol, 1+startCol];
ifchain_min.Name = [TabSpace,MsgCatName('csoIfElseChainLength')];
ifchain_min.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% if-else nesting  on same row as above
ifnest_chk.Type = 'checkbox';
ifnest_chk.Tag = [tag,'IfElseNesting'];
ifnest_chk.RowSpan = [currRow currRow]-row_start;
ifnest_chk.ColSpan = [startCol, endCol]+endCol1;
ifnest_chk.Name = MsgCatName('csoIfElseNesting');
ifnest_chk.Enabled = enableWidget & inIndustryMode;

ifnest_max.Type = 'edit';
ifnest_max.Tag = [tag,'IfElseNesting_depth'];
ifnest_max.RowSpan = [1+currRow ,1+currRow]-row_start;
ifnest_max.ColSpan = [startCol, 1+startCol];
ifnest_max.Name = [TabSpace,MsgCatName('csoIfElseNestingDepth')];
ifnest_max.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% multiplier bit width - on same row as above
mulwid_chk.Type = 'checkbox';
mulwid_chk.Tag = [tag,'MultiplierBitWidth'];
mulwid_chk.RowSpan = [currRow currRow]-row_start;
mulwid_chk.ColSpan = [startCol, startCol+1];
mulwid_chk.Name = MsgCatName('csoMultiplierBitWidth');
mulwid_chk.Enabled = enableWidget & inIndustryMode;

currRow = currRow + 1;
mulwid_max.Type = 'edit';
mulwid_max.Tag = [tag,'MultiplierBitWidth_width'];
mulwid_max.RowSpan = [currRow, currRow]-row_start;
mulwid_max.ColSpan = [startCol, 1+startCol];
mulwid_max.Name = [TabSpace,MsgCatName('csoMax')];
mulwid_max.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

param2_group.Name = MsgCatName('hdlglblsettingsCodingStandard_group2');
param2_group.Type = 'group';
param2_group.LayoutGrid = [row_start, currRow+1];
param2_group.ColStretch = [0 0 0 1 1 1];
param2_group.ColSpan = [1 6];
param2_group.RowSpan = [row_start, currRow];

% update later.
param2_group.Items = {};

%% Category 3 : RTL design rules customization
% module inst entity name lengths
currRow = currRow + 1;
row_start = currRow;

% detect reals
detReals_chk.Type = 'checkbox';
detReals_chk.Tag = [tag,'NonIntegerTypes'];
detReals_chk.RowSpan = [currRow currRow]-row_start;
detReals_chk.ColSpan = [startCol endCol] + endCol1;
detReals_chk.Name = MsgCatName('csoNonIntegerTypes');
detReals_chk.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

% max line length in output HDL
lineLen_chk.Type = 'checkbox';
lineLen_chk.Tag = [tag,'LineLength'];
lineLen_chk.RowSpan = [currRow currRow]-row_start;
lineLen_chk.ColSpan = [startCol endCol];
lineLen_chk.Name = MsgCatName('csoLineLength');
lineLen_chk.Enabled = enableWidget & inIndustryMode;

lineLen_max.Type = 'edit';
lineLen_max.Tag = [tag,'LineLength_length'];
lineLen_max.RowSpan = [currRow+1 currRow+1]-row_start;
lineLen_max.ColSpan = [startCol, startCol+1];
lineLen_max.Name = [TabSpace,MsgCatName('csoMax')];
lineLen_max.Enabled = enableWidget & inIndustryMode;
currRow = currRow + 2;

param3_group.Name = MsgCatName('hdlglblsettingsCodingStandard_group3');
param3_group.Type = 'group';
param3_group.LayoutGrid = [row_start, currRow+1];
param3_group.ColStretch = [0 0 0 1 1 1];
param3_group.ColSpan = [1 6];
param3_group.RowSpan = [row_start, currRow+1];

% update later.
param3_group.Items = {};


% update the field values in the case of codingstandard mode
if strncmpi('INDUSTRY',hObjCLI.HDLCodingStandard,length(hObjCLI.HDLCodingStandard))
    if ( ~isa(hObjCLI.HDLCodingStandardCustomization,'hdlcodingstd.IndustryCustomizations') )
        hObjCLI.HDLCodingStandardCustomization = hdlcoder.CodingStandard('Industry');
    end
    
    cso = hObjCLI.HDLCodingStandardCustomization;
    callback = 'hdlcoderui.hdlglblsettings.dialogCallback';
    
    dupeNames_chk.Value = cso.DetectDuplicateNamesCheck.enable;
    kwUsage_chk.Value = cso.HDLKeywords.enable;
    detReals_chk.Value = cso.NonIntegerTypes.enable;
    ifchain_chk.Value = cso.IfElseChain.enable;
    ifnest_chk.Value = cso.IfElseNesting.enable;
    ramWarn_chk.Value = cso.InitialStatements.enable;
    lineLen_chk.Value = cso.LineLength.enable;
    filterpassing_chk.Value = cso.ShowPassingRules.enable;
    mulwid_chk.Value = cso.MultiplierBitWidth.enable;
    sigport_name_chk.Value = cso.SignalPortParamNameLength.enable;
    modname_chk.Value = cso.ModuleInstanceEntityNameLength.enable;
    
    % duplicate names usage
    dupeNames_chk.MatlabMethod = callback;
    dupeNames_chk.MatlabArgs = { 'codingstandards', cso,...
        'DetectDuplicateNamesCheck','%dialog','%tag'};
    
    % HDL keyword usage
    kwUsage_chk.MatlabMethod = callback;
    kwUsage_chk.MatlabArgs = { 'codingstandards', cso, 'HDLKeywords','%dialog','%tag'};
    
    % real number usage checks
    detReals_chk.MatlabMethod = callback;
    detReals_chk.MatlabArgs = { 'codingstandards', cso, 'NonIntegerTypes','%dialog','%tag'};
    
    % MinimizeClockEnable checks
    mincenable_chk.Value = cso.MinimizeClockEnableCheck.enable;
    mincenable_chk.MatlabMethod = callback;
    mincenable_chk.MatlabArgs = { 'codingstandards', cso,...
        'MinimizeClockEnableCheck','%dialog','%tag'};
    
    % RemoveReset Checks
    removereset_chk.Value = cso.RemoveResetCheck.enable;
    removereset_chk.MatlabMethod = callback;
    removereset_chk.MatlabArgs = { 'codingstandards', cso,'RemoveResetCheck','%dialog','%tag'};
    
    % AsynchronousReset Checks
    asyncreset_chk.Value = cso.AsynchronousResetCheck.enable;
    asyncreset_chk.MatlabMethod = callback;
    asyncreset_chk.MatlabArgs = { 'codingstandards', cso,...
        'AsynchronousResetCheck','%dialog','%tag'};
    
    % MinimizeVariableUsage checks
    minvarUsage_chk.Value = cso.MinimizeVariableUsage.enable;
    minvarUsage_chk.MatlabMethod = callback;
    minvarUsage_chk.MatlabArgs   = { 'codingstandards', cso,...
        'MinimizeVariableUsage','%dialog','%tag'};
    
    % RAM initialization checks
    ramWarn_chk.Value = cso.InitialStatements.enable;
    ramWarn_chk.MatlabMethod = callback;
    ramWarn_chk.MatlabArgs   = { 'codingstandards', cso, 'InitialStatements','%dialog','%tag'};
    
    %% Multiplier width checks
    mulwid_chk.Value = cso.MultiplierBitWidth.enable;
    mulwid_max.Value = num2str(cso.MultiplierBitWidth.width);
    
    mulwid_chk.DialogRefresh = true;
    mulwid_max.DialogRefresh = true;
    
    mulwid_chk.MatlabMethod = callback;
    mulwid_chk.MatlabArgs   = { 'codingstandards', cso, 'MultiplierBitWidth','%dialog','%tag'};
    
    mulwid_max.MatlabMethod = callback;
    mulwid_max.MatlabArgs   = { 'codingstandards', cso,...
        'MultiplierBitWidth','%dialog',mulwid_chk.Tag};
    mulwid_max.Enabled = mulwid_chk.Enabled & cso.MultiplierBitWidth.enable;
    
    %% Conditional Region Check
    condregion_chk.Value = cso.ConditionalRegionCheck.enable;
    condregion_min.Value = cso.ConditionalRegionCheck.length;
    
    condregion_chk.MatlabMethod = callback;
    condregion_chk.MatlabArgs   = { 'codingstandards', cso,...
        'ConditionalRegionCheck','%dialog','%tag'};
    condregion_chk.DialogRefresh = true;
    
    condregion_min.DialogRefresh = true;
    condregion_min.MatlabMethod = callback;
    condregion_min.MatlabArgs   = { 'codingstandards', cso,...
        'ConditionalRegionCheck','%dialog',condregion_chk.Tag};
    condregion_min.Enabled = condregion_chk.Enabled & cso.ConditionalRegionCheck.enable;
    
    %% IfElseChain + length
    ifchain_chk.Value = cso.IfElseChain.enable;
    ifchain_min.Value = num2str(cso.IfElseChain.length);
    
    ifchain_chk.MatlabMethod = callback;
    ifchain_chk.MatlabArgs   = { 'codingstandards', cso, 'IfElseChain','%dialog','%tag'};
    ifchain_chk.DialogRefresh = true;
    
    ifchain_min.DialogRefresh = true;
    ifchain_min.MatlabMethod = callback;
    ifchain_min.MatlabArgs   = { 'codingstandards', cso, 'IfElseChain','%dialog',ifchain_chk.Tag};
    ifchain_min.Enabled = ifchain_chk.Enabled & cso.IfElseChain.enable;
    
    %% IfElseNesting + depth
    ifnest_chk.Value = cso.IfElseNesting.enable;
    ifnest_max.Value = num2str(cso.IfElseNesting.depth);
    
    ifnest_chk.MatlabMethod = callback;
    ifnest_chk.MatlabArgs   = { 'codingstandards', cso, 'IfElseNesting','%dialog','%tag'};
    ifnest_chk.DialogRefresh = true;
    
    ifnest_max.DialogRefresh = true;
    ifnest_max.MatlabMethod = callback;
    ifnest_max.MatlabArgs   = { 'codingstandards', cso, 'IfElseNesting','%dialog',ifnest_chk.Tag};
    ifnest_max.Enabled = ifnest_chk.Enabled & cso.IfElseNesting.enable;
    
    %% Line Wrap + length
    lineLen_chk.Value = cso.LineLength.enable;
    lineLen_max.Value = num2str( cso.LineLength.length );
    
    lineLen_chk.MatlabMethod = callback;
    lineLen_chk.MatlabArgs   = { 'codingstandards', cso, 'LineLength','%dialog','%tag'};
    lineLen_chk.DialogRefresh = true;
    
    lineLen_max.MatlabMethod = callback;
    lineLen_max.MatlabArgs   = { 'codingstandards', cso, 'LineLength','%dialog',lineLen_chk.Tag};
    lineLen_max.Enabled = lineLen_chk.Enabled & cso.LineLength.enable;
    lineLen_max.DialogRefresh = true;
    
    % boolean - Show Passing Rules
    filterpassing_chk.Value = ~ cso.ShowPassingRules.enable;
    
    filterpassing_chk.MatlabMethod = callback;
    filterpassing_chk.MatlabArgs = {'codingstandards', cso, 'FilterPassingRules','%dialog','%tag'};
    
    %% sig-port-param names - min + max
    sigport_name_chk.Value = cso.SignalPortParamNameLength.enable;
    sigport_name_min.Value = num2str( cso.SignalPortParamNameLength.length(1) );
    sigport_name_max.Value = num2str( cso.SignalPortParamNameLength.length(2) );
    
    sigport_name_chk.MatlabMethod = callback;
    sigport_name_chk.MatlabArgs   = { 'codingstandards', cso,...
        'SignalPortParamNameLength','%dialog','%tag'};
    sigport_name_chk.DialogRefresh = true;
    
    sigport_name_min.MatlabMethod = callback;
    sigport_name_min.MatlabArgs   = { 'codingstandards', cso,...
        'SignalPortParamNameLength','%dialog',sigport_name_chk.Tag};
    sigport_name_min.DialogRefresh = true;
    
    sigport_name_max.MatlabMethod = callback;
    sigport_name_max.MatlabArgs   = { 'codingstandards', cso,...
        'SignalPortParamNameLength','%dialog',sigport_name_chk.Tag};
    sigport_name_max.DialogRefresh = true;
    
    sigport_name_min.Enabled = sigport_name_chk.Enabled & cso.SignalPortParamNameLength.enable;
    sigport_name_max.Enabled = sigport_name_chk.Enabled & cso.SignalPortParamNameLength.enable;
    
    %% module-inst-entity names - min + max
    modname_chk.Value = cso.ModuleInstanceEntityNameLength.enable;
    modname_min.Value = num2str( cso.ModuleInstanceEntityNameLength.length(1) );
    modname_max.Value = num2str( cso.ModuleInstanceEntityNameLength.length(2) );
    modname_min.Enabled = cso.ModuleInstanceEntityNameLength.enable;
    modname_max.Enabled = cso.ModuleInstanceEntityNameLength.enable;
    
    modname_chk.MatlabMethod = callback;
    modname_chk.MatlabArgs   = { 'codingstandards', cso, 'ModuleInstanceEntityNameLength','%dialog','%tag'};
    modname_chk.DialogRefresh = true;
    
    modname_min.MatlabMethod = callback;
    modname_min.MatlabArgs   = { 'codingstandards', cso, 'ModuleInstanceEntityNameLength','%dialog',modname_chk.Tag};
    modname_min.DialogRefresh = true;
    
    modname_max.MatlabMethod = callback;
    modname_max.MatlabArgs   = { 'codingstandards', cso, 'ModuleInstanceEntityNameLength','%dialog',modname_chk.Tag};
    modname_max.DialogRefresh = true;
    
    modname_min.Enabled = modname_chk.Enabled & cso.ModuleInstanceEntityNameLength.enable;
    modname_max.Enabled = modname_chk.Enabled & cso.ModuleInstanceEntityNameLength.enable;
else
    hObjCLI.HDLCodingStandardCustomization = [];
    mincenable_chk.Enabled = false;
    removereset_chk.Enabled = false;
    asyncreset_chk.Enabled = false;
    minvarUsage_chk.Enabled = false;
    dupeNames_chk.Enabled = false;
    kwUsage_chk.Enabled = false;
    detReals_chk.Enabled = false;
    
    condregion_chk.Enabled = false;
    condregion_min.Enabled = false;
    
    ifchain_chk.Enabled = false;
    ifchain_min.Enabled = false;
    
    ifnest_chk.Enabled = false;
    ifnest_max.Enabled = false;
    
    ramWarn_chk.Enabled = false;
    
    lineLen_chk.Enabled = false;
    lineLen_max.Enabled = false;
    
    filterpassing_chk.Enabled = false;
    
    mulwid_chk.Enabled = false;
    mulwid_max.Enabled = false;
    
    sigport_name_chk.Enabled = false;
    sigport_name_min.Enabled = false;
    sigport_name_max.Enabled = false;
    
    modname_chk.Enabled = false;
    modname_min.Enabled = false;
    modname_max.Enabled = false;
end

% update items b/c of callback changes

param3_group.Items = { detReals_chk, lineLen_chk, lineLen_max };

param2_group.Items = {mincenable_chk,...
    removereset_chk,...
    asyncreset_chk,...
    minvarUsage_chk,...
    ramWarn_chk,...
    condregion_chk,condregion_min,...
    ifchain_chk, ifchain_min, ...
    mulwid_chk, mulwid_max, ...
    ifnest_chk, ifnest_max};

param1_group.Items = { dupeNames_chk, ...
    kwUsage_chk, ...
    modname_chk, modname_min, modname_max, ...
    sigport_name_chk, sigport_name_min, sigport_name_max };

report_group.Items = {filterpassing_chk};

%gpReportGrp,...
grpAdvanced.Items = {top_group, ...
    report_group,...
    param1_group,...
    param2_group,...
    param3_group,...
    };

codingstdTab.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingCodingStandardsGroup');
codingstdTab.Items = {grpAdvanced};

end

%--------------------------------------------------------------------------
% build floating point code generation options
function floatingptTab = builtFloatingPointTab(this, hObjCLI, enableWidget) %#ok<INUSL>
% Widgets on the "FloatingPoint" tab
tag = 'ConfigSet_HDLCoder_FloatingPointPanel_';

grpFloatingPoint = renderFloatingPointSettings(tag, enableWidget, hObjCLI);

floatingptTab.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingUseFloatingPoint');
floatingptTab.Items = {grpFloatingPoint};

end

function grpFloatingPoint = renderGrpFloatingPoint(tag, rows)
%% panel
grpFloatingPoint.Type = 'panel';
grpFloatingPoint.RowSpan = [1 1];
grpFloatingPoint.ColSpan = [1 1];
grpFloatingPoint.LayoutGrid = [rows 1];
grpFloatingPoint.ColStretch = 0;
grpFloatingPoint.RowStretch = [zeros(1, rows-1) 1];
grpFloatingPoint.Tag = [tag, 'FloatingPointGroup'];
end


function grpFloatingPoint = renderFloatingPointSettings(tag, enableWidget, hObjCLI)

fc = hObjCLI.FloatingPointTargetConfiguration;

currRow = 2;
%% Latency Mode Settings
latencyStrategy_lbl.Type = 'text';
latencyStrategy_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingFloatingPointLatencyModeLatencyStrategy');
latencyStrategy_lbl.RowSpan = [1 1];
latencyStrategy_lbl.ColSpan = [1 1];

latencyStrategy.Type = 'combobox';
latencyStrategy.Source = hObjCLI;
latencyStrategy.Tag = [tag 'NFPLatencyStrategy'];
latencyStrategy_lbl.Buddy = latencyStrategy.Tag;
latencyStrategy.RowSpan = [1 1];
latencyStrategy.ColSpan = [2 2];
latencyStrategy.DialogRefresh  = true;
latencyStrategy.Mode = true;
latencyStrategy.Entries = {'MAX', 'MIN', 'ZERO'};
latencyStrategy.Enabled =  enableWidget;
latencyStrategy.MatlabMethod = 'hdlcoderui.hdlglblsettings.dialogCallback';
latencyStrategy.MatlabArgs   = { 'floatingpoint', hObjCLI, '%dialog','%tag'};
idx = 0;
if ~empty(fc)
    switch upper(fc.LibrarySettings.LatencyStrategy)
        case {'MAX'}
            idx = 0;
        case {'MIN'}
            idx = 1;
        case {'ZERO'}
            idx = 2;
        otherwise
            assert(false);
    end
end
latencyStrategy.Value = idx;
%
spacerForLatencyStrategy.Type = 'text';
spacerForLatencyStrategy.Name = ' ';
spacerForLatencyStrategy.RowSpan = [1 1];
spacerForLatencyStrategy.ColSpan = [3 3];
%


denormalHandling.Type = 'checkbox';
denormalHandling.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingFloatingPointHandleDenormals');
denormalHandling.Tag = [tag 'HandleDenormals'];
denormalHandling.RowSpan = [2 2];
denormalHandling.ColSpan = [1 1];
denormalHandling.DialogRefresh  = true;
denormalHandling.Enabled =  enableWidget;
denormalHandling.MatlabMethod = 'hdlcoderui.hdlglblsettings.dialogCallback';
denormalHandling.MatlabArgs   = { 'floatingpoint', hObjCLI, '%dialog','%tag'};
idx = 0;
if ~empty(fc)
    switch upper(fc.LibrarySettings.LatencyStrategy)
        case {'MAX'}
            idx = 0;
        case {'MIN'}
            idx = 1;
        case {'ZERO'}
            idx = 2;
        otherwise
            assert(false);
    end
end
denormalHandling.Value = idx;

spacerForObjective.Type = 'text';
spacerForObjective.Name = ' ';
spacerForObjective.RowSpan = [1 1];
spacerForObjective.ColSpan = [3 3];

    
multAlgoStrategy.Type = 'combobox';
multAlgoStrategy.Source = hObjCLI;
multAlgoStrategy.Tag = [tag 'NFPAlgoMultStrategy'];
multAlgoStrategy.RowSpan = [0 1];
multAlgoStrategy.ColSpan = [0 2];
multAlgoStrategy.DialogRefresh  = true;
multAlgoStrategy.Mode = true;
multAlgoStrategy.Entries = {'Auto', 'Full Multiplier', 'Part Multiplier Part AddShift', 'No Multiplier Full AddShift'};
multAlgoStrategy.Enabled =  enableWidget;
multAlgoStrategy.MatlabMethod = 'hdlcoderui.hdlglblsettings.dialogCallback';
multAlgoStrategy.MatlabArgs   = { 'floatingpoint', hObjCLI, '%dialog','%tag'};
if isempty(fc)
    idx = 0;
else
    switch upper(fc.LibrarySettings.MantissaMultiplyStrategy)
        case {'AUTO'}
            idx = 0;
        case {'FULLMULTIPLIER'}
            idx = 1;
        case {'PARTMULTIPLIERPARTADDSHIFT'}
            idx = 2;
        case {'NOMULTIPLIERFULLADDSHIFT'}
            idx = 3;
        otherwise
            assert(false);
    end
end
multAlgoStrategy.Value = idx;

spacerFormultAlgoStrategy.Type = 'text';
spacerFormultAlgoStrategy.Name = ' ';
spacerFormultAlgoStrategy.RowSpan = [1 1];
spacerFormultAlgoStrategy.ColSpan = [3 3];

grpLatencyModeSettings.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingUseFloatingPoint');
grpLatencyModeSettings.Type = 'group';
grpLatencyModeSettings.LayoutGrid = [2, 3];
grpLatencyModeSettings.RowStretch = [0 0];
grpLatencyModeSettings.ColStretch = [0 0 1];
grpLatencyModeSettings.RowSpan = [currRow, currRow];
grpLatencyModeSettings.LayoutGrid = [2, 3];
grpLatencyModeSettings.RowStretch = [0 0];
grpLatencyModeSettings.ColStretch = [0 0 1];
grpLatencyModeSettings.RowSpan = [currRow, currRow];
grpLatencyModeSettings.ColSpan = [1 1];
grpLatencyModeSettings.ColSpan = [1 1];
% grpLatencyModeSettings.Items = {latencyStrategy_lbl, latencyStrategy, ....
%      spacerForLatencyStrategy, objective_lbl, denormalHandling, spacerForObjective};
grpLatencyModeSettings.Items = {latencyStrategy_lbl, latencyStrategy, spacerForLatencyStrategy, ...
    denormalHandling, spacerForObjective, multAlgoStrategy, spacerFormultAlgoStrategy};
% end of Latency Mode Settings group

grpFloatingPoint = renderGrpFloatingPoint(tag, 2);
%grpFloatingPoint.Items = {grpMode, grpLatencyModeSettings, grpIPConfig};
grpFloatingPoint.Items = {grpLatencyModeSettings};
end

%--------------------------------------------------------------------------
function advancedTab = builtAdvancedTab(this, hObjCLI, enableWidget) %#ok<INUSL>
% Widgets on the "Ports" tab
tag = 'ConfigSet_HDLCoder_GlbSettingsPanel_';

currRow = 1;
%[prtsTabwidgets, currRow] = getSharedWidgets(this, hObjCLI, enableWidget, currRow, 'diagnostics', tag);
tag = [tag 'AdvancedTab_'];

currRow = currRow+1;

% critical path estimation
% hiliteCriticalPathOP = 'CriticalPathEstimation';
% hiliteCriticalPath.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingHiliteCriticalPath');
% hiliteCriticalPath.Type = 'checkbox';
% hiliteCriticalPath.ObjectProperty = hiliteCriticalPathOP;
% hiliteCriticalPath.Source = hObjCLI;
% hiliteCriticalPath.Tag = [tag hiliteCriticalPathOP];
% hiliteCriticalPath.RowSpan = [currRow currRow];
% hiliteCriticalPath.ColSpan = [1 2];
% hiliteCriticalPath.DialogRefresh = true;
% hiliteCriticalPath.Mode = true;
% hiliteCriticalPath.Enabled = enableWidget;
% currRow = currRow+1;



%DON'T DELETE FOLLOWING COMMENTED CODE. THIS NEEDS TO BE ENABLED ONCE SUPPORT FOR MULTIPLE PATHS IMPLEMENTED.

% % num critical paths
% numCritPathsOP = 'NumCriticalPathsEstimated';
% numCritPaths_lbl.Type = 'text';
% numCritPaths_lbl.Name = [TabSpace DAStudio.message('HDLShared:hdldialog:hdlglblsettingsNumCritPaths')];
% numCritPaths_lbl.RowSpan = [currRow currRow];
% numCritPaths_lbl.ColSpan = [1 1];
%
% numCritPaths.Type = 'edit';
% numCritPaths.ObjectProperty = numCritPathsOP;
% numCritPaths.Tag = [tag numCritPathsOP];
% numCritPaths_lbl.Buddy = numCritPaths.Tag;
% numCritPaths.RowSpan = [currRow currRow];
% numCritPaths.ColSpan = [2 2];
% numCritPaths.Source = hObjCLI;
% numCritPaths.DialogRefresh = true;
% numCritPaths.Mode = true;
% numCritPaths.Enabled = enableWidget;
% currRow = currRow+1;
%
% crit-path file name
% critPathFileOP = 'CriticalPathEstimationFile';
% critPathFile_lbl.Type = 'text';
% critPathFile_lbl.Name = [TabSpace DAStudio.message('HDLShared:hdldialog:hdlglblsettingsCritPathFile')];
% critPathFile_lbl.RowSpan = [currRow currRow];
% critPathFile_lbl.ColSpan = [1 1];
%
% critPathFile.Type = 'edit';
% critPathFile.ObjectProperty = critPathFileOP;
% critPathFile.Tag = [tag critPathFileOP];
% critPathFile_lbl.Buddy = critPathFile.Tag;
% critPathFile.RowSpan = [currRow currRow];
% critPathFile.ColSpan = [2 2];
% critPathFile.Source = hObjCLI;
% critPathFile.Mode = true;
% critPathFile.DialogRefresh = true;
% critPathFile.Enabled = enableWidget;
% currRow = currRow+1;
%
% critPathOBFileOP = 'BlocksWithNoCharacterizationFile';
% critPathOBFile_lbl.Type = 'text';
%critPathOBFile_lbl.Name = [TabSpace...
%    DAStudio.message('HDLShared:hdldialog:hdlglblsettingsCritPathOffendingBlocksHighlightFile')];
% critPathOBFile_lbl.RowSpan = [currRow currRow];
% critPathOBFile_lbl.ColSpan = [1 1];
%
% critPathOBFile.Type = 'edit';
% critPathOBFile.ObjectProperty = critPathOBFileOP;
% critPathOBFile.Tag = [tag critPathOBFileOP];
% critPathOBFile_lbl.Buddy = critPathOBFile.Tag;
% critPathOBFile.RowSpan = [currRow currRow];
% critPathOBFile.ColSpan = [2 2];
% critPathOBFile.Source = hObjCLI;
% critPathOBFile.Mode = true;
% critPathOBFile.DialogRefresh = true;
% critPathOBFile.Enabled = enableWidget;
% currRow = currRow+1;
%
% if strcmpi(hObjCLI.CriticalPathEstimation, 'off')
%      critPathFile.Enabled = false;
%      critPathOBFile.Enabled = false;
%      %numCritPaths.Enabled = false;
% end

detBlackBoxCollisionOP = 'DetectBlackBoxNameCollision';

detBlackBoxCollision_lbl.Type = 'text';
detBlackBoxCollision_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsetting_DetectBlackBoxNameCollision');
detBlackBoxCollision_lbl.RowSpan = [currRow currRow];
detBlackBoxCollision_lbl.ColSpan = [1 2];

detBlackBoxCollision.Type = 'combobox';
detBlackBoxCollision.ObjectProperty = detBlackBoxCollisionOP;
detBlackBoxCollision.Source = hObjCLI;
detBlackBoxCollision.Tag = [tag detBlackBoxCollisionOP];
detBlackBoxCollision_lbl.Buddy = detBlackBoxCollision.Tag;
detBlackBoxCollision.RowSpan = [currRow, currRow];
detBlackBoxCollision.ColSpan = [3 3];
detBlackBoxCollision.DialogRefresh  = true;
detBlackBoxCollision.Mode = true;
detBlackBoxCollision.Entries = {'None','Warning','Error'};
detBlackBoxCollision.Enabled =  enableWidget;
currRow = currRow+1;



TreatRealsInGeneratedCodeAsOP = 'TreatRealsInGeneratedCodeAs';

TreatRealsInGeneratedCodeAs_lbl.Type = 'text';
TreatRealsInGeneratedCodeAs_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsetting_TreatRealsInGeneratedCodeAs');
TreatRealsInGeneratedCodeAs_lbl.RowSpan = [currRow currRow];
TreatRealsInGeneratedCodeAs_lbl.ColSpan = [1 2];

TreatRealsInGeneratedCodeAs.Type = 'combobox';
TreatRealsInGeneratedCodeAs.ObjectProperty = TreatRealsInGeneratedCodeAsOP;
TreatRealsInGeneratedCodeAs.Source = hObjCLI;
TreatRealsInGeneratedCodeAs.Tag = [tag TreatRealsInGeneratedCodeAsOP];
TreatRealsInGeneratedCodeAs_lbl.Buddy = TreatRealsInGeneratedCodeAs.Tag;
TreatRealsInGeneratedCodeAs.RowSpan = [currRow, currRow];
TreatRealsInGeneratedCodeAs.ColSpan = [3 3];
TreatRealsInGeneratedCodeAs.DialogRefresh  = true;
TreatRealsInGeneratedCodeAs.Mode = true;
TreatRealsInGeneratedCodeAs.Entries = {'None','Warning','Error'};
TreatRealsInGeneratedCodeAs.Enabled =  enableWidget;
currRow = currRow+1;

spacer.Type = 'text';
spacer.Name = ' ';
spacer.RowSpan = [currRow currRow];
spacer.ColSpan = [1 3];

% Advanced group
grpAdvanced.Type = 'panel'; % make it 'group' if making a sub-group
grpAdvanced.RowSpan = [1 currRow]; %comment out if making a sub-group
grpAdvanced.ColSpan = [1 3]; %comment out if making a sub-group
grpAdvanced.LayoutGrid = [currRow 3];
grpAdvanced.ColStretch = [0 0 1];
grpAdvanced.RowStretch = [zeros(1, currRow) 1];
grpAdvanced.Tag = [tag, 'AdvancedGroup'];

grpAdvanced.Items = {detBlackBoxCollision_lbl, detBlackBoxCollision,...
    TreatRealsInGeneratedCodeAs_lbl, TreatRealsInGeneratedCodeAs, spacer};

advancedTab.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingAdvancedGroup');
advancedTab.Items = {grpAdvanced};

end


% build coding standards choice & customization tables
function codingstyleTab = builtCodingTab( this, hObjCLI, enableWidget ) %#ok<INUSL>

% Widgets on the "Advanced" tab with panel-categorization
VerilogEnabled = strcmpi(hObjCLI.TargetLanguage, 'verilog');

tag = 'ConfigSet_HDLCoder_GlbSettingsPanel_CodingStyle_';
glbl_tag = 'ConfigSet_HDLCoder_GlbSettingsPanel_Advanced_';

%% top-level container for 4 groups
row_start = 0;
currRow = row_start+1;

grpAdvanced.Type = 'panel';
grpAdvanced.RowSpan = [1 1];
grpAdvanced.LayoutGrid = [5 1];
grpAdvanced.RowStretch = [0 0 0 0 1];

grpAdvanced.Tag = [tag, 'CodingStyleGroup'];

startCol = 1; endCol = 6; endCol1 = 0;

%% RTL Annotations / group - 1
%{
e.g. Use `timescale verilog attributes
Inline VHDL configurations
Concat typesafe 0's
emit time stamp,
requirements comment
%}
%

chkUseVerilogTimescaleOP = 'UseVerilogTimescale';
chkUseVerilogTimescale.Type = 'checkbox';
chkUseVerilogTimescale.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingUseVerilogTimescale');
chkUseVerilogTimescale.Tag = [glbl_tag,chkUseVerilogTimescaleOP];
chkUseVerilogTimescale.ObjectProperty = chkUseVerilogTimescaleOP;
chkUseVerilogTimescale.RowSpan = [currRow currRow]-row_start;
chkUseVerilogTimescale.ColSpan = [startCol endCol]+endCol1;
chkUseVerilogTimescale.Source = hObjCLI;
chkUseVerilogTimescale.Enabled = VerilogEnabled & enableWidget;
chkUseVerilogTimescale.DialogRefresh = true;
chkUseVerilogTimescale.Mode = true;
currRow = currRow + 1;

chkTimescaleOP = 'Timescale';
chkTimescale.Type = 'edit';
chkTimescale.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingTimescale');
chkTimescale.Tag = [tag,chkTimescaleOP];
chkTimescale.ObjectProperty = chkTimescaleOP;
chkTimescale.RowSpan = [currRow currRow];
chkTimescale.ColSpan = [1 3];
chkTimescale.Source = hObjCLI;
UseVerilogTimescaleEnabled = strcmpi(hObjCLI.UseVerilogTimescale, 'on');
chkTimescale.Enabled = VerilogEnabled & UseVerilogTimescaleEnabled & enableWidget;
chkTimescale.Mode = true;
currRow = currRow + 1;

chkInlineVHDLOP = 'InlineConfigurations';
chkInlineVHDL.Type = 'checkbox';
chkInlineVHDL.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingInlineConfigurations');
chkInlineVHDL.Tag = [glbl_tag,chkInlineVHDLOP];
chkInlineVHDL.ObjectProperty = chkInlineVHDLOP;
chkInlineVHDL.RowSpan = [currRow currRow]-row_start;
chkInlineVHDL.ColSpan = [startCol endCol]+endCol1;
chkInlineVHDL.Mode = true;
chkInlineVHDL.Source = hObjCLI;
chkInlineVHDL.Enabled = ~VerilogEnabled & enableWidget;
currRow = currRow + 1;

chkConcatenateOP = 'SafeZeroConcat';
chkConcatenate.Type = 'checkbox';
chkConcatenate.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingSafeZeroConcat');
chkConcatenate.Tag = [glbl_tag,chkConcatenateOP];
chkConcatenate.ObjectProperty = chkConcatenateOP;
chkConcatenate.RowSpan = [currRow currRow]-row_start;
chkConcatenate.ColSpan = [startCol endCol]+endCol1;
chkConcatenate.Mode = true;
chkConcatenate.Source = hObjCLI;
chkConcatenate.Enabled = ~VerilogEnabled & enableWidget;
currRow = currRow + 1;

% SignalPortParamNames
DateCommentOP = 'DateComment';
chkDateComment.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingDateComment');
chkDateComment.Tag = [glbl_tag DateCommentOP];
chkDateComment.Type = 'checkbox';
chkDateComment.ObjectProperty = DateCommentOP;
chkDateComment.RowSpan = [currRow currRow]-row_start;
chkDateComment.ColSpan = [startCol endCol]+endCol1;
chkDateComment.Mode = true;
chkDateComment.Source = hObjCLI;
chkDateComment.Enabled = enableWidget;
currRow = currRow + 1;

% Requirements traceability
traccomments.Type = 'checkbox';
traccomments.Name = DAStudio.message('HDLShared:hdldialog:hdlccTraceabilityComments');
traccomments.Tag = ['Tag_ConfigSet_HDLCoder_','RequirementComments'];
traccomments.Source = hObjCLI;
traccomments.ObjectProperty = 'RequirementComments';
traccomments.RowSpan = [currRow currRow]-row_start;
traccomments.ColSpan = [startCol endCol]+endCol1;
traccomments.Mode = true;
slreq = dig.isProductInstalled('Requirements Toolbox');
traccomments.Visible = slreq;
traccomments.Enabled = slreq;

% RTL Annotations
param1_group.Name = DAStudio.message('HDLShared:hdldialog:hdlglblCatRTLAnnotations');
param1_group.Type = 'group';
param1_group.ColSpan = [startCol endCol]+endCol1;
param1_group.RowSpan = [1,1]; %[currRow currRow]-row_start;

numRows = 5;
param1_group.LayoutGrid = [numRows+1 1];
param1_group.RowStretch = [zeros(1, numRows-1) 1];

param1_group.Items = {chkUseVerilogTimescale,...
    chkTimescale,...
    chkInlineVHDL,...
    chkConcatenate,...
    traccomments,...
    chkDateComment,...
    };

%%  RTL Customizations / group - 2
%{
e.g. represent constants by aggregates
Inline MATLAB Function blocks
use pipelined toolbox functions
RAM intialization
RAM Architecture
%}
row_start = currRow;
chkRepConstantValueOP = 'UseAggregatesForConst';
chkRepConstantValue.Type = 'checkbox';
chkRepConstantValue.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingUseAggregatesForConst');
chkRepConstantValue.Tag = [glbl_tag,chkRepConstantValueOP];
chkRepConstantValue.ObjectProperty = chkRepConstantValueOP;
chkRepConstantValue.RowSpan = [currRow currRow]-row_start;
chkRepConstantValue.ColSpan = [startCol endCol]+endCol1;
chkRepConstantValue.Source = hObjCLI;
chkRepConstantValue.Enabled = ~VerilogEnabled & enableWidget;
chkRepConstantValue.Mode = true;
currRow = currRow + 1;

% inline MATLAB function
currRow = currRow+1;
inlineMatlabFunction.Type = 'checkbox';
inlineMatlabFunction.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsInlineMATLABFunctionBlock');
inlineMatlabFunction.Tag = ['Tag_ConfigSet_HDLCoder_','InlineMATLABBlockCode'];
inlineMatlabFunction.Source = hObjCLI;
inlineMatlabFunction.ObjectProperty = 'InlineMATLABBlockCode';
inlineMatlabFunction.RowSpan = [currRow currRow]-row_start;
inlineMatlabFunction.ColSpan = [startCol endCol]+endCol1;
inlineMatlabFunction.Mode = true;
inlineMatlabFunction.Visible = true;
inlineMatlabFunction.Enabled = true;
currRow = currRow+1;

%Initialize RAM blocks
initRam.Type = 'checkbox';
initRam.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsRAMInitialize');
initRam.Tag = ['Tag_ConfigSet_HDLCoder_','InitializeBlockRAM'];
initRam.Source = hObjCLI;
initRam.ObjectProperty = 'InitializeBlockRAM';
initRam.RowSpan = [currRow currRow]-row_start;
initRam.ColSpan = [startCol endCol]+endCol1;
initRam.Mode = true;
initRam.DialogRefresh = true;
initRam.Visible = true;
initRam.Enabled = true;
currRow = currRow+1;

% RAM Architecture
ramArch_lbl.Type = 'text';
ramArch_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlccRAMArchitecture');
ramArch_lbl.RowSpan = [currRow currRow];%-row_start;
ramArch_lbl.ColSpan = [1,1];

ramArch.Type = 'combobox';
ramArch.ObjectProperty = 'RAMArchitecture';
ramArch.Tag = 'Tag_ConfigSet_HDLCoder_ramarchitecture'; %oddity + legacy
ramArch_lbl.Buddy = ramArch.Tag;
ramArch.RowSpan = [currRow currRow];%-row_start;
ramArch.ColSpan = [2,endCol+2];
ramArch.Source = hObjCLI;
ramArch.Mode = true;
ramArch.DialogRefresh = true;
ramArch.Visible = true;
ramArch.Enabled = true;
ramArch.Entries = {DAStudio.message('HDLShared:hdldialog:RamArchClkEnable'),...
    DAStudio.message('HDLShared:hdldialog:RamArchNoClkEnable')};
currRow = currRow+1;

% NoReset Initialization
noresetSim_lbl.Type = 'text';
noresetSim_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlccNoResetInitialization');
noresetSim_lbl.RowSpan = [currRow currRow];%-row_start;
noresetSim_lbl.ColSpan = [1,1];

NoResetInitializationModeOP='NoResetInitializationMode';
noresetSim.Type = 'combobox';
noresetSim.ObjectProperty = NoResetInitializationModeOP;
noresetSim.Tag = [tag NoResetInitializationModeOP];
noresetSim_lbl.Buddy = noresetSim.Tag;
noresetSim.RowSpan = [currRow currRow];%-row_start;
noresetSim.ColSpan = [2,endCol+2];
noresetSim.Source = hObjCLI;
noresetSim.Mode = true;
noresetSim.DialogRefresh = true;
noresetSim.Visible = true;
noresetSim.Enabled = true;
noresetSim.MatlabMethod = 'hdlcoderui.hdlglblsettings.dialogCallback';
noresetSim.MatlabArgs   = { 'noresetsim', hObjCLI, '%dialog', '%tag'};
noresetSim.Entries = {DAStudio.message('HDLShared:hdldialog:NoResetSimModeNone'),...
    DAStudio.message('HDLShared:hdldialog:NoResetSimModeExtScript'),...
    DAStudio.message('HDLShared:hdldialog:NoResetSimModeInsideModule')};

if strcmpi(hObjCLI.NoResetInitializationMode, 'None')
    value = 0;
elseif strcmpi(hObjCLI.NoResetInitializationMode, 'Script')
    value = 1 ;
elseif strcmpi(hObjCLI.NoResetInitializationMode, 'InsideModule')
    value = 2;
else
    value =1;
end

noresetSim.Value = value;

param2_group.Name = DAStudio.message('HDLShared:hdldialog:hdlglblCatRTLCustomizations');
param2_group.Type = 'group';
param2_group.ColSpan = [startCol endCol]+endCol1;
param2_group.RowSpan = [2,2];

numRows = 6;
param2_group.LayoutGrid = [numRows+1, 1];
param2_group.RowStretch = [zeros(1, numRows-1) 1];

% usePipelinedTbxFcn
param2_group.Items = { chkRepConstantValue, inlineMatlabFunction, ...
    initRam, ramArch_lbl, ramArch, ...
    noresetSim_lbl, noresetSim, ...
    };

%spacer2, ...
%% group 3
row_start = currRow;

chkRisingEdgeOP = 'UseRisingEdge';
chkRisingEdge.Type = 'checkbox';
chkRisingEdge.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingUseRisingEdge');
chkRisingEdge.Tag = [glbl_tag,chkRisingEdgeOP];
chkRisingEdge.ObjectProperty = chkRisingEdgeOP;
chkRisingEdge.Source = hObjCLI;
chkRisingEdge.RowSpan = [currRow+1 currRow+1]-row_start;
chkRisingEdge.ColSpan = [startCol, startCol+1];
chkRisingEdge.Enabled = ~VerilogEnabled & enableWidget;
chkRisingEdge.Mode = true;
currRow = currRow + 1;

% Minimize Intermediate Signals
minSignalsOP = 'MinimizeIntermediateSignals';
minSignals.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingMinimizeIntermediateSignals');
minSignals.Type = 'checkbox';
minSignals.ObjectProperty = minSignalsOP;
minSignals.Source = hObjCLI;
minSignals.Tag = [glbl_tag, minSignalsOP];
minSignals.RowSpan = [currRow+1 currRow+1]-row_start;
minSignals.ColSpan = [startCol, startCol+1];
minSignals.Mode = true;
minSignals.Enabled = enableWidget;
currRow = currRow + 1;

% Loop unrolling
chkLoopUnrollingOP = 'LoopUnrolling';
chkLoopUnrolling.Type = 'checkbox';
chkLoopUnrolling.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingLoopUnrolling');
chkLoopUnrolling.Tag = [glbl_tag,chkLoopUnrollingOP];
chkLoopUnrolling.ObjectProperty = chkLoopUnrollingOP;
chkLoopUnrolling.RowSpan = [currRow+1 currRow+1]-row_start;
chkLoopUnrolling.ColSpan = [startCol, startCol+1];
chkLoopUnrolling.Source = hObjCLI;
chkLoopUnrolling.Enabled = enableWidget;
chkLoopUnrolling.Mode = true;
currRow = currRow + 1;

% Mask parameter as Generic
maskGeneric.Type = 'checkbox';
maskGeneric.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsMaskParameterAsGeneric');
maskGeneric.Tag = ['Tag_ConfigSet_HDLCoder_','MaskParameterAsGeneric'];
maskGeneric.Source = hObjCLI;
maskGeneric.ObjectProperty = 'MaskParameterAsGeneric';
maskGeneric.RowSpan = [currRow+1 currRow+1]-row_start;
maskGeneric.ColSpan = [startCol, startCol+1];
maskGeneric.Mode = true;
maskGeneric.Visible = true;
maskGeneric.Enabled = true;
currRow = currRow + 1;

% Obfuscated HDL Code Generation
codeObfuscation.Type = 'checkbox';
codeObfuscation.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingObfuscateGeneratedHDLCode');
codeObfuscation.Tag = ['Tag_ConfigSet_HDLCoder_','ObfuscateGeneratedHDLCode'];
codeObfuscation.Source = hObjCLI;
codeObfuscation.ObjectProperty = 'ObfuscateGeneratedHDLCode';
codeObfuscation.RowSpan = [currRow+1 currRow+1]-row_start;
codeObfuscation.ColSpan = [startCol, startCol+1];
codeObfuscation.Mode = true;
codeObfuscation.Visible = true;
codeObfuscation.Enabled = true;
currRow = currRow + 1;

% Enum Encoding Scheme
enumEncodingScheme_cbOP = 'EnumEncodingScheme';
enumEncodingScheme_lbl.Type = 'text';
enumEncodingScheme_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingsEnumEncodingScheme');
enumEncodingScheme_lbl.RowSpan = [currRow currRow];
enumEncodingScheme_lbl.ColSpan = [startCol, startCol];

enumEncodingScheme_cb.Type = 'combobox';
enumEncodingScheme_cb.ObjectProperty = enumEncodingScheme_cbOP;
enumEncodingScheme_cb.Tag = [tag enumEncodingScheme_cb.ObjectProperty];
enumEncodingScheme_lbl.Buddy = enumEncodingScheme_cb.Tag;
enumEncodingScheme_cb.RowSpan = [currRow currRow];
enumEncodingScheme_cb.ColSpan = [startCol+1, startCol+2];
enumEncodingScheme_cb.Source = hObjCLI;
enumEncodingScheme_cb.Mode = true;
enumEncodingScheme_cb.Visible = true;
enumEncodingScheme_cb.Enabled = enableWidget;
currRow = currRow + 1;


% Enable HDL Network Reuse
subsystemReuse_cbOP = 'SubsystemReuse';
subsystemReuse_lbl.Type = 'text';
subsystemReuse_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingSubsystemReuse');
subsystemReuse_lbl.RowSpan = [currRow currRow];
subsystemReuse_lbl.ColSpan = [startCol, startCol];

subsystemReuse_cb.Type = 'combobox';
subsystemReuse_cb.ObjectProperty = subsystemReuse_cbOP;
subsystemReuse_cb.Tag = [tag subsystemReuse_cb.ObjectProperty];
subsystemReuse_lbl.Buddy = subsystemReuse_cb.Tag;
subsystemReuse_cb.RowSpan = [currRow currRow];
subsystemReuse_cb.ColSpan = [startCol+1 startCol+2];
subsystemReuse_cb.Source = hObjCLI;
subsystemReuse_cb.Mode = true;
subsystemReuse_cb.Visible = true;
subsystemReuse_cb.Enabled = enableWidget;


param3_group.Name = DAStudio.message('HDLShared:hdldialog:hdlglblCatRTLStyle');
param3_group.Type = 'group';

param3_group.ColSpan = [startCol endCol]+endCol1;
param3_group.RowSpan = [3,3];
param3_group.RowStretch = [3,3];

numRows = 7;
param3_group.LayoutGrid = [numRows 1];

param3_group.Items = {chkRisingEdge, minSignals, ...
    chkLoopUnrolling, maskGeneric, enumEncodingScheme_lbl enumEncodingScheme_cb, ...
    subsystemReuse_lbl subsystemReuse_cb, codeObfuscation};

%% group 4--Timing Controller Style
row_start = currRow;

% OptimizeTimingController
optTimingControllerOP = 'OptimizeTimingController';
optTimingController.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingOptimizeTimingController');
optTimingController.Type = 'checkbox';
optTimingController.ObjectProperty = optTimingControllerOP;
optTimingController.Source = hObjCLI;
optTimingController.Tag = [tag optTimingControllerOP];
optTimingController.RowSpan = [currRow currRow] - row_start;
optTimingController.ColSpan = [startCol, startCol];
optTimingController.Mode = true;
optTimingController.Visible = true;
optTimingController.Enabled = enableWidget;
currRow = currRow + 1;

% Timing Controller Arch
timingControllerArch_cbOP = 'TimingControllerArch';
timingControllerArch_lbl.Type = 'text';
timingControllerArch_lbl.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingTimingControllerArch');
timingControllerArch_lbl.RowSpan = [currRow currRow];
timingControllerArch_lbl.ColSpan = [startCol, startCol];

timingControllerArch_cb.Type = 'combobox';
timingControllerArch_cb.ObjectProperty = timingControllerArch_cbOP;
timingControllerArch_cb.Tag = [tag timingControllerArch_cb.ObjectProperty];
timingControllerArch_lbl.Buddy = timingControllerArch_cb.Tag;
timingControllerArch_cb.RowSpan = [currRow currRow];
timingControllerArch_cb.ColSpan = [startCol+1, startCol+1];
timingControllerArch_cb.Source = hObjCLI;
timingControllerArch_cb.Mode = true;
timingControllerArch_cb.Visible = true;
timingControllerArch_cb.Enabled = enableWidget;
timingControllerArch_cb.Entries = {'default', 'resettable'};

numRows = 2;
param4_group.Name = DAStudio.message('HDLShared:hdldialog:hdlglblCatTimingController');
param4_group.Type = 'group';
param4_group.ColSpan = [startCol endCol]+endCol1;
param4_group.RowSpan = [4,4];
param4_group.RowStretch = [zeros(1, numRows-1) 1];

param4_group.LayoutGrid = [numRows 1];
param4_group.Items = { optTimingController, timingControllerArch_lbl, timingControllerArch_cb };

%% group 5--File Comment Customization
row_start = currRow;

customFileHeaderOP = 'CustomFileHeaderComment';
customFileHeader.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingCustomFileHeader');
customFileHeader.Type = 'editarea';
customFileHeader.ObjectProperty = customFileHeaderOP;
customFileHeader.Source = hObjCLI;
customFileHeader.Tag = [tag customFileHeaderOP];
customFileHeader.RowSpan = [currRow currRow] - row_start;
customFileHeader.ColSpan = [startCol, startCol];
customFileHeader.Mode = true;
customFileHeader.Visible = true;
customFileHeader.Enabled = true;
currRow = currRow + 1;

customFileFooterOP = 'CustomFileFooterComment';
customFileFooter.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingCustomFileFooter');
customFileFooter.Type = 'editarea';
customFileFooter.ObjectProperty = customFileFooterOP;
customFileFooter.Source = hObjCLI;
customFileFooter.Tag = [tag customFileFooterOP];
customFileFooter.RowSpan = [currRow currRow] - row_start;
customFileFooter.ColSpan = [startCol, startCol];
customFileFooter.Mode = true;
customFileFooter.Visible = true;
customFileFooter.Enabled = true;

param5_group.Name = DAStudio.message('HDLShared:hdldialog:hdlglblCatFileCommentCustomization');
param5_group.Type = 'group';
param5_group.Items = { customFileHeader, customFileFooter };

% collect coding style panels
grpAdvanced.Items = {param1_group, param2_group, param3_group, param4_group param5_group};

codingstyleTab.Name = DAStudio.message('HDLShared:hdldialog:hdlglblsettingCodingStyleGroup');
codingstyleTab.Items = {grpAdvanced};

end

% LocalWords:  Glb codingstd HDLGS Ctlr CSO cso codingstandard hdlcodingstd codingstandards Grp
% LocalWords:  ALTERAFPFUNCTIONS ALTFP XILINXLOGICORE FP Logi floatingpoint ipconfig Algo
% LocalWords:  FULLMULTIPLIER PARTMULTIPLIERPARTADDSHIFT NOMULTIPLIERFULLADDSHIFT grp prts
% LocalWords:  Tabwidgets curr repeat:currRow typesafe hdlglbl intialization ramarchitecture
% LocalWords:  noresetsim Tbx
