• 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. Allegro X Scripting - Skill
  3. Report with List.

Stats

  • Replies 6
  • Subscribers 17
  • Views 10867
  • Members are here 0
More Content

Report with List.

vimaldevlpr
vimaldevlpr over 6 years ago

Hai,

I have two report in that i want generate a new report for equal refdes values i used some codes they were attached below.

procedure( compare()

out=outfile("report.rpt")

in1=infile("report1.rpt")

in2=infile("report2.rpt")

while(gets (str, in1)

if(str != nil then

inList = parseString(str ",")

a=car(inList)

)

)

while(gets (str1, in2)

if(str1 != nil then

inList = parseString(str1 ",")

b=car(inList)

(foreach x a

(foreach y b

if(x == y then

fprintf(out,"\n%L",x)

)

)

)

)

)

close(out)

close(in1)

close(in2)

)

For this it comes error; E-*Error* foreach: second argumentt must be a list

For example

Report1:                       Report2:

abc                                abc

bsd                                bcd

ccc                                 ccc

Result:

abc

ccc

Please anybody knows  share me the skill code i dont know how to do this.

  • Sign in to reply
  • Cancel
Parents
  • eDave
    eDave over 6 years ago

    procedure( vimaldevlpr_compare()
    let((out, in1, in2, str, x, inList)
    out=outfile("report.rpt")
    in1=infile("report1.rpt")
    in2=infile("report2.rpt")
    while(gets(str, in1)
    when(str
    x = car(parseString(str ",\n"))
    inList = cons(x, inList)
    )
    )
    close(in1)
    while(gets(str, in2)
    when(str
    x = car(parseString(str ",\n"))
    foreach(y inList
    when(x == y
    fprintf(out,"\n%L", x)
    )
    )
    )
    )
    close(out)
    close(in2)
    ))

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vimaldevlpr
    vimaldevlpr over 6 years ago in reply to eDave

    Thanks for the reply sir

    I have an another doubt  can you please help me.

    here it check for one list i want to check multiple fiels in different list  i have attached the code

    procedure( vimaldevlpr_compare()
    let((out, in1, in2, str, x, v,  inList, inList1)
    out=outfile("report.rpt")
    in1=infile("report1.rpt")
    in2=infile("report2.rpt")
    while(gets(str, in1)
    when(str
    x = car(parseString(str ",\n"))

    v = cdr(parseString(str ",\n"))
    inList = cons(x, inList)

    inList1 = cons(v, inList)
    )
    )
    close(in1)
    while(gets(str, in2)
    when(str
    x = car(parseString(str ",\n"))

    v = cdr(parseString(str ",\n"))
    foreach(y inList

    foreach(m inList1
    if(x == y && v ==m then

    print("True")

    else
    fprintf(out,"\n%L,%s", x, "False")

    )
    )
    )
    )
    )
    close(out)

    For example"

    Report 1:                                                                                               Report 2:

    Ref des                   Symname                                           Ref des                      Sym name

    abc                           123                                                       abc                              123

    bcd                           444                                                        bcd                              555

    ddd                           555                                                        ddd                             666

    Result:

    Ref des                  Symname

    bcd                          False

    ddd                          False

    As like this methods i have to do  can please guide me how to do.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • B Bruekers
    B Bruekers over 6 years ago in reply to vimaldevlpr

    I would personally use a hash table for this. With this you can store a refdes vs symname. The check with report 2 is then also esier:

    procedure( vimaldevlpr_compare()
        let( (out, in1, in2, str, x, v,  data)
        out=outfile("report.rpt")
        in1=infile("report1.rpt")
        in2=infile("report2.rpt")
        data = makeTable("data")
        while(gets(str, in1)
            when(str
                x = car(parseString(str ",\n"))
                v = cdr(parseString(str ",\n"))
                data[x] = v
            )
        )
        close(in1)
        while(gets(str, in2)
            when(str
                x = car(parseString(str ",\n"))
                v = cdr(parseString(str ",\n"))
                if(data[x]
                then
                    ;refdes present, check for correct sym name
                    if(data[x] == v
                    then
                        print("True")
                    else
                        fprintf(out,"\n%L,%s: %s - %s", x, "False", data[x], v)
                    )
                else
                    ;refdes unknown
                    fprintf(out,"\n%L,%s", x, "Unknown")
                )
            )
        )
        close(out)
    )
    )

    Bram

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vimaldevlpr
    vimaldevlpr over 6 years ago in reply to B Bruekers

    Thank you For your reply Bram

    It comes for me E- *Error*fprintf/sprintf: format spec: incompatible with data- "Format is "\n%L,%s: %s - %s', argument #3 is (\"\\\"RESC1608X58NA\\\"\")"

    please say how to clear this

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • vimaldevlpr
    vimaldevlpr over 6 years ago in reply to B Bruekers

    Thank you For your reply Bram

    It comes for me E- *Error*fprintf/sprintf: format spec: incompatible with data- "Format is "\n%L,%s: %s - %s', argument #3 is (\"\\\"RESC1608X58NA\\\"\")"

    please say how to clear this

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
  • B Bruekers
    B Bruekers over 6 years ago in reply to vimaldevlpr

    An example report file would be handy to have.

    The issue that i see is that cdr() returns a list, printing a list with %s does not work.

    Change the lines with cdr() to this:

    v = cadr(parseString(str ",\n"))

    This will return the 2nd element of the parsed string, hopefully that is the field which you are looking for.

    If the report is more complex then it is better to use a regular expression to extract the information you need.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vimaldevlpr
    vimaldevlpr over 6 years ago in reply to B Bruekers

    Thanks a lot..

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Cadence Guidelines

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