I'd like to find some dynamic lib files(.so format) required to run .mexa64 format file.
6 次查看(过去 30 天)
显示 更早的评论
I'm trying to inferface matlab with Cadence Spectre (a type of Spice used for electronic ciricuit simulation). There is a SPECTRE/RF Matlab Toolbox that enables interfacing between MATLAB and Spectre using a bundle of function.
So I copied and pasted that toolbox file into the working directory where my main.m file is located, and ran 'main.m' after adding the path of the toolbox file, got the following error.
as far I understood, it said cds_srr called cds_innersrr and cds_innersrr.mexa64 called the dynamic lib named 'libsrrjni.so' which turned out to be non-existing. so I typed the 'ldd: ./cds_innersrr.mex64' to find out the the list of dynamic library files(.so format) required to run cds_innersrr.mexa64, and the result was the following
it reported that some .so format lib file were not found, which I assumed to be the cause of the original error.
my question is, where can I get those lib files? should I contact the provider of 'SPECTRE/RF Matlab Toolbox' from Cadence?
I left the main.m below in case it is necessary to solve this issue. it requires additional code and Spectre simulator, and SPECTRE/RF Matlab Toolbot in order to be executed. I ran Matlab under Linux environment.
% Matlab script for technology characterization
% Boris Murmann, Stanford University
% Tested with MMSIM12.11.134
% September 12, 2017
clearvars;
close all;
% Load configuration
%c = techsweep_config_psp_65_spectre;
c = techsweep_config_bsim4_28_spectre;
% Write sweep info
nch.INFO = c.modelinfo;
nch.CORNER = c.corner;
nch.TEMP = c.temp;
nch.NFING = c.NFING;
nch.L = c.LENGTH';
nch.W = c.WIDTH;
nch.VGS = c.VGS';
nch.VDS = c.VDS';
nch.VSB = c.VSB';
%
pch.INFO = c.modelinfo;
pch.CORNER = c.corner;
pch.TEMP = c.temp;
pch.NFING = c.NFING;
pch.L = c.LENGTH';
pch.W = c.WIDTH;
pch.VGS = c.VGS';
pch.VDS = c.VDS';
pch.VSB = c.VSB';
% Simulation loop
for i = 1:length(c.LENGTH)
str=sprintf('L = %2.3f', c.LENGTH(i));
disp(str);
for j = 1:length(c.VSB)
% Write simulation parameters
fid=fopen('techsweep_params.scs', 'w');
fprintf(fid,'parameters length = %d\n', c.LENGTH(i));
fprintf(fid,'parameters sb = %d\n', c.VSB(j));
fclose(fid);
pause(5)
% Run simulator
[status,result] = system(c.simcmd);
if(status)
disp('Simulation did not run properly. Check techsweep.out.')
return;
end
% Initialize data blocks
for m = 1:length(c.outvars)
nch.(c.outvars{m})(i,:,:,j) = zeros(length(c.VGS), length(c.VDS));
pch.(c.outvars{m})(i,:,:,j) = zeros(length(c.VGS), length(c.VDS));
end
% Read and store results
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});
params_p = c.p{k};
struct_p = cds_srr(c.outfile, c.sweep, params_p{1});
values_p = struct_p.(params_p{2});
for m = 1:length(c.outvars)
nch.(c.outvars{m})(i,:,:,j) = squeeze(nch.(c.outvars{m})(i,:,:,j)) + values_n*params_n{3}(m);
pch.(c.outvars{m})(i,:,:,j) = squeeze(pch.(c.outvars{m})(i,:,:,j)) + values_p*params_p{3}(m);
end
end
% Noise results
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});
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});
nch.(c.outvars_noise{k})(i,:,:,j) = squeeze(values_n);
pch.(c.outvars_noise{k})(i,:,:,j) = squeeze(values_p);
end
end
end
save(c.savefilen, 'nch');
save(c.savefilep, 'pch');
7 个评论
dpb
2023-2-19
"... this time Matlab crashed, and in the crash log it reported the segmentation error."
That's now probably outside the realm of being a MATLAB-itself Q? but indicative of one of two things (besides the app not doing a real good job of verifying inputs to avoid "going boom in the dark" instead of trapping user errors)
- You passed a wrong set of arguments to the function that caused a nasty behavior failure, or
- The app itself is buggy.
It's quite easy to create seg errors with mex code; a bum pointer (as in NULL) is a sure-fire way to do so. A mex file should be able to catch most user input errors and trap them and return a useful error message to the user, but less-than-expert code developers may either not even try and put the onus on the user to ensure never passes anything but perfect input, or may be incomplete to all possible user errors (not terribly uncommon, and can be difficult to be 100% bullet proof).
I'd venture it may well be time to contact the vendor or their user support group; this now is outside MATLAB itself except for the small population that may have the same toolbox downloaded.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!