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.
Re: How to import Hspice (PC) simulation data to Matlab (PC)

hspice tool box is good
 

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

Hi,

I think some people have the same problem and one way to solve it is to have the revised loadsig.c file from Professor Murmann. Hope someone can upload that here. I found above information at the following webpage.

**broken link removed**
 

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

I could not access to loadsig1.c program that Prof. Mullmann revised. (restricted access to public, since I am not a student). I could access the announcements but no further.

If a kind person who had access provides it here, I will appreciate. Thanks.
 

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 also encounter this problem, how to solve it, could anyone help me?
 

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

somo said:
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 also encounter this problem, how to solve it, could anyone help me?

Shall it related to different version of Hspice ? SInce I have encounter this problem but when I use different version of Hspice, it solved .
 

for the matlab version above 7.1
you should use
'mex loadsig.c -output loadsig.dll'
 

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

although you explained it very clear, but I still have a problem :cry:
I did all the necessary things:
1- mex 'hspicetoolbox path\loadsig.c'
x=loadsig('path to .tr0 file\test.tr0')
the error
error in hs_allocate_sf: unexpected values in block1 header
??? One or more output arguments not assigned during call to "loadsig".

2- I changed my work directory to the place where "loadsig.c" resides and then
typed mex loadsig.c
x=loadsig('path to .tr0 file\test.tr0')
but still the error
error in hs_allocate_sf: unexpected values in block1 header
??? One or more output arguments not assigned during call to "loadsig".

3- As nepuba said I tried mex -output loadsig.dll and then tried again
x=loadsig('path to .tr0 file\test.tr0')
still the error
error in hs_allocate_sf: unexpected values in block1 header
??? One or more output arguments not assigned during call to "loadsig".
:cry:
I have windows XP on my computer and am using MATLAB 7.3 (2006)
:idea: What should I do with the .dll file that MATLAB generates in "hspicetoolbox" folder?????
 

Hi ... I'm having a similar problem when it comes to loading *.sw0 files for DC sweeps. I can successfully load *.tr0 transient analysis files. I run a script that runs

x = loadsig(targetfile)​

And the error I get is

error in hs_determine_variables: block trailer mismatch​

I am running Matlab 7.7 on a Red Hat Linux.

I've compiled using

mex loadsig.c​

and

mex loadsig.c -output loadsig.dll​

So I can figure this out, I'm running a very basic simulation (although I could have it wrong since I'm very new to HSPICE). The listing is as follows:

RESISTOR DC ANALYSIS

Vin 1 0 2v

R1 1 Vout 1k
R2 Vout 0 3k

.DC Vin 0 5 1
.print DC Vin
.options post=1
.end​

If anyone can help me, that would be greatly appreciated.
 

The latest revision of HspiceToolbox (from 29 July 2011) is freely available from the developer here (see "Hspice Toolbox for Matlab and Octave (also for use with Ngspice)" on that page).

I was using at older version of the toolbox, dated 10 March 2004 (got it from Boris Murmann's page at Stanford once...), and I was getting the following error:
error in hs_determine_variables: EOF reading block trailer
With the current version, the error went away.

Notice that it is also compatible with Octave (free alternative to MATLAB). Read the docs inside.
 
Last edited:

I did all the necessary things:
1- mex 'hspicetoolbox path\loadsig.c'
x=loadsig('path to .tr0 file\test.tr0')
the error
error in hs_allocate_sf: unexpected values in block1 header
??? One or more output arguments not assigned during call to "loadsig".

2- I changed my work directory to the place where "loadsig.c" resides and then
typed mex loadsig.c
x=loadsig('path to .tr0 file\test.tr0')
but still the error
error in hs_allocate_sf: unexpected values in block1 header
??? One or more output arguments not assigned during call to "loadsig".

3- As nepuba said I tried mex -output loadsig.dll and then tried again
x=loadsig('path to .tr0 file\test.tr0')
still the error
error in hs_allocate_sf: unexpected values in block1 header
??? One or more output arguments not assigned during call to "loadsig".

I have windows vista on my computer and am using MATLAB 2009

who can tell me how to import hspice data to matlab?
 

Hello All,

I guess the problem you are facing is with your Hspice netlist file.

this toolbox just can read binary files. So your output .tr# or ... should be binary.
Try .Option post=1 or BINARY

Hope it helps.
 

hi all
i have a software for hspice that help u!
this software create net list your simulation and you can open to matlab
if u want this please send email for me

eng.6300@yahoo.com
 

hi.
i have emergency situation.please help me.
how can matlab reads output files generated by Hspice transient, DC,
and AC sweeps?
i have studied the hspice toolbox for matlab but it has error.i can't understand below cammand.instead of ’hspice_output_filename’ which output shoud we replace?'myfile.lis' or 'myfile.sw' or 'myfile.ac'
x = loadsig(’hspice_output_filename’)
it has error like this
x=loadsig('myfile.tr0')
??? Undefined function or method 'loadsig' for input arguments of type 'char'.

>> x= mex loadsig('myfile.tr0')
??? x= mex loadsig('myfile.tr0')
|
Error: Unexpected MATLAB expression.

>> mex loadsig.c

C:\PROGRA~1\MATLAB\R2010A\BIN\MEX.PL: Error: 'loadsig.c' not found.

??? Error using ==> mex at 222
Unable to complete successfully.
is this command (x = loadsig(’hspice_output_filename’)) for binary output?
somewhere i read that itis command is for unix?please say me what is the Difference between window or unix matlab installation?and is there any Difference between unix command and windows command?

i want to use ".lin" command in hspice rf .i need the output that report s parameter and noise parameter. which command should i use to read the hspice rf output(s parameter ,...) by matlab???
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top