function tclCmds = viterbi_tclcmds_modelsim(loadCmd)
% viterbi_tclcmds_modelsim returns the tcl commands to run in ModelSim for
% the Viterbi example. 
% TCLCMDS = viterbi_tclcmds_modelsim(LOADCMD) returns the tcl command that 
% compiles the HDL files and loads the cosimulation library into ModelSim 
% using command LOADCMD.

%   Copyright 2011 The MathWorks, Inc.

% Folder that contains the HDL files
srcDir   = 'viterbi_hdlsrc';

% ModelSim doesn't recognize '\' on Windows Platform.
srcDir = strrep(srcDir,'\','/');

% VHDL source files
srcFiles = {...
    'viterbi_block_pkg.vhd',... '
    'ACS0.vhd',...
    'ACS1.vhd',...
    'Butterfly0.vhd',...
    'ACS0_block.vhd',...
    'ACS1_block.vhd',...
    'Butterfly1.vhd',...
    'Double_Butterfly1.vhd',...
    'ACS0_block1.vhd',...
    'ACS1_block1.vhd',...
    'Butterfly0_block.vhd',...
    'ACS0_block2.vhd',...
    'ACS1_block2.vhd',...
    'Butterfly1_block.vhd',...
    'Double_Butterfly10.vhd',...
    'ACS0_block3.vhd',...
    'ACS1_block3.vhd',...
    'Butterfly0_block1.vhd',...
    'ACS0_block4.vhd',...
    'ACS1_block4.vhd',...
    'Butterfly1_block1.vhd',...
    'Double_Butterfly11.vhd',...
    'ACS0_block5.vhd',...
    'ACS1_block5.vhd',...
    'Butterfly0_block2.vhd',...
    'ACS0_block6.vhd',...
    'ACS1_block6.vhd',...
    'Butterfly1_block2.vhd',...
    'Double_Butterfly12.vhd',...
    'ACS0_block7.vhd',...
    'ACS1_block7.vhd',...
    'Butterfly0_block3.vhd',...
    'ACS0_block8.vhd',...
    'ACS1_block8.vhd',...
    'Butterfly1_block3.vhd',...
    'Double_Butterfly13.vhd',...
    'ACS0_block9.vhd',...
    'ACS1_block9.vhd',...
    'Butterfly0_block4.vhd',...
    'ACS0_block10.vhd',...
    'ACS1_block10.vhd',...
    'Butterfly1_block4.vhd',...
    'Double_Butterfly14.vhd',...
    'ACS0_block11.vhd',...
    'ACS1_block11.vhd',...
    'Butterfly0_block5.vhd',...
    'ACS0_block12.vhd',...
    'ACS1_block12.vhd',...
    'Butterfly1_block5.vhd',...
    'Double_Butterfly15.vhd',...
    'ACS0_block13.vhd',...
    'ACS1_block13.vhd',...
    'Butterfly0_block6.vhd',...
    'ACS0_block14.vhd',...
    'ACS1_block14.vhd',...
    'Butterfly1_block6.vhd',...
    'Double_Butterfly16.vhd',...
    'ACS0_block15.vhd',...
    'ACS1_block15.vhd',...
    'Butterfly0_block7.vhd',...
    'ACS0_block16.vhd',...
    'ACS1_block16.vhd',...
    'Butterfly1_block7.vhd',...
    'Double_Butterfly2.vhd',...
    'ACS0_block17.vhd',...
    'ACS1_block17.vhd',...
    'Butterfly0_block8.vhd',...
    'ACS0_block18.vhd',...
    'ACS1_block18.vhd',...
    'Butterfly1_block8.vhd',...
    'Double_Butterfly3.vhd',...
    'ACS0_block19.vhd',...
    'ACS1_block19.vhd',...
    'Butterfly0_block9.vhd',...
    'ACS0_block20.vhd',...
    'ACS1_block20.vhd',...
    'Butterfly1_block9.vhd',...
    'Double_Butterfly4.vhd',...
    'ACS0_block21.vhd',...
    'ACS1_block21.vhd',...
    'Butterfly0_block10.vhd',...
    'ACS0_block22.vhd',...
    'ACS1_block22.vhd',...
    'Butterfly1_block10.vhd',...
    'Double_Butterfly5.vhd',...
    'ACS0_block23.vhd',...
    'ACS1_block23.vhd',...
    'Butterfly0_block11.vhd',...
    'ACS0_block24.vhd',...
    'ACS1_block24.vhd',...
    'Butterfly1_block11.vhd',...
    'Double_Butterfly6.vhd',...
    'ACS0_block25.vhd',...
    'ACS1_block25.vhd',...
    'Butterfly0_block12.vhd',...
    'ACS0_block26.vhd',...
    'ACS1_block26.vhd',...
    'Butterfly1_block12.vhd',...
    'Double_Butterfly7.vhd',...
    'ACS0_block27.vhd',...
    'ACS1_block27.vhd',...
    'Butterfly0_block13.vhd',...
    'ACS0_block28.vhd',...
    'ACS1_block28.vhd',...
    'Butterfly1_block13.vhd',...
    'Double_Butterfly8.vhd',...
    'ACS0_block29.vhd',...
    'ACS1_block29.vhd',...
    'Butterfly0_block14.vhd',...
    'ACS0_block30.vhd',...
    'ACS1_block30.vhd',...
    'Butterfly1_block14.vhd',...
    'Double_Butterfly9.vhd',...
    'ACS.vhd',...
    'Renormalize.vhd',...
    'Reorder.vhd',...
    'Reorder1.vhd',...
    'ACS_Unit.vhd',...
    'BMC_Unit.vhd',...
    'Traceback1.vhd',...
    'Traceback10.vhd',...
    'Traceback11.vhd',...
    'Traceback12.vhd',...
    'Traceback13.vhd',...
    'Traceback14.vhd',...
    'Traceback15.vhd',...
    'Traceback16.vhd',...
    'Traceback17.vhd',...
    'Traceback18.vhd',...
    'Traceback19.vhd',...
    'Traceback2.vhd',...
    'Traceback20.vhd',...
    'Traceback21.vhd',...
    'Traceback22.vhd',...
    'Traceback23.vhd',...
    'Traceback24.vhd',...
    'Traceback25.vhd',...
    'Traceback26.vhd',...
    'Traceback27.vhd',...
    'Traceback28.vhd',...
    'Traceback29.vhd',...
    'Traceback3.vhd',...
    'Traceback30.vhd',...
    'Traceback31.vhd',...
    'Traceback32.vhd',...
    'Traceback4.vhd',...
    'Traceback5.vhd',...
    'Traceback6.vhd',...
    'Traceback7.vhd',...
    'Traceback8.vhd',...
    'Traceback9.vhd',...
    'Traceback.vhd',...
    'viterbi_block.vhd'};

% Use vcom command to compile VHDL files
compile_cmds = strcat({'vcom  "'}, {srcDir}, '/', srcFiles,'"');

% Concatenate all tcl commands together
tclCmds = [{'vlib work'},...
            compile_cmds,...
            [loadCmd '  viterbi_block'],...
            'puts "Ready for cosimulation ..."'];
