• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC Design
  3. Undo history cleared when saving layout

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 124
  • Views 11142
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Undo history cleared when saving layout

RicardoGV1
RicardoGV1 over 3 years ago

I've read some answers that cadence didn't have the option to change that, but those were answered like 7 years ago, is there any solution by now?


UPDATED CODE AFTER RESPONSE:

I made a small modification to when it asks and to the popup cancel function, in case somebody need it.

/* CCScustomUndoSave.il

Group Custom IC, Cadence Design Systems
Language SKILL
Revision No. 1.1
Date Created 02/16/21
Last Modified 02/16/21
Tested in IC618
Lint score 100
Description: CCScustomUndoSave.il: Provides an option to Save/Not Save after the last Undo or revert.
Usage: In CIW, load("CCScustomUndoSave.il")

It sets the following environment variable to enable undo after save.

envSetVal("cdba.undo" "dbUndoAcrossSave" 'boolean t)

Use the U bindkey to undo after save.

*/

envSetVal("cdba.undo" "dbUndoAcrossSave" 'boolean t)

procedure(CCScustomUndoSave()
let((cv)
if(envGetVal("cdba.undo" "dbUndoAcrossSave")
then
cv = geGetEditCellView()
if(cv~>modifiedButNotSaved==nil
then
printf("Running CCScustomUndoSave for undo and save\n")
hiDisplayAppDBox(
?name 'CustomUndoSave
?dboxBanner "Undo after save"
?dboxText "Do you want to save after this last undo? (if not, you'll have to modify again the ly in order to save it)" ;
?dialogType hicWorkingDialog
?buttonLayout 'UserDefined
?buttons list("Undo" "Undo and save" "cancel undo" )
?callback list("hiFormCancel(hiGetCurrentForm())" "dbSave(cv)" "hiRedo()" )
?dialogStyle 'modal
);hiDisplayAppDBox
;hiUndo()
);if
else
hiUndo()
);if
hiUndo()

);let
);procedure

hiSetBindKey("Layout" "<key>U" "CCScustomUndoSave()")

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 3 years ago

    There's a cdsenv var that controls this, which was introduced in IC616. 

    envSetVal("cdba.undo" "dbUndoAcrossSave" 'boolean t)

    For more details, see: Need a way to undo even after the save and purge command in Virtuoso

    Regards,

    Andrew

    • Cancel
    • Vote Up +2 Vote Down
    • Cancel
  • RicardoGV1
    RicardoGV1 over 3 years ago in reply to Andrew Beckett

    Hi Andrew,

    Thanks for your response.

    Actually the env variable worked very well to undo, just the concern that the save button is disabled after using undo.
    there is a workaround  (CCScustomUndoSave.il) about it that ask if you want to save in a separated window, but I need to enable the button.

    Just in case, I've tried to modify the enabled condition on the toolbar manager and accessing the icon properties modifying this code, but no luck.




    procedure(CCSDisableCheckAndSave(args)
    let( (win bannerMenus FileMenu FileMenuItems SaveMenuItem barId )
    win=args->window
    bannerMenus=hiGetBannerMenus(win)
    FileMenu=nth(1 bannerMenus)
    FileMenuItems=hiGetMenuItems(eval(FileMenu))
    SaveMenuItem=nth(8 FileMenuItems)
    hiDisableMenuItem(eval(FileMenu) CheckAndSaveMenuItem win)

    ;; Section to change the Check And Save toolbar action
    ;; Get the toolbar id of the File toolbar
    barId = car(
    setof(menu hiGetWindowToolbars( hiGetSessionWindow(hiGetCurrentWindow()) )
    rexMatchp("^leFileToolbar" symbolToString(menu~>hiToolbarManager));schFileToolbar para schematico
    ) ;setof
    ) ;car

    ;; SKILL function - deFindToolbar has been made available since IC615ISR7.
    ;; Starting IC615ISR7, to get toolbar id of the File toolbar, we can instead call
    ;; barId = deFindToolbar( "File" hiGetSessionWindow( win))

    ;; Delete the default toolbar;checa que sea la correcta, checando que el callback sea el mismo
    if(barId->leFileToolbarSave->hiCallback=="leHiSave()" then
    hiDeleteToolbarItem( barId 'leFileToolbarSave)
    ) ;if

    );let
    );procedure CCSDisableCheckAndSave


    deRegUserTriggers("maskLayout" nil nil 'CCSDisableCheckAndSave)
    deRegUserTriggers("maskLayoutXL" nil nil 'CCSDisableCheckAndSave)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to RicardoGV1

    Unfortunately the issue is that the enabled status of the save icon is updated automatically based on whether the cellView is marked as modified.  Undoing past the last save will initially show the database as modified, but if you undo back to the previous saved state, then the database is considered unmodified (whereas it is really modified with respect to what's on disk).

    Attempts to change the toolbar enabled status will fail because the triggers will immediately update it again. The only way around this would be to create a new toolbar which then wouldn't update - and that's not really a viable option.

    Until CCR 2437856 is fixed, I think the only real workaround is that in the article. I suggest you contact customer support and request a duplicate is filed on your behalf.

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Andrew Beckett

    I did a little further experiment, and in fact this draws me to the conclusion that fixing the toolbar yourself is the wrong solution here. I changed the save icon toolbar (for layout in the case) via the Options->Toolbars:

    and removed the enable condition. OK'd and then quit virtuoso and restarted. 

    After that, the save icon is always enabled, even if the cellView is unmodified.

    The problem is that if you open a cellview, make a change, save, undo that change and then try to save again, it still won't save because the underlying function doing the save (within leHiSave) doesn't do the save because it doesn't think the cellVIew is modified.

    The issue is really that the handling of the modification status isn't quite correct at the moment when using undo past save. That's what needs to be fixed.

    The best workaround is still to use a bindkey as in the article you referred to, as that will call dbSave() to do the same which forces a save whether it's needed or not.

    Note if you make the change to the toolbar above, you can either use the "Reset" button in the bottom left to reset it, or delete the ~/.cadence/dfII/toolbars/byApplication/Layout.overlay file (if that was the toolbar you modified).

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 3 years ago in reply to Andrew Beckett

    I did a little further experiment, and in fact this draws me to the conclusion that fixing the toolbar yourself is the wrong solution here. I changed the save icon toolbar (for layout in the case) via the Options->Toolbars:

    and removed the enable condition. OK'd and then quit virtuoso and restarted. 

    After that, the save icon is always enabled, even if the cellView is unmodified.

    The problem is that if you open a cellview, make a change, save, undo that change and then try to save again, it still won't save because the underlying function doing the save (within leHiSave) doesn't do the save because it doesn't think the cellVIew is modified.

    The issue is really that the handling of the modification status isn't quite correct at the moment when using undo past save. That's what needs to be fixed.

    The best workaround is still to use a bindkey as in the article you referred to, as that will call dbSave() to do the same which forces a save whether it's needed or not.

    Note if you make the change to the toolbar above, you can either use the "Reset" button in the bottom left to reset it, or delete the ~/.cadence/dfII/toolbars/byApplication/Layout.overlay file (if that was the toolbar you modified).

    Regards,

    Andrew

    • Cancel
    • Vote Up +1 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information