• 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 SKILL
  3. The code statements that not in procedure can not be saved...

Stats

  • Locked Locked
  • Replies 6
  • Subscribers 143
  • Views 2689
  • 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

The code statements that not in procedure can not be saved to context file when build context file

Yush
Yush 7 months ago

The code statements that not in procedure can not be saved to context file when build context file using the following codes:

procedure(makeContext(cxt cxtPath sourceCodePath)
let(((newPath strcat(sourceCodePath "/" cxt))
(oldPath getSkillPath())
(fileName strcat(cxtPath "/" cxt ".cxt"))
(oldStatus status(writeProtect))
);end local var
printf("Building context for %s\n" cxt)
setSkillPath(newPath)
sstatus(writeProtect t)
setContext(cxt)
loadi(strcat(sourceCodePath "/" cxt "/" cxt ".il"))
saveContext(fileName)
callInitProc(cxt)
setSkillPath(oldPath)
unless(sstatus(writeProtect nil)
nil
);end unless
t);end let
);end proc

procedure(buildContext(cxt cxtPath sourceCodePath)
progn(
deleteFile(strcat(cxtPath "/" cxt ".cxt"))
cond(
(isDir(cxt sourceCodePath)
makeContext(cxt cxtPath sourceCodePath)
)
(t
printf("Can't find context directory %s\n" cxt)
)
);end cond
);end progn
);end proc

;;code

  • Cancel
  • Andrew Beckett
    Andrew Beckett 7 months ago

    Can you give an example? Your question is not very clear.

    Andrew 

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Yush
    Yush 7 months ago in reply to Andrew Beckett

    such as: insert pulldown menu to layout window

    procedure(skAddMenu(arg)
    let(()
    ...
    )
    )
    ;;the following codes are not working after loading context file
    ;;guess the code statements are not saved to context file when builded
    foreach(view list("maskLayout" "maskLayoutXL")
    deRegUserTriggers(view nil nil 'skAddMenu)
    )

    another case is hiSetBindkey()
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Yush
    Yush 7 months ago in reply to Andrew Beckett

    hi Andrew, is my reply description not clear enough?

    Yush

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett 7 months ago in reply to Yush

    Yush,

    It's clear. I just haven't had a chance to do the relevant experiments and give you a solution (I've had the day job taking up my time).

    I hope to get to this soon.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett 7 months ago in reply to Andrew Beckett

    Yush,

    This is expected and is documented behaviour.

    You have two choices here:

    1. Put the relevant code (the foreach loop calling deRegUserTriggers) inside a function definition, and then call defInitProc to define the function to be called when the context is loaded. You then need to use callInitProc(contextName) after the loadContext().
    2. Use loadTopContextForms() to load the code when you are building the context. This produces a different kind of context file which is (in essence) similar to loading the code and so can contain top-level calls such as you have them.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Yush
    Yush 7 months ago in reply to Andrew Beckett

    Andrew,

    Thanks for reply.

    I had tried the first choice before, the codes still not working(maybe i forgot). I' ll try again and try the second method. 

    Yush

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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