How to copy list of cells between libraries and rename reference library using Cadence SKILL

3.6k views Asked by At

I needed a SKILL script to copy Layout view of multiple cells from one library to another and than rename reference library. So I wrote one :)

1

There are 1 answers

0
Alex On
;Copy list of cells
procedure(copycells(source_lib destination_lib)
let( ( cell_list old_cell new_cell call_name oldSpec newSpec specList destination_lib objId)
    cell_list=list(
        "HV_driver_dc2dc_fb" "dc2dc" "dc2dc_comparator" "dc2dc_core" "dc2dc_fb_cap_divider" "dc2dc_hv_curr_src" "dc2dc_low_side_switch_logic"
        "dc2dc_ls_iso" "dc2dc_ocp_comparator" "dc2dc_ref_voltage_selector" "dc2dc_switch_and_diode" "dc2dc_top" "dc2dc_tst_tg"
        "dc2dc_vref_amp" "dc2dc_vref_preamp" "doubler" "doubler_aux_bottom_driver" "doubler_core" "doubler_main_bottom_driver"
        "doubler_main_cap" "dcdc_tst_mux" "dcdc_t6_tst_mux_tg_esd" "dcdc_t6_tst_mux_tg"
    )

    specList = gdmCreateSpecList();Speclist for rename reference library function

    foreach(call_name cell_list
        ;This part needed only for version control managed labraries
        objId = ddGetObj( destination_lib call_name "layout" "*" );;Get objId for layout view

        unless( objId
            error( "** Unable to get objId of %s %s layout\n" destination_lib call_name )
        );unless
        when( ddNeedCheckout(objId)  ;If ccheckout needed old commend ufIsObjectCheckedIn(objId)
            printf("Checking out %s cellView of %s %s\n " "layout" destination_lib  call_name)

            unless(ddCheckout(objId);Check out
                error( "** Unable to get check out %s %s %s\n" destination_lib  call_name "layout")
            );unless
        );when
        ;check out end

        old_cell = dbOpenCellViewByType( source_lib call_name "layout" );Source cell
        unless(old_cell error("Unable to open old cell"))
        printf("Copy %s %s to %s %s\n" source_lib call_name destination_lib call_name)
        new_cell= dbCopyCellView( old_cell destination_lib call_name "layout" nil nil t );Copy cell
        unless(new_cell error("Unable to copy %s" call_name))
        dbClose(old_cell);Close old ce;;
        dbClose(new_cell);Close new cell
        gdmAddSpecToSpecList(gdmCreateSpecFromDDID(ddGetObj(destination_lib call_name "layout")) specList);Add cell to SPEC list
    );foreach
    oldSpec = gdmCreateSpec( source_lib "" "" "" "CDBA" );Spec of source lib
    newSpec = gdmCreateSpec( destination_lib "" "" "" "CDBA" );Spec of destination lib
    ccpRenameReferenceLib(oldSpec newSpec specList 'CCP_VALID_BOTH_REFS);Rename reference library for target cells
);let );copycells