The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl
Simulators >> Circuit Simulators >> Running parametric sims using Ocean
https://designers-guide.org/forum/YaBB.pl?num=1275509213

Message started by gsradhak on Jun 2nd, 2010, 1:06pm

Title: Running parametric sims using Ocean
Post by gsradhak on Jun 2nd, 2010, 1:06pm

Hi all,

I have a set of design variables in my schematic. I would like to input multiple data vectors to my schematic and save the output data in Ocean

For example, If P is a set of parameters P={p1,p2,p3,p4} (p1-p4 are the design variables in the schematic). I would create a matrix of data values with different instances of P ie my data matrix would look like

Q=[-------P1---------

    --------P2---------

   ---------P3--------]

and so on where each Pi contain (p1i, p2i,p3i,p4i). (In other words I want to use the analogus of paramset command in Spectre for ocean). I would like to simulate my circuit for these values in Q and make some measurements using Calculator function and finally store the output data in the text file. Can somebody please go through the steps in accomplishing the same?



Thanks,



Guru

Title: Re: Running parametric sims using Ocean
Post by pancho_hideboo on Jun 25th, 2010, 10:53pm

--- Method-1
Quote:
declare( p1[3] )
declare( p2[3] )
declare( p3[3] )
declare( p4[3] )

; Design Parameter's Values for P1 sets
p1[0] = 1
p2[0] = 2
p3[0] = 3
p4[0] = 4

; Design Parameter's Values for P2 sets
p1[1] = 10
p2[1] = 20
p3[1] = 30
p4[1] = 40

; Design Parameter's Values for P3 sets
p1[2] = 100
p2[2] = 200
p3[2] = 300
p4[2] = 400

base_dir = "xxxxx"

for( i, 0, 2
  desVar( "p1", p1[i] )
  desVar( "p2", p2[i] )
  desVar( "p3", p3[i] )
  desVar( "p4", p4[i] )

  resultsDir( sprintf(nil, "%s/P%d", base_dir, i+1) )

  run()
)


--- Method-2
Quote:
; Design Parameter's Values for Q sets
p1_list = list(1, 10, 100)
p2_list = list(2, 20, 200)
p3_list = list(3, 30, 300)
p4_list = list(4, 40, 400)

base_dir = "xxxxx"

n = length(p1_list)
for( i, 0, n-1
 desVar( "p1", nth(i, p1_list) )
 desVar( "p2", nth(i, p2_list) )
 desVar( "p3", nth(i, p3_list) )
 desVar( "p4", nth(i, p4_list) )

 resultsDir( sprintf(nil, "%s/P%d", base_dir, i+1) )

 run()
)


--- Method-3
Quote:
; Design Parameter's Values for Q sets
Q = list(
         (  1,   2,   3,   4),    ; Design Parameter's Values for P1 sets
         ( 10,  20,  30,  40),    ; Design Parameter's Values for P2 sets
         (100, 200, 300, 400)     ; Design Parameter's Values for P3 sets
   )

base_dir = "xxxxx"

i = 0
foreach( Pi, Q
  ++i
  desVar( "p1", nth(0, Pi) )
  desVar( "p2", nth(1, Pi) )
  desVar( "p3", nth(2, Pi) )
  desVar( "p4", nth(3, Pi) )

  resultsDir( sprintf(nil, "%s/P%d", base_dir, i) )

  run()
)


The Designer's Guide Community Forum » Powered by YaBB 2.2.2!
YaBB © 2000-2008. All Rights Reserved.