As most of you probably know, dbOpenCellViewByType() has a mode known as scratch mode. In this mode, the cellview opened cannot be saved to disk. However, I have some question regarding this mode. First of all, what is the master and context cellview related to the "sc" and "sd" mode? In what kind of situation should I use one of these two modes?
I would also like to know the
proper way of working in this scratch view mode. Should I create a new view
in scratch mode and copy over the object one by one before I start
doing the modification I need? This seems to be quite troublesome IC61x with
all the new blockages, vias and other OA objects listed under different
property of cellviews.
I tried opening an existing, opened
cellview in scratch mode, hoping it will return a new copy i.e. with new
dbID that exists only in memory, but somehow it shares the same
cellview ID as the original opened cellview. I also tried to use
dbCopyCellView() but it won't let me copy to the scratch view unless I
specify the overwrite flag, which will write the scratch view to disk,
defeating the purpose of having one in the first place.
Lawrence mention scratch mode is handled differently in IC61x and IC51, can someone please explain the differences? Thanks in advance for any feedback.
A few points, which will hopefully clear things up:
First of all, a cellView can only be opened once in memory at a time - there's only ever a single cellView ID. So that means it's always in a single mode - if you open a view first in "a", then separately in "r", it will still actually be in "a" mode (for example).
Scratch mode was not initially supported in OpenAccess versions, but this was added to enable compatibility with previous code (it was added in an IC612 Hotfix, so it's been there in all IC613 and IC614 versions). It was also there in CDB.
There are some differences in the way things worth between CDB and OA. In CDB you could not modify the data in a cellView opened in "r" mode; if you wanted to make changes, you needed to open it in "w" (overwrite), "a" (append/edit) or "s" (scratch) mode. Scratch mode means that you cannot save the results, however. In OA, you can actually modify readonly cellViews, but again, you cannot save the results. So strictly (I believe), "s" mode isn't really any different from "r" mode (I've not really checked in OA-enabled versions).
Note that cellViews opened in scratch mode must exist on disk - although they might be empty. Currently there's no way to open a scratch cellView in memory only (although the edits themselves are only in memry).
Now about "context" cellViews (referred to in the "sd" and "wd" and "ad" open modes. These are not really used any more - they were in older software versions. So I wouldn't worry about those modes - I've never had to use them.
The "wc" and "ac" modes are to do with creating database representations alongside (say) textual views. So for example, if you have a Verilog textual view (e.g. a "functional" view, you'll see there's an "OA" representation alongside it). This is a non-master database - and needs to be opened in this "c" mode.
For scratch cellViews, it's almost certainly not important to know about the "sc" mode.
So the best way is if you want to go into "s" mode, you can do so, and then use dbRefreshCellView() and dbReopen(cv "r") once done. Or dbPurge() to purge from memory.
In reply to Andrew Beckett:
Thanks for taking the time to respond with such a detailed explanation, I learned a lot from your response.
I do notice I can now change stuff even though the cellview is in read only mode in IC61. I'm thinking I can skip scratch cellview altogether, make the changes I want directly in an opened, read only cellview, stream out from virtual memory in IC614, then do a dbRefreshCellView() to discard the edit. I hope that works.
yeah, I also needed this information,..thanks ..this is such a big help...I am just new with it and still exploring it..