This seems like a bug. I tried using the example in the /tools/spectre/examples/MDL_workshop/MDL_workshop.tar.gz - in the "optimize" directory. I adapted it as follows: // mvarpwr.mdl // (C) 2008 Cadence Design Systems, Inc. // // This example is to find optimal values of design parameters // by running a multi-parameter, multi-goal search function // // alias measurement definition alias measurement trans { // definition of transient analysis with autostop turned on run tran( stop=1u, autostop='yes ) // computation of risetime for signal V(out) from 10% to 90% export real rise=risetime(sig=V(out), initval=0.5, \ finalval=3.0) //computation of falltime for signal V(out) from 90% to 10% export real fall=falltime(sig=V(out), initval=3.0, \ finalval=0.5) export real max_pwr = max(abs(i0.mn0:pwr)) } // Print results to a specified file beginning with "to=" keyword print fmt ("\n****Intermediate Results of Optimization Searching****\n\n") to="mvar.print" // continue to print in user-format with "addto=" keyword print fmt ("%-15s%-15s%-15s%-15s%-15s\n", "pw","nw","rise","fall","max_pwr") addto="mvar.print" // workaround - uncomment this and then the power gets properly measured in the subsequent // mvarsearch (seems like a bug) //run trans // definition of a mvarsearch function mvarsearch { // definition of multiple optimization goals option { //method='lm accuracy = 1e-3 // convergence tolerance of trans deltax = 1e-3 // step length maxiter = 100 // limit to 100 iterations } // definition of multiple parameters to be optimized parameter { {pw, 2u, 0.05u, 10u} //init_val, lower_val, upper_value {nw, 2u, 0.05u, 10u} //init_val, lower_val, upper_value } // execution of the measurement alias exec { print fmt("%-15e%-15e", pw, nw) addto="mvar.print" run trans print fmt("%-15e%-15e%-15e\n", trans->rise,trans->fall,trans->max_pwr) \ addto="mvar.print" } // definition of goal values to be minimized zero { tmp1 = trans->rise-25p tmp2 = trans->fall-25p // uncomment to add this power goal (doesn't work with this alone as the power is always 0) // tmp3 = trans->max_pwr-0.5m } } If I run this: spectremdl -design invs.scs -batch mvarpwr.mdl then I get the max_pwr reported as 0 in each simulation and in the summary. Uncommenting the line in the zero section doesn't help - it then finds a different solution but given that the goal is not working, it's not right. I found a workaround by adding a "run trans" (see the comment about a workaround above). Then it works properly and you see the max_pwr appearing in each individual run and in in the resulting optimisation. I filed a change request (CCR) 2578561 for this. I suggest that you contact customer support and ask for a duplicate to be filed so that it can be associated with a real customer rather than just appearing as an internal request. Let me know if the workaround works for you too (assuming you're seeing the same problem). I tried with the latest SPECTRE20.1 and 21.1 versions. Andrew
↧