Search code examples
bashshelltclcadence

Extra character after close-quote


I am running the below command in MATLAB. This code is basically launching cadence xcelium simulator in gui mode using the command nclaunch. nclaunch opens the xterm and from there it should launch xcelium simulator but befor that I am getting the error.

tclcmds = {  'exec xmvhdl -64bit osc_filter.vhd simple_osc.vhd osc_top.vhd',...
             'exec xmelab -64bit -access +wc osc_top',...
             ['hdlsimmatlab -gui osc_top -64bit ', ...
              ' -input "{@matlabcp :u_osc_filter -mfunc oscfilter}"',...
              ' -input "{@force clk_enable {"1"} -after 0ns}"',...
              ' -input "{@force reset {"0"} -after 0ns {"1"} -after 40ns {"0"} -after 120ns}"',...
              ' -input "{@force clk {"1"} -after 0ns {"0"} -after 40ns -repeat 80ns}"',...
              ' -input "{@simvision  {set w \[waveform new\]}}"',...
              ' -input "{@simvision  {waveform add -using \$w -signals :clk_enable}}"',...
              ' -input "{@simvision  {waveform add -using \$w -signals :clk}}"',...
              ' -input "{@simvision  {waveform add -using \$w -signals :reset}}"',...
              ' -input "{@simvision  {waveform add -using \$w -signals signed(:osc_out)}}"',...
              ' -input "{@simvision  {waveform add -using \$w -signals signed(:filter8x_out)}}"',...
              ' -input "{@simvision  {waveform format -using \$w signed(:osc_out) -trace analogSampleAndHold}}"',...
              ' -input "{@simvision  {waveform format -using \$w signed(:filter8x_out) -trace analogSampleAndHold}}"',...
              ' -input "{@simvision  {waveform axis range -min -50000 -max 50000 -using \$w signed(:osc_out)}}"',...
              ' -input "{@simvision  {waveform axis range -min -1.5e6 -max 1.5e6 -using \$w signed(:filter8x_out)}}"',...  
              ' -input "{@database -open waves -into waves.shm -default}"',...
              ' -input "{@probe -create -shm :clk_enable :clk :reset :osc_out :filter8x_out}"',...
              ' -input "{@run 10000ns}"'
             ]};
nclaunch('tclstart',tclcmds);


After running above command I am getting following error extra characters after close-quote

I am not sure about this error.


Solution

  • It looks like the double quotes in these strings are not interpreted the way you expect:

    ' -input "{@force clk_enable {"1"} -after 0ns}"',...
    ' -input "{@force reset {"0"} -after 0ns {"1"} -after 40ns {"0"} -after 120ns}"',...
    ' -input "{@force clk {"1"} -after 0ns {"0"} -after 40ns -repeat 80ns}"',...
    

    Fore example the first string probably gets interpreted as following parts:

    • -input
    • " - open-quote
    • {@force clk_enable { - a string in quotes
    • " - close-quote
    • 1"} -after 0ns}" - extra characters after close-quote

    I would suggest trying to: