Hi Andrew, please find below my code. Based on what SkillUser said above, to turn on/off layers i just need to create PCell parameters that match cdf parameters. i guess thats what you mean by 'the code that does the conditional part'. I can turn on/off metal layers but cannot turn on/off vias. You can copy the code below and run it. Thanks alot for you help. ;; Create the PCell, the "drawing routine" is encapsulated in the ;; powerGridPcell function which does all the work pg_layer_list = list( list("M1") list("M2" "V1") ) coordIndex = 1 ;;create metal layers procedure(powerGridPcell_metal(cv drawMetal rowCol metalLayer) let( (rectRodObj) for(i 0 rowCol when(drawMetal == t case(metalLayer ("M1" coordIndex = 0.63 * i rectRodObj = rodCreateRect( ?cvId cv ?layer list(metalLayer "drawing") ?bBox list(0:coordIndex+0.125 5.04:coordIndex+0.505) ) ) ("M2" coordIndex = 0.63 * i rectRodObj = rodCreateRect( ?cvId cv ?layer list(metalLayer "drawing") ?bBox list(coordIndex+0.125:0 coordIndex+0.505:5.04) ) ) );case ); when );End for i ); let ); procedure ;create vias procedure(powerGridPcell_via(cv v_layer row col v_xStart1 v_yStart1 v_xStart2 v_yStart2 v_xPitch v_yPitch v_w v_l v_row v_col rowPitch colPitch) for(i 0 row ;row for(j 0 col ;col if(mod(j 2) == 0 && mod(i 2) == 0 then tempx1 = colPitch * (j/2) + v_xStart1 tempy1 = rowPitch * (i/2) + v_yStart1 dbCreateViaShapeArray(cv v_layer nil tempx1 tempy1 v_xPitch v_yPitch v_w v_l v_row v_col) else tempx1 = colPitch * (j/2) + v_xStart2 tempy1 = rowPitch * (i/2) + v_yStart2 dbCreateViaShapeArray(cv v_layer nil tempx1 tempy1 v_xPitch v_yPitch v_w v_l v_row v_col) );if );for );for ) pcDefinePCell( list(ddGetObj("test_rudy") "power_grid_pcell_test" "layout") ( (M1 t) (V1 t) (M2 t) ) let( ((cv pcCellView)) powerGridPcell_metal(cv M1 7 nth(0 nth(0 pg_layer_list))) powerGridPcell_metal(cv M2 7 nth(0 nth(1 pg_layer_list))) powerGridPcell_via(cv nth(1 nth(1 pg_layer_list)) 7 7 0.195 0.195 0.825 0.825 0.16 0.16 0.08 0.08 2 2 1.26 1.26) ;V1 ); let ) ;; Create the CDF let( (cellId cdfId) when(cellId = ddGetObj("test_rudy" "power_grid_pcell_test") ;; if the cell CDF already exists, delete it when( cdfId = cdfGetBaseCellCDF(cellId) cdfDeleteCDF(cdfId) ) ;; create the base cell CDF cdfId = cdfCreateBaseCellCDF(cellId) ;; create the parameters cdfCreateParam( cdfId ?name "M1" ?prompt "M1" ?defValue "true" ?type "boolean" ?display "t" ) cdfCreateParam( cdfId ?name "V1" ?prompt "V1" ?defValue "true" ?type "boolean" ?display "t" ) cdfCreateParam( cdfId ?name "M2" ?prompt "M2" ?defValue "true" ?type "boolean" ?display "t" ) cdfSaveCDF(cdfId) ); when ); let
↧