Before we take on serious scripts which can run dozens or even hundreds of simulations automatically, let's start small with below script. Please save it as "helloWorld.ocn" in your home directory "~/".
1 2 3 4 5 6 7 | ; This is a comment line. ; The comment starts from character ";" and ends at the end of the line. ; Output file definition. out = outfile("~/helloWorld.txt" "w") fprintf(out, "Hello World\n") close(out) |
I think the code is fairly self-explanatory and you may find that it would do nothing except creating a file in your home directory "~/" named "helloWorld.txt" whose content is just a string of "Hello World".
The next step is to run just created script to see if it does as intended. To do this, go to the Command Interpreter Window (CIW), it's the very first window shows up once you launch Cadence design tool. Then, type in a run command of
load "~/helloWorld.ocn"
and hit "Enter".
Command Interpreter Windows and the console for Ocean Script run command.Modified from source. |
More to come.
PS: File access ability is quite important in OCEAN script. This is due to the fact that, for each simulation, we would usually calculate specifications of the evaluated circuit and print them into a text file for the record, instead of to plot all the resulted curves of each specification.
Assessment based on text data is just much easier, that's all.