FreePDK45:Using P-Cells

From NCSU EDA Wiki
Jump to: navigation, search

Introduction

The Parameterized Cells (P-Cells) in this kit are implemented with the PyCell Plugin for OpenAccess, available from Ciranova. In order to use the P-Cells, you must do the following:

  1. Download and install PyCell Studio from Ciranova at http://www.ciranova.com. The root of this installation directory is generally set in the environment variable CNI_ROOT.
  2. Create a modified setup script for Cadence Virtuoso that includes PyCell studio. See the file $PDK_DIR/ncsu_basekit/cdssetup/icoa_setup.csh (included with the FreePDK distribution) for an example script. This script will need to be modified, in order for it to work on your system.
  3. Ensure that files cnDloPcell.plg and cnPcellProxy.plg have been copied from the $CNI_ROOT/quickstart directory to the oa/data/plugins directory (which should be located at the same level as the main Virtuoso installation directory).

After performing these tasks, the PyCells should behave like standard SKILL P-Cells.

Cadence Warnings

In more recent versions of Virtuoso, you will see the following warning messages when using these P-Cells:

 *WARNING* (DB-220704): The Pcell super master: NCSU_TechLib_FreePDK45/ 
  nmos_vtl/layout is not a SKILL super master. The usage of non-SKILL  
  Pcells in Virtuoso is not a supported feature.

To the best of our knowledge, these warnings do not indicate that the P-Cells are working incorrectly in any way.

What to do if Virtuoso Crashes

If Virtuoso crashes while using these P-Cells, first verify that you have completed all of the steps above. If Virtuoso continues to crash, then you probably need to re-compile the technology library.

Most of the effort in recompiling the kit is involved in setting up your environment and installation to run the gentech.py script. Follow these steps to make the necessary modifications.

  1. Modify the file $PDK_DIR/ncsu_basekit/gentech/sshaft/setup.csh - The first change to make to this file is to change the PDK_DIR environment variable to match your installation path. The second change to to add the setup for Python, which will be used to run the compilaiton script. Note that there is a section of this file labeled "Setup Python 2.4". From this point to the end of the script, the environment is being setup to run Python. It's somewhat confusing, because there are many competing versions of Python on our computer system. You may safely delete all of this and replace it with a setup that works for you (or simply remove it, if you already have Python 2.4 or later in your environment). Note that there is a MUSE_HOME environment variable that is also defined, but this variable is used only in the Python setup and can be safely ignored.
  2. Modify the file $PDK_DIR/ncsu_basekit/gentech/sshaft/src/py/Makefile - The first line of this file defines a variable SCRIPTPATH, which should be set to the path of your Python binary executable file.
  3. Type "make" in this directory - This will copy each file to the ../../bin directory, add the Python path to the first line of each script in this directory, and set it's mode to executable.
  4. Update the Virtuoso/PyCell Setup Script - Next you will need to create a new setup script that adds both Cadence Virtuoso and CiraNova PyCell studio to your environment at the same time. Neither Cadence not CiraNova will show you how to do this. An example script is given in the file $PDK_DIR/ncsu_basekit/cdssetup/icoa_setup.csh. Modify this file, source it, and verify that you can start both virtuoso (e.g. "virtuoso &") and PyCell studio (e.g. "pyros &").
  5. Modify the file $PDK_DIR/ncsu_basekit/gentech/sshaft/lib/py/setup.py - This file contains environment settings for various tools. We will now create the entries for this file to match your new Virtuoso/PyCell setup script. To do that, follow these steps:
    1. Login to a new shell with a clean environment. The commands here assume that you're using a csh-style shell.
    2. Type "printenv > env1"
    3. Source your new Virtuoso/PyCell setup script
    4. Type "printenv > env2"
    5. Source the $PDK_DIR/ncsu_basekit/gentech/sshaft/setup.csh script
    6. Type "envparse.py env1 env2 setup.txt". This will parse the differences between the env1 and env2 files and put the result in the file setup.txt.
    7. Insert the contents of the setup.txt file into the $PDK_DIR/ncsu_basekit/gentech/sshaft/lib/py/setup.py file, as shown below.
...
Env = {
  'cadence':{
(insert contents of setup.txt here, deleting the previous contents)
  },
  'synopsys':{
...

Finally you're ready to run gentech.py. Change to the directory $PDK_DIR/ncsu_basekit/gentech and source the sshaft/setup.csh script (if you haven't already, in the previous step). Then execute the command "gentech.py -log gen.log". The "-log" argument is mandatory. It won't work properly without it.

Assuming that all goes well, you should see the new technology library is compiled. One key way to note success is that the file $PDK_DIR/ncsu_basekit/lib/NCSU_TechLib_FreePDK45/tech.db should exist. Also, the gen.log file should look similar to the following:

Begin gentech.py
Executing: cngenlib -c --techfile /afs/eos.ncsu.edu/lockers/research/ece/wdavis/
users/wdavis/svn/freepdk45/trunk/ncsu_basekit/techfile/cni/Santana.tech pkg:pyce
lls  NCSU_TechLib_FreePDK45 /afs/eos.ncsu.edu/lockers/research/ece/wdavis/users/
wdavis/svn/freepdk45/trunk/ncsu_basekit/lib/NCSU_TechLib_FreePDK45 >& cngenlib.l
og
Creating run/cds/.cdsinit
Creating run/cds/cds.lib
Creating run/cds/lib.defs
Chdir run/cds
Writing command to exe.il: pdkAppendTechfile( ?stepargs list( "../../gen.log" t
5 1 "low"))
Executing: virtuoso -log CDS.log -nograph -replay exe.il
        Begin pdkAppendTechfile
        Loading "/afs/eos.ncsu.edu/lockers/research/ece/wdavis/users/wdavis/svn/
freepdk45/trunk/ncsu_basekit/techfile/FreePDK45.tf" into "/afs/eos.ncsu.edu/lock
ers/research/ece/wdavis/users/wdavis/svn/freepdk45/trunk/ncsu_basekit/lib/NCSU_T
echLib_FreePDK45"...
        Techfile successfully appended.
        Finished pdkAppendTechfile (elapsed time: 0h 0m 1s actual)
Step returned with value None
Chdir ../..
Executing: cp -r /afs/eos.ncsu.edu/lockers/research/ece/wdavis/users/wdavis/svn/
freepdk45/trunk/ncsu_basekit/techfile/customvia/* /afs/eos.ncsu.edu/lockers/rese
arch/ece/wdavis/users/wdavis/svn/freepdk45/trunk/ncsu_basekit/lib/NCSU_TechLib_F
reePDK45
Finished gentech.py (elapsed time: 0h 1m 14s actual)

Debugging the compilation

If something goes wrong, the first place to look is the gen.log file. This file will hopefully show the step where the error occurred and give you the name of the file to examine. If not, then the file will also show you the names of all log files generated during the compilation process. We may ask you to send us some of these files to help debug the problem.

The most common problem that occurs is that CiraNova makes a slight modification to the PyCell API, which requires some small change to the P-Cell code. We can help debug that change, but in order to do it, we will most likely need the contents of the file cngenlib.log.

Also, it would be helpful if you can give us the version numbers of the tools you are using:

  • The Virtuoso version number is printed out at the top of the file CDS.log in your home directory.
  • The PyCell Studio version number can be found in the file $CNI_ROOT/docs/version.txt
  • The OpenAccess version numbers can be printed out with the command oaGetVersion.

Good luck! Please let us know if you have problems! Send e-mail requests to eda_help@ncsu.edu.