• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Launching spectre from Matlab Error

Stats

  • Locked Locked
  • Replies 2
  • Subscribers 124
  • Views 13950
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Launching spectre from Matlab Error

wgtkan
wgtkan over 5 years ago

Hello,

This issue is similar to this post located here:https://community.cadence.com/cadence_technology_forums/f/custom-ic-design/40093/matlab-cds_srr-dc-sweep-of-mosfet-parametersI am trying to call spectre simulator from Matlab to do a dc-sweep by providing a configuration file such as the path, and the model files. 

To test script I ran the following script:

learvars;
close all;

% Load configuration
c = techsweep_config_psp_120_spectre% Write simulation parameters

fid=fopen('techsweep_params.scs', 'w');
fprintf(fid,'parameters length = %d\n', c.LENGTH(1));
fprintf(fid,'parameters sb = %d\n', c.VSB(1));
fclose(fid);

%Run simulator
system(c.simcmd);
[status,result] = system(c.simcmd);
if(status)
disp('Simulation did not run properly. Check techsweep.out.')
return;
end

% Echo simulator output variables
cds_srr(c.outfile, c.sweep)
cds_srr(c.outfile, c.sweep_noise)
idx1 = round(length(c.VGS)/2);
idx2 = round(length(c.VDS)/2);
s = sprintf('VGS = %d, VDS = %d', c.VGS(idx1), c.VDS(idx2));
disp(s)

% Initialize
for m = 1:length(c.outvars)
nch.(c.outvars{m}) = 0;
pch.(c.outvars{m}) = 0;
end

% Read and display raw parameters and created output
% nch
for k = 1:length(c.n)
params_n = c.n{k};
struct_n = cds_srr(c.outfile, c.sweep, params_n{1});
values_n = struct_n.(params_n{2});
s = sprintf('%s = %d', params_n{1}, values_n(idx1, idx2));
disp(s);
for m = 1:length(c.outvars)
nch.(c.outvars{m}) = nch.(c.outvars{m}) + values_n(idx1, idx2)*params_n{3}(m);
end
end
for k = 1:length(c.n_noise)
params_n = c.n_noise{k};
% note: using cds_innersrr since cds_srr is buggy for noise
struct_n = cds_innersrr(c.outfile, c.sweep_noise, params_n{1},0);
field_names = fieldnames(struct_n);
values_n = struct_n.(field_names{4});
s = sprintf('%s = %d', params_n{1}, values_n(idx1, idx2));
disp(s);
nch.(c.outvars_noise{k}) = values_n(idx1, idx2);
end
disp(nch);

% pch
for k = 1:length(c.p)
params_p = c.p{k};
struct_p = cds_srr(c.outfile, c.sweep, params_p{1});
values_p = struct_p.(params_p{2});
s = sprintf('%s = %d', params_p{1}, values_p(idx1, idx2));
disp(s);
for m = 1:length(c.outvars)
pch.(c.outvars{m}) = pch.(c.outvars{m}) + values_p(idx1, idx2)*params_p{3}(m);
end
end
for k = 1:length(c.p_noise)
params_p = c.p_noise{k};
% note: using cds_innersrr since cds_srr is buggy for noise
struct_p = cds_innersrr(c.outfile, c.sweep_noise, params_p{1},0);
field_names = fieldnames(struct_p);
values_p = struct_p.(field_names{4});
s = sprintf('%s = %d', params_p{1}, values_p(idx1, idx2));
disp(s);
pch.(c.outvars_noise{k}) = values_p(idx1, idx2);
end
disp(pch);

The loaded file, tc = techsweep_config_psp_120_spectre, has a line that goes like this,

c.simcmd = 'set path=($path /apps/cds/ic618/tools/bin); /apps/cds/spectre181/tools/bin/spectre techsweep.scs >! techsweep.out';

which is calling the spectre simulator and  I am getting the following error:

I am using IC6.1.8-64b.500.1 and spectre sub-version 18.1.0.235.isr3 and Matlab2018B.

What am I doing wrong? 

Thank you so much in advance. 

  • Cancel
Parents
  • wgtkan
    wgtkan over 5 years ago

    Hello,

    Never mind. I have figured it out. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • wgtkan
    wgtkan over 5 years ago

    Hello,

    Never mind. I have figured it out. 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • zaratustra
    zaratustra over 5 years ago in reply to wgtkan

    Hi,

    How about posting the solution or removing the post? Leaving the post without an answer isn't helpful at all.

    Regards

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information