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.

opening a data file using an ocean script

Status
Not open for further replies.

mialee

Newbie level 6
Newbie level 6
Joined
Apr 6, 2009
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Lima
Activity points
1,364
ocean script

hi!
I'm doing an ocean script of a two stage opamp with dimensions as variables,and an octave script to obtein those dimensions (using a "design flow").The octave script prints its outputs(dimensions of each transistor and value of the miller capacitor) in an output file (octave_out),these values are going to be used in the ocean script (for simulations in order to verify if i aproach the specs).

My question is,what do i need to write in the ocean script to open the octave_out and read it?

I tried using load("octave_out.ocn") but i had an error,besides i dont know what i have to do to relate the values of octave_out (values:w1,w2,w3....w8,Cc) with the Ws of the transistors of the netlist,I mean,i know that i want it to replace those values in the places where i put w1,w2....w8,Cc (variables) in the netlist but i dont know if the ocean script is going to take it in that way,maybe i need something that link these variables with those values.

I hope you guys can help me :S
 

ocean script reference

you can use the "infile" and "fscanf" commands as follows:

Your octave_out file contains"
"w1" 1u
"w2" 2u
...

Your ocean script:
fid = infile("octave_out");
fscanf( fid "%s %d" a b );
desVar(a b);
close(fid);
 

    mialee

    Points: 2
    Helpful Answer Positive Rating
ocean script example

thanks for replying,sorry but i dont know what you mean with a and b,
 

ocean scripting opening

a and b are just two variables used to read the input data file.
 

ocean script

sorry again,i realized that,i tried what you recommended and it didn't work,could you tell me please how fscanf works? I have an ocean manual (ocean reference) but it's not clear,it shows an example for a file with just a line,i don't know if fscanf reads line by line,the whole file,or...i don't get it.
i try to read each line of octave_out and replace each value of w1...w8 and Cc and Rc for the variables in the netlist using a for

fid=infile("octave_out")
analysis('ac ?start "1m" ?stop "5G")
temp(27)
for(i 1 10
fscanf(fid "%s %f" a b)
desVar("a" b)
)
close(fid)
run()
PM = phaseMargin(VF("/net7"))
GBW = gainBwProd(VF("/net7"))
dc_gain=value(dB20(VF("/net7")) 0)

Maybe the for is not necessary,It's really important for me to know how to do this.I hope you can help me (or somebody else).
 

variables in ocean script

It works for me...

... I just realized that in the octave_data file you should have:

w1 1e-6
w2 2e-6
...

and not as I said in my previous post:
"w1" 1u
"w2" 2u
...

Moreover, you need to set the path to your netlist using the command:
design( <YOUR NETLIST PATH> )

So, here is the script.

----------------------------------------------
simulator( 'spectre )
design( "~/TEST/netlist")

analysis('ac ?start "1m" ?stop "5G")

fid=infile("octave_out")
for(i 1 10
fscanf(fid "%s %f" a b)
desVar(a b)
)
close(fid)

resultDir("~/TEST/")
run()

selectResults( 'ac)
PM = phaseMargin(VF("/net7"))
GBW = gainBwProd(VF("/net7"))
dc_gain=value(dB20(VF("/net7")) 0)

----------------------------------------------

I haven't tried the bottom 3 lines but you need to select what results you want to read!

I hope this helps!
 
specifying path for ocean scripts

hey! thanks a lot!

it really works,i don't know why it didn't before :s (maybe i was too tired)
It was just a little part of an ocean script that I'm doing.I hope you don't mind that I keep doing this kind of questions.

Thanks again :D
 

script ocean

Hi again! i'm doing some scripts in ocean and octave,

the data (dimensions of transistors) is calculated,then is written in an output file (octave_output) and read for my ocean script,i want to do all this automatically,i mean, when octave_output is written in some way my ocean script (which has the analysis and the outputs that i want it to print in an ocean output file) has to "know" that the data is ready to be read and run the simulations.

I hope someone can help me with this.
 

fscanf next line ocean

Key in both the script commands in a simple file .. say something like this ...

<Script one> <arguements for script1>
<Script Two> <arguements for script2>

save the file and source it !!! if you want u can key in some print statements(use print or echo) in ur scripts which flags the error whenever the file is not created...

:D
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top