No text string defined issue

edited November 2009 in KLayout Support
Hi Matthias

Recently we got a OASIS file and tried to open it with klayout, however the following error messages appeared:

No text string defined for id 0(must be declared before text is used)
(position=4112, cell=$130)

We tried other EDA tools(CalibreDrv or QuickView) to open this file, and passed without any special message, now I have no idea what's wrong with it

According to the source code of dbOASISReader.cc, the error would show with the condition "if (tid == m_textstrings.end ())", does it mean there is a text item in this OASIS file and this item didn't contain any text string? if yes, how could we fix or avoid this error ?

Really thanks for your kindly support.

--
chhung

Comments

  • edited November 2009

    Hi Chung,

    Your file is probably correct - that is a weakness of the OASIS reader.
    Basically the problem is that text strings can be associated with integer ID's which save bytes in the OASIS stream.

    The OASIS specification permits ID's being associated with strings after the ID's are used. Usually however, the strings are known for a given ID because the string to ID association happens in the file before the text objects are specified. KLayout relies on this fact altough there is no guarantee by the OASIS specification. In your case this assumption seems not to be valid. Frankly, I have not heard of such a case before.

    I'll try to fix that in the next release. However right now, there is no easy workaround. If you are not interested in text objects, you could replace these lines in dbOASISReader.cc (around line 1490):

    if (tid == m_textstrings.end ()) {
      error (tl::sprintf (tl::translate ("No text string defined for id %ld (must be declared before text is used)").c_str (), id));
    }
    mm_text_string = tid->second;
    

    by:

    if (tid != m_textstrings.end ()) {
      mm_text_string = tid->second;
    }
    

    You should then disable reading of texts in the reader options because the text strings will not be valid.

    Matthias

  • edited November 2009
    Hi Matthias

    We tried to modify the code of dbOASISReader.cc to avoid the "No text string" error, and another issue appeared:

    Modal variable accessed before being defined: text-string (position=4125,cell=$130)

    We found the error printing statement in the dbOASIS.h file, and edit the code from:

    if (mp_diag) {
    mp_diag->error (tl::translate ("Modal variable accessed before being defined: ") + m_name);
    } else {
    tl_assert (false);
    }

    to:

    if (! mp_diag) {
    tl_assert (false);
    }

    Finally we were able to open this OASIS file, however all the text items disappeared and only could be found as a null string text item.

    --
    chhung
  • edited November 2009

    Hi Chhung (really with two 'h'?),

    I fixed the problem and provided a new release 0.18.2 (see download page).
    This version should fix your problem without the need of patching anything.

    Best regards,

    Matthias

  • edited 11:31PM
    Hi Matthias

    I compiled the new release v0.18.2 and it really fixed the text reading issue, thank you so much~ (Y)

    The chhung means a Chinese name (Chi-Hsian-Hung) from Taiwan. :)

    Best Regards,
Sign In or Register to comment.