I wrote a set of scripts to make Cadence IC tools & Subversion work together. This requires subversion 1.4 or higher. Red Hat Enterprise Linux 4 by default ships with 1.3.

See also Pictorial Introduction to Using Cadence/Subversion for detailed tutorial on usage. This post is mostly about the guts of the scripts.

Note: this is not professional/enterprise Cadence/Subversion integration (which is much more powerful and highly recommended). My solution works well for personal or small team scenarios, where the users are patient and willing to put up with some debugging. There were a few problems that I had to solve:

Pesky .svn directories

The main problem is that Subversion puts .svn housekeeping directories everywhere. When I’d copy a cell, these directories would come along. This baggage caused subversion to get really confused. It would think that the new cell was a check-out of the old cell (not a copy with ancestry). It was clear that something needed to be done to prevent these copies. So, I created a copy hook to remove .svn directories from cadence copy commands; this is contained in svnCopyTrigger.il. This solution isn’t complete–namely, when the analog design
environment (ADE) saves a simulation state, it seems to completely
obliterate the directory (including the .svn sub-directory) and re-save
the state information. What I’ve found that works is:

  1. remove the pre-existing ADE state directory (either in ./.artist_state or as cell-view)
  2. re-save the new state using ADE
  3. tar up the saved state
  4. svn up to restore the .svn directory
  5. untar the saved state (over-writing the state information but not the .svn directory)

I have automated steps 3,4,5 in a script called fixtilde .

Locking

For a while, I went without locking. This worked well until someone else was working on the same design (as soon as it went to layout). My layout contractor would edit (for LVS) the same cell I was working out without me knowing (and vice versa). We’d each get stuck when we tried to check-in. So, it was clear that we needed a locking mechanism. This is where subversion (and not many other version control systems) shines: it has a very unobtrusive locking mechanism. By setting the correct properties, files will be dumped out with read-only UNIX permissions. By giving an svn lock command, subversion will mark the file locked in the repository (thus allowing no one else to lock it) and make it writable in your working copy.

The only difficulty with this system is that it works on files only. There is no recursive lock command. So, I wrote a python script to recurse down directories and lock all files. I also wrote a script (lockify) to recursively put permissions (svn:lock-required) on all files in a directory so that subversion “requires” them to be locked before editing.

Note that locks can be bypassed by chmod‘ing a directory. This is useful since you may want to try an edit that you don’t intend to check back in while someone else has it locked. The locking mechanism gives users a default way to avoid stepping on each others toes without paralyzing them.

Eventually, I found myself locking from the command-line so often, that I created Cadence procedures to do it (svnLockCell.il and svnLockCellView.il) and associated schematic/layout/symbol menu picks (in the menus directory).

Adding

One final note is that subversion won’t place files/directories under version control unless you ask it to (svn add). I found it tedious to go to the command line and do an svn add for new items all the time. In addition, there are certain things you don’t want added (.cdslck files). So, I wrote procedures (svnAddCell.il, svnAddCellView.il) and associated menus to to perform these tasks. The addCell and addCellView procedure also puts the correct subversion properties on files to require locking. You can use the unlockify command (from a UNIX shell) to remove these properties.

Usage

Untar the cdsvn2.tar file in your Cadence start directory (wherever you type icfb, icms, etc.). The tar file contains a svn.cdsinit file which needs to be loaded in your .cdsinit:

In addition, it contains a cdsLibMgr.il file which sets up menu picks from the Library Manager. Finally, it contains a menus/ directory that has menu additions (Subversion>Lock View) for schematic, layout, and symbol editing windows.

The files

This tar file

cdsvn2

contains all the cadence skill (.il) files, menu definitions (/menus), and command-line utilities (/bin). I am releasing it under the GPL. Note that this package comes with no warranty that it will work as intended. If you lose any data, money, or anything else because you chose to download it and run it, that’s your fault.

Update 2008-09-03

Added “Usage” section and added cdsLibMgr.il to TAR file.

Update 2008-09-04

Added some more missing files to CDSVN.tar: svn.env, example.cdsinit, svn.cdsinit, cadence_ignores.txt

Also, attributed a couple other people for this comp.cad.cadence post: Problem with Copying cells

svnCopyTrigger.il