how to extract pad coordinates and names

Discussion in 'Cadence' started by BtruongCA, Aug 16, 2006.

  1. BtruongCA

    BtruongCA Guest

    Hi,

    I am try to extract the pad coordinates associate with their names such
    as:

    Pad names: Coordinates:(x,y)
    ----------------- -----------------
    VDD (100:200)

    Since the pad label "VDD" is a TEXT layer and placed on the top of the
    pad opening.
    but not attached to it, when quering, we can not see any connectivity
    information from
    VDD to pad. Therefore, I only able to
    extract the pad coordinates in the layout but unable to get pad label
    "VDD"

    The goal here is to get pad coordinates with the associate pad names.

    Thanks,

    Tin
     
    BtruongCA, Aug 16, 2006
    #1
  2. Try this piece of code.

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    cvId = geGetEditCellView()

    listpads = leSearchHierarchy(
    cvId
    cvId~>bBox
    0
    "rectangle"
    list( list( "layer" "==" list( "PAD" "drawing" ) ) )
    )

    foreach( pad listpads

    labelPad = car(dbGetOverlaps( cvId pad~>bBox list( "text" ) 0 ))

    xll=xCoord(lowerLeft(pad~>bBox))
    yll=yCoord(lowerLeft(pad~>bBox))

    printf("%s \t" labelPad~>theLabel )
    printf("%f \t" xll )
    printf("%f \n" yll )

    ) ; end foreach
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


    Hope it helps.

    ;;;;;;;;;;;;;;;;;;;;;;;;
    Kholdoun TORKI

    http://cmp.imag.fr
    ;;;;;;;;;;;;;;;;;;;;;;;;
     
    Kholdoun TORKI, Aug 17, 2006
    #2
  3. BtruongCA

    BtruongCA Guest

    Thanks Kholdoun!

    I will try it.

    Tin

     
    BtruongCA, Aug 18, 2006
    #3
  4. You are right. If we specify a deeper hierarchy for
    the "leSearchHierarchy" fonction, the coordinates will be
    the ones at that hierarchy.

    A workaround would be to run a Diva script promoting the
    "PAD" rectangles to the top, and then run the Skill code
    I sent previously.

    Example :

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (drcExtractRules
    ivIf((switch "drc?") then

    saveDerived(geomOr("PAD") ("PAD" "drawing"))
    )
    )
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


    I'm sure there is a cleaner way to do this.
    If someone could suggest an alternative ?

    ;;;;;;;;;;;;;;;;;;;;;;;;
    Kholdoun TORKI

    http://cmp.imag.fr
    ;;;;;;;;;;;;;;;;;;;;;;;;
     
    Kholdoun TORKI, Aug 18, 2006
    #4
  5. The attached skill file will take information from a form and search
    layout to a pre-defined depth. The form produced will list labels to
    co-ordinates found.

    The hierarchy default value is 20.

    Kevin

    ;look4pads_form_id = nil

    procedure(look4pads()
    prog((rep replib)

    if(! (rep = geGetEditRep()) then
    return()
    )
    replib = rep~>lib
    if(! boundp('look4pads_form_id) then
    if(! (look4pads_form_id = CreateLook4PadsForm()) then
    return()
    else
    printf("look4pads_form_id created.\n")
    )
    else
    if(! look4pads_form_id then
    if(! (look4pads_form_id = CreateLook4PadsForm()) then
    return()
    else
    printf("look4pads_form_id created.\n")
    )
    )
    )
    hiDisplayForm(look4pads_form_id)
    )
    )

    procedure(CreateLook4PadsForm()
    prog((def_pad_name def_lab_name def_out pad_name_id lab_name_id
    out_file_id look4pads_form_id)

    def_pad_name = ""
    def_lab_name = ""
    def_out = strcat(rep~>cellName ".pads")

    pad_name_id = hiCreateStringField(
    ?name 'pad_name
    ?prompt "Enter pad layer name."
    ?value def_pad_name
    ?defValue def_pad_name
    )
    lab_name_id = hiCreateStringField(
    ?name 'lab_name
    ?prompt "Enter label layer name."
    ?value def_lab_name
    ?defValue def_lab_name
    )
    out_file_id = hiCreateStringField(
    ?name 'out_file
    ?prompt "Enter output filename"
    ?value def_out
    ?defValue def_out
    )
    look4pads_form_id = hiCreateForm(
    'look4pads_form
    "Find pad centers and names."
    list("findpads()" "")
    list(pad_name_id lab_name_id out_file_id)
    nil nil
    )
    return(look4pads_form_id)
    )
    )

    procedure(findpads()
    prog((lay_str lay_name lay_purp text_str text_name text_purp
    out_file_name
    out_port pad_paths num_pads pad_inst pshape pad_name pad_trans
    pad_box pad_coord pad_label label_list path_depth current_level
    current_cell c_x c_y lab_paths lab_str mag_fact)

    lay_str = parseString(look4pads_form->pad_name->value)
    lay_name = nth(0 lay_str)
    if(! (lay_purp = nth(1 lay_str)) then
    lay_purp = "drawing"
    )
    if(! dbGetLayer(replib list(lay_name lay_purp)) then
    printf("Pad layer does not exist in library.\n")
    return()
    )
    text_str = parseString(look4pads_form->lab_name->value)
    text_name = nth(0 text_str)
    if(! (text_purp = nth(1 text_str)) then
    text_purp = "drawing"
    )
    if(! dbGetLayer(replib list(text_name text_purp)) then
    printf("Label layer does not exist in library.\n")
    return()
    )
    out_file_name = look4pads_form->out_file->value
    if(! (out_port = outfile(out_file_name)) then
    printf("Output file creation error\n")
    return()
    )
    pad_paths = dbGetTrueOverlaps(rep rep~>bBox list(lay_name
    lay_purp) 2)
    if(! pad_paths then
    printf("No pads were found on layer \"%s %s\" in this
    hierarchy\n"
    lay_name lay_purp)
    return()
    else
    num_pads = length(pad_paths)
    ;fprintf(out_port "%d pads were found on layer" num_pads)
    ;fprintf(out_port " \"%s %s\" in this hierarchy\n" lay_name
    lay_purp)
    ; fprintf(out_port "\n\n\nAT49FW080 32-PIN PLCC FWH ")
    ; fprintf(out_port "\n\n(391f6)")
    ; fprintf(out_port "\n\n(Chip size = 3606um X 8498um)")
    ; fprintf(out_port "\n\n\nPin Function
    Center of Pad")
    ; fprintf(out_port "\n--------- ----------
    ------------------------------------\n")

    )
    foreach(ppath pad_paths
    ;printf(" \n")
    ;printf(" \n")
    ;printf("ppath = ") println(ppath)
    pad_box = nil
    current_level = ppath
    if(! listp(current_level) then
    pshape = current_level
    pad_trans = list(0:0 "R0" 1.0)
    ;printf("pshape = ") println(pshape)
    pad_box = pshape~>bBox
    else
    current_cell = nth(0 current_level)
    pad_trans = current_cell~>transform
    ;printf("current_cell = ") println(current_cell)
    ;printf("pad_trans = ") println(pad_trans)
    while(listp(nth(1 current_level))
    current_level = nth(1 current_level)
    current_cell = nth(0 current_level)
    ;printf("current_cell = ") println(current_cell)
    pad_trans = dbConcatTransform(
    current_cell~>transform
    pad_trans
    )
    ;printf("pad_trans = ") println(pad_trans)
    )
    pad_name = current_cell~>name
    ;printf("pad_name = ") println(pad_name)
    pshape = nth(1 current_level)
    ;printf("pshape = ") println(pshape)
    pad_box = geTransformUserBBox(pshape~>bBox list(nth(0
    pad_trans)
    nth(1 pad_trans) nth(2 pad_trans)))
    )
    ;printf("pad_trans = ") println(pad_trans)
    ;mag_fact = nth(2 pad_trans)
    if(pad_box then
    p_llx = nth(0 nth(0 pad_box))
    p_lly = nth(1 nth(0 pad_box))
    p_urx = nth(0 nth(1 pad_box))
    p_ury = nth(1 nth(1 pad_box))

    ;p_llx = nth(0 nth(0 pad_box)) * mag_fact
    ;p_lly = nth(1 nth(0 pad_box)) * mag_fact
    ;p_urx = nth(0 nth(1 pad_box)) * mag_fact
    ;p_ury = nth(1 nth(1 pad_box)) * mag_fact
    c_x = p_llx+(p_urx-p_llx)*.5
    c_y = p_lly+(p_ury-p_lly)*.5
    pad_coord = c_x:c_y
    ; Look for label.
    lab_paths = dbGetTrueOverlaps(rep pad_box list(text_name
    text_purp) 20)
    label_list = nil
    foreach(labpath lab_paths
    current_level = labpath
    if(! listp(current_level) then
    lab = labpath
    else
    current_cell = nth(0 current_level)
    while(listp(nth(1 current_level))
    current_level = nth(1 current_level)
    )
    lab = nth(1 current_level)
    )
    ;printf("lab = ") println(lab)
    if(lab~>shape == "label" then
    lab_str = lab~>theLabel
    if(!member(lab_str label_list) then
    label_list = append1(label_list lab_str)
    )
    )
    )
    lab_str = nth(0 label_list)
    if(! lab_str then
    fprintf(out_port "No label found in pad area at at
    %f:%f\n"
    c_x c_y)
    else
    ; if(length(label_list) > 1 then
    ; fprintf(out_port "More than one label at %f:%f\n"
    ; c_x c_y)
    ; fprintf(out_port "\nUsing label %s.\n" lab_str)
    ; )
    fprintf(out_port "%10s %10s X =
    %10.2f Y = %10.2f \n" "" lab_str (1*c_x) (1*c_y) text_name)
    )
    )
    )
    fprintf(out_port "\n\n\n Coordinates are in um (micron)
    with")
    fprintf(out_port "\n reference to center of chip \n")

    close(out_port)
    hiEdgeViewFile(out_file_name)
    return(label_list)
    )
    )
     
    Kevin Doherty, Aug 22, 2006
    #5
  6. BtruongCA

    chentaison_ Guest

    Hi Kevin,

    This code indeed works for instances but not for mosaic .
    Sometimes we create i/o (f.e. PASS1V) instance use mosaic (row = 2 or
    column = 2)

    In this case , if has mosaic in cell ,
    pad_box = geTransformUserBBox(pshape~>bBox list(nth(0 pad_trans) will
    has error ,
    How can this code to handle mosaic ?

    Thank you very much.
    Charley
     
    chentaison_, Aug 29, 2006
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.