• 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. How to quickly find device category?

Stats

  • Locked Locked
  • Replies 13
  • Subscribers 143
  • Views 18724
  • 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

How to quickly find device category?

MedAn
MedAn over 8 years ago

How  can I speed up the search of teh category name for device?

Now I wrote a small script:

ret = nil;
libId = ddGetObj(IndraInitForm->techLibField->value);
catList = ddCatGetLibCats(libId);
foreach(cat catList
   catId = catId = ddCatFindCat(libId cat "r");

   when(catId != nil
      when(ddCatIsObjInCat(cName catId) ret = cat);
   );end when
);end foreach

ret;

But it's take really a lot of time. Maybe somebody can show me another way?

  • Cancel
  • MedAn
    MedAn over 8 years ago
    Maybe somebody show me yours code?
    Really, in my case it's take about 2-3 seconds, but I can't find how to speed-up it.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    How many categories do you have? How many cells in the library? I'm very surprised it's that slow. There's the obvious choice of using something like forall or exists to abort the search once you've found it, but that would only (on average) halve the search time.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MedAn
    MedAn over 8 years ago
    Hi Andrew!

    I have 17 categories:
    length(ddCatGetLibCats(ddGetObj("SG13_dev")))
    17

    and 189 cells:
    length(ddGetObj("SG13_dev")->cells)
    189
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MedAn
    MedAn over 8 years ago

    I would like to clarify.
    I've a simple form where I try to show my devices, it's category and etc.
    And if I try fill category column my form generate about 2-3 seconds, without categories - form generate - immediately.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 8 years ago

    I tried it on my library with 21 categories and 599 cells - and by running the profiler on your code above, running 100 times (in a for loop) it took 5.92 seconds (so that's 0.06 seconds to run once). However, in the profiler, it's spending nearly all of the time in ddCatFindCat.

    I suggest you use ddCatOpen() instead of ddCatFindCat - this is MUCH faster - the run time reduced to 0.28s for 100 runs. ddCatFindCat has some code in there to traverse the category hierarchy to find a sub-category, whereas in this case you're only accessing the top categories, I think.

    I still don't know why yours is so slow though - perhaps you have some hierarchical categories too? Anyway, probably ddCatOpen is the man for the job - otherwise you should contact customer support so that an application engineer can have a look with you.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MedAn
    MedAn over 7 years ago
    Hi Andrew!

    Ok, I will try with ddCatOpen .

    Could you help me with two more questions?

    I want to show some message before I start ipcProcess (Assura DRC check).
    There is my code part:
    rsf = if(createAssRSF(cvId) t nil);

    if(rsf then
    printf("QA code tool start Assura DRC check, pls. wait....\n");
    aRun = startDRCInBatch();

    createAssRSF procedure - create rsf file, if all ok, I try to show my message, and after that start Assura DRC, startDRCInBatch().
    There is part of code for startDRCInBatch() procedure:
    cmd = sprintf(nil "assura %s > %s" rsfFile logFile);
    runId = ipcBeginProcess(cmd)
    ipcWait(runId);
    runRes = ipcReadProcess(runId);

    But message appear only after that, when DRC check will be finished. How to avoid it?

    And second question how to identify end of the text file?
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Call hiFlushCIW() between doing the printf() and before you call ipcWait() to force the CIW output to be flushed and to appear immediately.

    Your second question is a bit vague - end of text file? When? Do you mean if you use infile() to read it and then gets() to read lines from the file? If so, the end of the file is reached when gets() returns nil. If you mean something else, you'll need to be more precise.

    By the way, asking a collection of random unrelated questions in the same thread is against the forum guidelines (the pinned post at the top of each forum) because it makes it much harder for anyone else who is searching for a similar issue to know that a post is relevant to them.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MedAn
    MedAn over 7 years ago

    Hi Andrew!

    I'm understand and sorry. Simple this question is so small to create a separate topic.

    About file. I have text file with saved DRC error markers.
    I try to use gets() == nil, but I don't know why, it's doesn't work for me.

    cont_Pass 1000.000000
    Rule 568 : Cnt_b: Min. Cont sep. = 0.18
    2 2 1 Tue Sep 5 08:42:53 2017
    Cnt_b: Min. Cont sep. = 0.18
    e 1 2
    CN test_$_cont_Pass_$_layout C 1 0 0 1 0 0
    -19045 -6480 -18885 -6480
    -18885 -6360 -19045 -6360
    e 2 2
    CN test_$_cont_Pass_$_layout C 1 0 0 1 0 0
    -18705 -6480 -18545 -6480
    -18545 -6360 -18705 -6360

    in this file for first error I can collect all coordinates till find next error, but in the end I try to check
    while(gets(string inFile)
    some code

    coord = pcreCompile("^(-*\\d+\\s*)*$");
    pcreExecute(coord string);
    cmdRes = pcreSubstitute(coord "\\0");
    if(cmdRes && cmdRes != "" then
    ;;remove \n symbol
    rexMatchp("\\([^\n]*\\)\n\\([^\n]*\\)" cmdRes);
    cmdRes = rexSubstitute("\\1 \\2");
    l_coord = append1(l_coord cmdRes);

    if(gets(nextLine inFile) == nil
    this I want call my procedure to cope markers, but loop simple finished.

    P.S. If need I can create a new topic.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 7 years ago

    Given that you've only shown part of your code, it's hard to see what you're doing. Given that you have a gets() in the while loop - and maybe a second gets reading nextLine later on, it's unclear to me what's going on or what's not working. It's also odd that you're using both pcre and rex functions - looks a little unstructured.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • MedAn
    MedAn over 7 years ago
    Hi Andrew!

    Simple in the beginning I use rex* and later pcre and not change all line in code.
    I found my mistake, thx. u.
    • 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