I wrote a set of scripts to make Cadence IC tools & Subversion work together.

Note: this is not actual Cadence/Subversion integration (which is much more powerful and highly recommended). 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 lockify.

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). 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.