Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to import Hspice (PC) simulation data to Matlab (PC)?

Status
Not open for further replies.

edajason

Member level 3
Joined
Nov 5, 2004
Messages
60
Helped
6
Reputation
12
Reaction score
5
Trophy points
1,288
Activity points
441
I intended to generate the data file from Hspice and plot the figure in matlab. In unix, we know the matlabe can load the hspice data. How to do it in PC version.

Thanks
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

Have figured it out. Anyone interested, do a google search. and download necessary matlabe file.
 
Re: How to import Hspice (PC) simulation data to Matlab (PC)

Hi Edajason,

Can you share the detail information on how you go about importing HSpice output files into MATLAB. I need this information to plot INL/DNL/SFDR etc in ADC Design.

Thanks in advance
-snoop835-
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

you can use the hspice matlab tools
 

hi fun.zhao,
how do i add the HspiceToolbox,
i follow the document,but it doesn't work.
thanks in advance.
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

You have to compile the load command, just read the instruction. As long as you can load the data in matlab window, you will be fine.


huangjw said:
hi fun.zhao,
how do i add the HspiceToolbox,
i follow the document,but it doesn't work.
thanks in advance.

Added after 5 minutes:

The file link is here,
h**p://www-mtl.mit.edu/researchgroups/perrottgroup/tools.html#hspice

Follow the instruction, compile the command loadsig; and then you can load the data:
x=loadsig('eye.tr0'); %Load the hspice output file eye.tr0 into matlab variable x
lssig(x) % List the variables in the x datastructure
y=evalsig(x,'v_3'); % Assign the hspice variable v_3 to matlab

Now you can plot whatever you want.
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

You may need to use .print command to print out the variables. Then use text editor to manuplate the date for Matlab
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

use vmware an port
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

edajason said:
You have to compile the load command, just read the instruction. As long as you can load the data in matlab window, you will be fine.


huangjw said:
hi fun.zhao,
how do i add the HspiceToolbox,
i follow the document,but it doesn't work.
thanks in advance.

Added after 5 minutes:

The file link is here,
h**p://www-mtl.mit.edu/researchgroups/perrottgroup/tools.html#hspice

Follow the instruction, compile the command loadsig; and then you can load the data:
x=loadsig('eye.tr0'); %Load the hspice output file eye.tr0 into matlab variable x
lssig(x) % List the variables in the x datastructure
y=evalsig(x,'v_3'); % Assign the hspice variable v_3 to matlab

Now you can plot whatever you want.
*********************************************************
Hspice Toolbox for Matlab
written by Michael Perrott (https://www-mtl.mit.edu/~perrott)
while at Silicon Laboratories (https://www.silabs.com)
Copyright (C) 1999 by Silicon Laboratories, Inc.
This software is distributed under the terms of
the GNU Public License (see the COPYING file
for more details), and comes with no warranty or support
*********************************************************

error in hs_allocate_sf: unexpected values in block1 header
??? One or more output arguments not assigned during call to 'loadsig'.

I have a error.I see loadsig is a loadsig.C.
Do I want to have a C++?
Or just use matlab.
Thanks.
 

you must add ".options post=1" in your spice file.
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

yen said:
edajason said:
You have to compile the load command, just read the instruction. As long as you can load the data in matlab window, you will be fine.


huangjw said:
hi fun.zhao,
how do i add the HspiceToolbox,
i follow the document,but it doesn't work.
thanks in advance.

Added after 5 minutes:

The file link is here,
h**p://www-mtl.mit.edu/researchgroups/perrottgroup/tools.html#hspice

Follow the instruction, compile the command loadsig; and then you can load the data:
x=loadsig('eye.tr0'); %Load the hspice output file eye.tr0 into matlab variable x
lssig(x) % List the variables in the x datastructure
y=evalsig(x,'v_3'); % Assign the hspice variable v_3 to matlab

Now you can plot whatever you want.
*********************************************************
Hspice Toolbox for Matlab
written by Michael Perrott (h**p://www-mtl.mit.edu/~perrott)
while at Silicon Laboratories (h**p://www.silabs.com)
Copyright (C) 1999 by Silicon Laboratories, Inc.
This software is distributed under the terms of
the GNU Public License (see the COPYING file
for more details), and comes with no warranty or support
*********************************************************

error in hs_allocate_sf: unexpected values in block1 header
??? One or more output arguments not assigned during call to 'loadsig'.

I have a error.I see loadsig is a loadsig.C.
Do I want to have a C++?
Or just use matlab.
Thanks.

In command window,type mex loadsig.c then choose 1.
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

edajason said:
You have to compile the load command, just read the instruction. As long as you can load the data in matlab window, you will be fine.


huangjw said:
hi fun.zhao,
how do i add the HspiceToolbox,
i follow the document,but it doesn't work.
thanks in advance.

Added after 5 minutes:

The file link is here,
h**p://www-mtl.mit.edu/researchgroups/perrottgroup/tools.html#hspice

Follow the instruction, compile the command loadsig; and then you can load the data:
x=loadsig('eye.tr0'); %Load the hspice output file eye.tr0 into matlab variable x
lssig(x) % List the variables in the x datastructure
y=evalsig(x,'v_3'); % Assign the hspice variable v_3 to matlab

Now you can plot whatever you want.
From the paper of HSPICE Toolbox for MATLAB by Michael Perrott, it tell us to add the included files directory to the Matlab path. that is, add a patth to the file startup.m.
where is the startup.m file? It should be made by myself?
 

how do i add the HspiceToolbox,
i follow the document,but it doesn't work.

how to compile the command loadsig;
did anyone can tell me detial about it



>> x = loadsig(’test.tr0’);
??? x = loadsig(’test.tr0’);
|
Error: Missing variable or function.
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

shinnyi said:
how do i add the HspiceToolbox,
i follow the document,but it doesn't work.

how to compile the command loadsig;
did anyone can tell me detial about it



>> x = loadsig(’test.tr0’);
??? x = loadsig(’test.tr0’);
|
Error: Missing variable or function.

In command window of matlab, type 'mex loadsig.c' ,don't include " ' "

Good luck!
 

oh my god!!

why ??
it 'still can't work


>> mex loadsig.c

C:\MATLAB701\BIN\WIN32\MEX.PL: Error: 'loadsig.c' not found.

??? Error using ==> mex
Unable to complete successfully
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

shinnyi said:
oh my ---!!

why ??
it 'still can't work


>> mex loadsig.c

C:\MATLAB701\BIN\WIN32\MEX.PL: Error: 'loadsig.c' not found.

??? Error using ==> mex
Unable to complete successfully

Plz confirm your loadsig.c of location.
 

sorry !anybody can tell me
how to compile the command loadsig;

Added after 6 minutes:

dear shaq

what's wrong
help me please

>> mex loadsig.c
>> x = loadsig(’c:\test.tr0’); %% loads Hspice signals into x
??? x = loadsig(’c:\test.tr0’); %% loads Hspice signals into x
|
Error: Missing variable or function.

Added after 38 minutes:

please help me

how to do this step


All files should work across different computer platforms, though the loadsig mexfile may
need to be recompiled. It is currently compiled for Sun, Redhat Linux, and Windows
2000/Xp machines. To compile the loadsig function for a different platform, go to the
directory containing loadsig.c within Matlab, and then type mex loadsig.c within Matlab.
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

shinnyi said:
sorry !anybody can tell me
how to compile the command loadsig;

Added after 6 minutes:

dear shaq

what's wrong
help me please

>> mex loadsig.c
>> x = loadsig(’c:\test.tr0’); %% loads Hspice signals into x
??? x = loadsig(’c:\test.tr0’); %% loads Hspice signals into x
|
Error: Missing variable or function.

Added after 38 minutes:

please help me

how to do this step


All files should work across different computer platforms, though the loadsig mexfile may
need to be recompiled. It is currently compiled for Sun, Redhat Linux, and Windows
2000/Xp machines. To compile the loadsig function for a different platform, go to the
directory containing loadsig.c within Matlab, and then type mex loadsig.c within Matlab.

For example, my hspicetoolbox locates at C:\hspicetoolbox then you must switch your matlab working directory to C:\hspicetoolbox.

Then type mex loadsig.c , choose 1 to complete the setup.

For example if I want to see the transation result of inverter, I need to type that command as shown below.

x = loadsig(’directory of inv.tr0’);
lssig(x)
plotsig(x,’v_in; v_out’)
 

Can anyone tellme how to plotphase-frequency plot on the matlab?
 

Re: How to import Hspice (PC) simulation data to Matlab (PC)

Hi, guys

I have a problem when I want to see a DC sweep file like "x.sw0".
Sometimes I can use the flie "x.sw0" extracted by Hpsice. Sometimes
I can not and the error message from Matlab is the following. However,
I could see the transient result extracted by Hspice.

1.
One or more output arguments not assigned during call to 'C:\hspicetoolbox_232\HspiceToolbox\loadsig.dll'.
2.
error in 'init_SpiceData': mxCalloc call failed -
not enough memory!!

Wish someone can help me out.

Thanks in advance
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top