• 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. linereadstring() function problem

Stats

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

linereadstring() function problem

tyanata
tyanata over 14 years ago

 Hello,

I have such problem in my SKILL code. In one of the routines of it I create list of strings. And after that read them one by one and transform to symbols with the linereadstring()  function.

 

I have such a proble for example:

llinereadstring("x") 

returns  ->(x)

 

llinereadstring("X") 

returns  ->(X)

 

llinereadstring("9") 

returns  ->(9)

 

llinereadstring("X9") 

returns  ->(X9)

 

llinereadstring("9X") 

returns  ->

SYNTAX ERROR found at line 1 column 2 of file *string*
*Error* lineread/read: syntax error encountered in input

 

My question is how can I overcome this problem if some of the strings in the list is starting with digit and ends with letter as "9X" in the example above.

 

Best regards,

 

tyanata

 

 

 

 

 

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    tyanata,

    linereadstring() is really intended for parsing things that look like SKILL, and "9X" doesn't...

    So if it's a list of whitespace separated strings you want, you could use parseString() to convert to a list, and concat or stringToSymbol to convert them to symbols. For example:

    str="X9"
    mapcar('concat parseString(str))

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tyanata
    tyanata over 14 years ago

     Thanks for the response,

    The solution which you provided works but now new problem appears. I create togglefield (hiCreateToggleField) application form using this list of symbols. But when try to enable or disable symbol which is analog to string "9x" again the same problem appears.

                                      ^
    SYNTAX ERROR found at line 1 column 35 of file *string*
    *Error* lineread/read: syntax error encountered in input

    Why I need this functionality. Because in my script some of the project libraries have to be skipped from processing. So the user to be able to choose which of the libraries to be skipped using GUI. And the problem is that most of libraries in the projects are called with names like 901243ABC .

     

    Can you propose how to solve the problem with the togglefield.

    Best regards,

     

    tyanata

     

     

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

    Tyanata,

    I can't see why you would need to have symbols the same as your library names to do this. I can't guess what your problem is without seeing the code (or something representative of it), so unfortunately it's hard for me to assist without some clue as to what the code is doing.

    Can you post the code so that I (or anyone else) can see what the problem is?

    Best Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tyanata
    tyanata over 14 years ago

     Hello Andrew,

     

    Here I post routine similar to the original  routine in my script. In this routine you can select which from the available in the certain project libraries to be included in the output procedure: DIG, IO, ANA and 90123AATOP in the example. In this example the output procedure is just printing: printf("List of libraries to be skipped:%s\n" xxx).

    To execute the routine start the function:  Choose_skip_lib()

    You can see that you can select and unselect each library except  90123AATO. If you select or unselect it error message appear:

     SYNTAX ERROR found at line 1 column 38 of file *string*
    *Error* lineread/read: syntax error encountered in input


    procedure( Choose_skip_lib()

    ;       Description
    ;       Available project libraries: DIG, IO, ANA and 90123AATOP

            lib_list = list("DIG" "IO" "ANA" "90123AATOP")


            lib_list_length = length(lib_list)
            count_mem_list = 0
            l_libs=list()

            while( count_mem_list != lib_list_length

                    lib_member = car(lib_list)
                    lib_list = cdr(lib_list)

                    lib_member_symbol=list(stringToSymbol(lib_member))
                    l_libs=append1(l_libs lib_member_symbol)

                    count_mem_list++
            ) ;; close while

            l_fields_skip = list()

            l_TField1_skip = list( hiCreateToggleField(
            ?name 'TField1_skip
            ?prompt ""
            ?choices l_libs
            ?itemsPerRow 2
            ?value '(nil nil nil nil)
            ;?numSelect 6
            ?callback list("" "" "" "")
            ) 10:10 30:20 0)
            l_fields_skip=append1(l_fields_skip l_TField1_skip)


            hiCreateAppForm(                ;create Form
            ?name 'SkipLibForm
            ?formTitle "Choose lybraries to be skipped"
            ?fields l_fields_skip
            ?buttonLayout  'OKCancel
            ?buttonDisabled '(Defaults Apply Help)

    ;        ?initialSize '(560 630)
    ;        ?initialSize t
            ?minSize '(300 120)
            ?callback '( "CCSskip_lib_app_formApplyCB(l_libs)")
            )

            hiSetFormPosition(  (xCoord(hiGetMaxScreenCoords())/2)-560/2 :
                                                    (yCoord(hiGetMaxScreenCoords())/2)-200  )

            hiDisplayForm(SkipLibForm)

    )


    procedure( CCSskip_lib_app_formApplyCB(SkipLibForm_lib_name)
       let( ()

        SkipLibForm_lib_op = SkipLibForm->TField1_skip->value
        SkipLibForm_lib_name_length = length(SkipLibForm_lib_name)
        count_mem_lib_name_list = 0
        temp_lib_str_list=list()
        while( count_mem_lib_name_list != SkipLibForm_lib_name_length

                t_key = car(SkipLibForm_lib_name)
                SkipLibForm_lib_name=cdr(SkipLibForm_lib_name)
                t_val = car(SkipLibForm_lib_op)
                SkipLibForm_lib_op = cdr(SkipLibForm_lib_op)
                t_key_i = car(t_key)
                if( t_val==t then
                temp_lib_str_list=append1(temp_lib_str_list t_key_i)
            )
            count_mem_lib_name_list++
            ) ;; close while
       
       
        skip_lib_final_string = buildString(temp_lib_str_list)
        printf("List of libraries to be skipped:%s\n" skip_lib_final_string)
       
       ) ;let
    ) ;procedure
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 14 years ago

    I modified the code - and added some comments - to show how to do this. The problem was that if you simply used the toggle field symbols as prompts, it expects the symbols to be legal names, which they aren't. This is easy to resolve - I also removed some of the less efficient parts of the code (see comments).

    Regards,

    Andrew

    procedure( Choose_skip_lib()

    let((lib_list l_libs l_fields_skip l_TField1_skip)
    ; Description
    ; Available project libraries: DIG, IO, ANA and 90123AATOP

    lib_list = list("DIG" "IO" "ANA" "90123AATOP")


    /*
    ; rather inefficient way of converting a list of strings to a list
    ; of symbols
    lib_list_length = length(lib_list)
    count_mem_list = 0
    l_libs=list()

    while( count_mem_list != lib_list_length

    lib_member = car(lib_list)
    lib_list = cdr(lib_list)

    lib_member_symbol=list(stringToSymbol(lib_member))
    l_libs=append1(l_libs lib_member_symbol)

    count_mem_list++
    ) ;; close while
    */

    ; Convert list of libraries to a list of symbols and strings. The symbol begins with
    ; tog_ so it has a legal name, and the second entry in the list is the prompt
    l_libs=foreach(mapcar libName lib_list
    list(concat('tog_ libName) libName)
    )

    l_fields_skip = list()

    l_TField1_skip = list( hiCreateToggleField(
    ?name 'TField1_skip
    ?prompt ""
    ?choices l_libs
    ?itemsPerRow 2
    ?value '(nil nil nil nil)
    ;?numSelect 6
    ?callback list("" "" "" "")
    ) 10:10 30:20 0)
    l_fields_skip=append1(l_fields_skip l_TField1_skip)


    hiCreateAppForm( ;create Form
    ?name 'SkipLibForm
    ?formTitle "Choose lybraries to be skipped"
    ?fields l_fields_skip
    ?buttonLayout 'OKCancel
    ?buttonDisabled '(Defaults Apply Help)

    ; ?initialSize '(560 630)
    ; ?initialSize t
    ?minSize '(300 120)
    ?callback 'CCSskip_lib_app_formApplyCB
    )

    ;----------------------------------------------------------------
    ; Record the list of libraries on the form (avoids a global variable)
    ;----------------------------------------------------------------
    SkipLibForm->lib_list=lib_list

    hiSetFormPosition( (xCoord(hiGetMaxScreenCoords())/2)-560/2 :
    (yCoord(hiGetMaxScreenCoords())/2)-200 )

    hiDisplayForm(SkipLibForm)

    )
    )


    procedure( CCSskip_lib_app_formApplyCB(form)
    let( (temp_lib_str_list skip_lib_final_string)

    ;--------------------------------------------------------------------
    ; Use setof with two lists - the first list is the names of the library
    ; to filter, whereas the second is the list of toggle values.
    ;--------------------------------------------------------------------
    temp_lib_str_list=setof((libName togField) form->lib_list form->TField1_skip->value togField)
    /*
    ; inefficient way of finding out the library names
    ;
    SkipLibForm_lib_op = SkipLibForm->TField1_skip->value
    SkipLibForm_lib_name_length = length(SkipLibForm_lib_name)
    count_mem_lib_name_list = 0
    temp_lib_str_list=list()
    while( count_mem_lib_name_list != SkipLibForm_lib_name_length

    t_key = car(SkipLibForm_lib_name)
    SkipLibForm_lib_name=cdr(SkipLibForm_lib_name)
    t_val = car(SkipLibForm_lib_op)
    SkipLibForm_lib_op = cdr(SkipLibForm_lib_op)
    t_key_i = car(t_key)
    if( t_val==t then
    temp_lib_str_list=append1(temp_lib_str_list t_key_i)
    )
    count_mem_lib_name_list++
    ) ;; close while
    */


    skip_lib_final_string = buildString(temp_lib_str_list)
    printf("List of libraries to be skipped:%s\n" skip_lib_final_string)

    ) ;let
    ) ;procedure

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • tyanata
    tyanata over 14 years ago

     Thanks,

    The proposed solution works perfectly!

    Best regards,

     

    tyanata

     

     

     

    • 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