How can I search for text?

edited January 2017 in KLayout Support

I have text labels in my layout used for LVS and want to find one throughout the hierarchy. I try to use "Search and Replace" for that. As an exampe I want to find a label with clk in it:

Object => text
In.. All cells
Layer (empty)
Text ~ clk
Operation == (empty)
Size == (empty)

I have never found any search result. I tried all kinds of options and combinations but I have never been able to find any text string, even if using wild cards.
I must be doing something wrong or I don't understand how to use this find function. I know I have text labels and I know on what layers they are (and on which hierarchy level). Is this function perhaps broken?

If I press "find" it takes less than a fraction of a second and nothing happens.

The custom query shows this:
texts from cells * where shape.text_string ~ "clk"


  • edited 10:17PM

    Small addition. The same problem with instances (or shapes). I'm not sure how any result should be displayed (a popup like a result browser perhaps?). If I negate the search (!~) I don't get any response either. So it feels like something is broken.
    Tried on 0.23.8 and 0.24.8.

  • edited 10:17PM

    Hi Theo,

    before we dig deeper: if your label contains "clk", the expression needs to be

    texts from cells * where shape.text_string ~ "*clk*"

    The "~" match operator is anchored by default and it's not a regular expression, it's a "glob pattern" similar to what the shell uses for matching file names.

    Does it work this way?

    If not, we have a different problem here. I'm not aware of a broken feature here. At least it seems to work in my case (0.24.10 on W7 and Ubuntu 16.10). I cannot rule out issues and if there really is one I'd like to debug it.



  • edited 10:17PM
    I tried:

    texts from cells * where shape.text_string ~ "*clk*"

    and nothing happened.

    Sometimes if I use "Current Cell and Below" I see a lot of cpu usage and a progress bar (Running Query processing) that stays there for about a minute. After that ends I get nothing.
    I run from CentOS 7.3
  • edited 10:17PM
    Removed my ~/.klayout/klayoutrc file and it works again.
    Now I get a field inside the search window with the results. It's exactly as I hoped for.

    I send the file to Mathhias with a testcase to debug.
  • edited 10:17PM
    Matthias found it....
    The search window should contain a result field on the right side of the window. This field was minimized. To get it back you need to hover over a small bar on the right of the search window and drag it all the way to the left. Sounds simple (and it is, once you know.....)
Sign In or Register to comment.