Pages

2012-09-29

OCEAN Script - Hello World

OCEAN script is a Cadence's proprietary scripting language for simulation automation. For analog designer, OCEAN script is quite useful for collection of simulation data which can be used to determine circuit's performance with variations in environment or fabrication process. Furthermore, it is also handy when you try to optimize the design's performance by varying a set of design parameters.

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.
Go to your home directory "~/" to check whether file "helloWorld.txt" is created with content of "Hello World" string. If so, congratulations on your first Ocean Script success!

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.

2012-09-15

Migrating to Singapore - Expenses

Recently, I was in contact with few Vietnamese fellows inquiring some details about "living and working in Singapore". The info is fairly common and repetitive so I decided to summary it into this post for future reference.

For all the cases, the most popular question is "Can I survive (with my salary)?"

And the answer is I don't know. However, I can list down typical expenses of a small family, so you can use your math to figure out. Here we go.


  • Accommodation: A 2-bedroom HDB flat will set you back by about SGD1800 to 2500 per month. Price depends on few factors such as location, location, and location ... 
  • Childcare/Pre-school/Kindergarten costs about SGD500 to >1000 per child per month, depends on which center you send your child to.
  • Utility bill - Electricity + Water + Gas is about SGD100 per month.
  • Communications: Mobile phone bill is roughly SGD30 to 50 per month per line. Internet broadband is about SGD30 per month.
  • Commuting fee is about SGD50 per person per month.
  • Other regular expenses - Groceries + Shopping +  ... will further set you back by about SGD1000 per month.

Apart from above long list, we also have to settle other non-regular bills such as dinner outings, healthcare bills, kids' toys , parents' toys (electronic gadgets), wife's impulse purchases etc ...

Phew, such a depressing list you may feel at this point. I'll be updating it so you will have a good view about what it's like in Singabored.

Have your say in the comment part, below.

Until next time. Peace.