ic@@$ic_hotkey_set = "Custom"; ic@@$key_label_a = "select area"; function ic@@$key_a(),INDIRECT { // $$select_area(); } ic@@$key_label_b = "brighten context"; function ic@@$key_b(),INDIRECT { // local pct = $get_context_contrast()+20; if (pct <= 100) { $show_context(pct); } } ic@@$key_label_c = "copy"; function ic@@$key_c(),INDIRECT { // Copy objects if ($ck_sel()) { $$copy(); } else if ($get_target_objects_count()) { $execute_with_handles($get_target_objects(), $$copy); } else { $ic_msg_select("Copy"); $$select_area(); $$copy(); $ic_msg_clear(); } } ic@@$key_label_d = "delete"; function ic@@$key_d(),INDIRECT { // if ($ck_sel()) $$delete(); else if ($get_target_objects_count()) $execute_with_handles($get_target_objects(), $$delete); else { $ic_msg_select("Delete"); $$select_area(); $delete(); $ic_msg_clear(); } } ic@@$key_label_e = "move edge"; function ic@@$key_e(),INDIRECT { // if ($is_edge_selected()) $$move(); else { $ic_msg_select("Move Edge"); $$select_edge(); $move(); $ic_msg_clear(); } } ic@@$key_label_f = "flip horizontal"; function ic@@$key_f(),INDIRECT { // if ($ck_sel()) { $$flip(@horizontal, $get_rotation_point()); } else { $ic_msg_select("Flip"); $$select_area(); $$flip(@horizontal, $get_rotation_point()); $ic_msg_clear(); } } ic@@$key_label_g = "POLY_TO_METAL contact "; function ic@@$key_g(),INDIRECT { local pos; local x; local y; pos = $get_ic_location(@snap); x = pos[0]; y = pos[1]; $$select_all(); $$protect(); if( $get_env("ADK_TECH") == "tsmc018" ){ local pos = $get_ic_location(@snap); local x = pos[0]; local y = pos[1]; $add_shape([[x-2, y+2], [x+2, y-2]], "METAL1", @internal, @nokeep); $add_shape([[x-1, y+1], [x+1, y-1]], "CONTACT_TO_POLY", @internal, @nokeep); $add_shape([[x-2.5, y+2.5], [x+2.5, y-2.5]], "POLY", @internal, @nokeep); } $$select_all(); $$move(); $$unprotect_all(); $$unselect_all(); // } ic@@$key_label_h = "crosshair radius"; function ic@@$key_h(),INDIRECT { // $set_crosshair_target_radius(); } ic@@$key_label_i = "IRoute*"; function ic@@$key_i(),INDIRECT { // $iroute_repeat(); } ic@@$key_label_j = "open LDL cockpit"; function ic@@$key_j(),INDIRECT { // Open LDL Cockpit $$open_ldl_cockpit(); } ic@@$key_label_k = "N WELL contact "; function ic@@$key_k(row : integer, col : integer),INDIRECT { local pos = $get_ic_location(@snap); local x = pos[0]; local y = pos[1]; local l_siz_ACT = (row*2) + (row*4) - 1; local b_siz_ACT = (col*2) + (col*4) - 1; local x_sizA = b_siz_ACT/2; local y_sizA = l_siz_ACT/2; local l_NPS = (row*2) + ((row+1)*4) - 1; local b_NPS = (col*2) + ((col+1)*4) - 1; local x_NPS = b_NPS/2; local y_NPS = l_NPS/2; local con_x = x - (x_sizA - 2.5); local con_y = y - (y_sizA - 2.5); local i = 1; local j = 1; $$select_all(); $$protect(); if( $get_env("ADK_TECH") == "tsmc018" ){ $$add_shape([[x-x_sizA,y+y_sizA],[x+x_sizA,y-y_sizA]],"ACTIVE",@internal,@nokeep); $$add_shape([[x-x_NPS,y+y_NPS],[x+x_NPS,y-y_NPS]],"N_PLUS_SELECT",@internal,@nokeep); $$add_shape([[x-x_NPS-1,y+y_NPS+1],[x+x_NPS+1,y-y_NPS]],"N_WELL",@internal,@nokeep); for (i=1;i<=row;i=i+1) { for (j=1;j<=col;j=j+1) { $$add_shape([[con_x-1,con_y+1],[con_x+1,con_y-1]],"CONTACT_TO_ACTIVE",@internal,@nokeep); con_x = con_x + 6.0; } con_y = con_y + 6.0; con_x = x - (x_sizA - 2.5); } } $$select_all(); $$move(); $$unprotect_all(); $$unselect_all(); // } ic@@$key_label_l = "P WELL CONTACT"; function ic@@$key_l(row : integer, col : integer),INDIRECT { local pos = $get_ic_location(@snap); local x = pos[0]; local y = pos[1]; local l_siz_ACT = (row*2) + (row*4) - 1; local b_siz_ACT = (col*2) + (col*4) - 1; local x_sizA = b_siz_ACT/2; local y_sizA = l_siz_ACT/2; local l_NPS = (row*2) + ((row+1)*4) - 1; local b_NPS = (col*2) + ((col+1)*4) - 1; local x_NPS = b_NPS/2; local y_NPS = l_NPS/2; local con_x = x - (x_sizA - 2.5); local con_y = y - (y_sizA - 2.5); local i = 1; local j = 1; $$select_all(); $$protect(); if( $get_env("ADK_TECH") == "tsmc018" ){ $$add_shape([[x-x_sizA,y+y_sizA],[x+x_sizA,y-y_sizA]],"ACTIVE",@internal,@nokeep); $$add_shape([[x-x_NPS,y+y_NPS],[x+x_NPS,y-y_NPS]],"P_PLUS_SELECT",@internal,@nokeep); $$add_shape([[x-x_NPS-1,y+y_NPS],[x+x_NPS+1,y-y_NPS-1]],"P_WELL",@internal,@nokeep); for (i=1;i<=row;i=i+1) { for (j=1;j<=col;j=j+1) { $$add_shape([[con_x-1,con_y+1],[con_x+1,con_y-1]],"CONTACT_TO_ACTIVE",@internal,@nokeep); con_x = con_x + 6.0; } con_y = con_y + 6.0; con_x = x - (x_sizA - 2.5); } } $$select_all(); $$move(); $$unprotect_all(); $$unselect_all(); // } ic@@$key_label_m = "move"; function ic@@$key_m(),INDIRECT { // Move objects // Fix for DR327061, move either edges or objects, whichever is selected... if ($ck_sel() || $is_edge_selected()) { $$move(); } else if ($get_target_objects_count()) { $execute_with_handles($get_target_objects(), $$move); } else { $ic_msg_select("Move"); $$select_area(); $$move(); $ic_msg_clear(); } } ic@@$key_label_n = "notch"; function ic@@$key_n(),INDIRECT { // if ($ck_sel()) { $$notch(); } else { $ic_msg_select("Notch"); $$select_area(); $$notch(); $ic_msg_clear(); } } ic@@$key_label_o = "modify centerline"; function ic@@$key_o(),INDIRECT { // if ($ck_sel()) { $$modify_centerline(); } else { $ic_msg_select("Modify Centerline"); $$select_area(); $$modify_centerline(); $ic_msg_clear(); } } ic@@$key_label_p = "add path"; function ic@@$key_p(),INDIRECT { // Add Path $$add_path(); } ic@@$key_label_q = "change object attributes"; function ic@@$key_q(),INDIRECT { // if ($ck_sel()){ $$change_object_attributes(); } else if ($get_target_objects_count()) { $execute_with_handles($get_target_objects(), $$change_object_attributes); } else { $ic_msg_select("Change Attributes"); $$select_area(); $$change_object_attributes(); $ic_msg_clear(); } } ic@@$key_label_r = "rotate 90"; function ic@@$key_r(),INDIRECT { // if ($ck_sel()) { $$rotate(90, $get_rotation_point(), @selected); } else { $ic_msg_select("Rotate"); $$select_area(); $$rotate(90, $get_rotation_point(), @selected); $ic_msg_clear(); } } ic@@$key_label_s = "add shape"; function ic@@$key_s(),INDIRECT { // Add shape $$add_shape(); } ic@@$key_label_t = "add text"; function ic@@$key_t(),INDIRECT { // $$add_text(); } ic@@$key_label_u = "undo"; function ic@@$key_u(),INDIRECT { // $undo(); } ic@@$key_label_v = "add via"; function ic@@$key_v(),INDIRECT { // $$add_via(); } ic@@$key_label_w = "view all"; function ic@@$key_w(),INDIRECT { // $$view_all(); } ic@@$key_label_x = " "; function ic@@$key_x(),INDIRECT { // } ic@@$key_label_y = " "; function ic@@$key_y(),INDIRECT { // } ic@@$key_label_z = " "; function ic@@$key_z(),INDIRECT { // } ic@@$key_label_as = "unselect Area"; function ic@@$key_as(),INDIRECT { // $$unselect_area(); } ic@@$key_label_bs = "unBrighten context"; function ic@@$key_bs(),INDIRECT { // local pct = $get_context_contrast()-20; if ( pct >= 0) { $show_context(pct); } } ic@@$key_label_cs = "add Cell "; function ic@@$key_cs(),INDIRECT { // $$add_cell(); } ic@@$key_label_ds = "add Device"; function ic@@$key_ds(),INDIRECT { // $$add_device(); } ic@@$key_label_es = " "; function ic@@$key_es(),INDIRECT { // } ic@@$key_label_fs = "Flip vertical"; function ic@@$key_fs(),INDIRECT { // if ($ck_sel()) { $$flip(@vertical, $get_rotation_point()); } else { $ic_msg_select("Flip"); $$select_area(); $$flip(@vertical, $get_rotation_point()); $ic_msg_clear(); } } ic@@$key_label_gs = "Set Angle Mode All"; function ic@@$key_gs(),INDIRECT { // Set the angle mode $set_angle_mode(@all); // Set location mode to @line, if not already set if ($get_location_mode() != @line) $set_location_mode(@line); } ic@@$key_label_hs = "Specify X or Y coordinate for Next Point"; function ic@@$key_hs(),INDIRECT { // $notify("H not implemented"); } ic@@$key_label_is = " "; function ic@@$key_is(),INDIRECT { // } ic@@$key_label_js = " "; function ic@@$key_js(),INDIRECT { // } ic@@$key_label_ks = "Specify Offset for Next Point"; function ic@@$key_ks(),INDIRECT { // local offset = $get_offset(); local point = $get_point_nosnap(); if (point == undefined) return; $loc(point[0] + offset[0], point[1] + offset[1]); } ic@@$key_label_ls = "Add Point Perpendicular to Nearest Edge"; function ic@@$key_ls(),INDIRECT { // local edge, new_point, near, last_point; $assign_ic_location(@nosnap); last_point = $get_mark(); if ($ic_loc == undefined || last_point == undefined) return; near = $get_closest_object_points($ic_loc); // near = [vertex, edge, points, layer] if (near == undefined) { $notify("Unable to find midpoint of nearest edge."); return; } edge = near[1]; if (edge[0][0] == edge[1][0]) { // vertical local x, y, miny, maxy; x = edge[0][0]; y = $get_mark()[1]; miny = $vector_min([edge[0][1], edge[1][1]]); maxy = $vector_max([edge[0][1], edge[1][1]]); if (y < miny) y = miny; else if (y > maxy) y = maxy; $loc(x, y); } else if (edge[0][1] == edge[1][1]) { // horizontal local x, y, minx, maxx; x = $get_mark()[0]; y = edge[0][1]; minx = $vector_min([edge[0][0], edge[1][0]]); maxx = $vector_max([edge[0][0], edge[1][0]]); if (x < minx) x = minx; else if (x > maxx) x = maxx; $loc(x, y); } else { // odd angle // just compute distance two vertices, choose closer. local dx, dy, d0, d1; dx = (last_point[0] - edge[0][0]); dy = (last_point[1] - edge[0][1]); d0 = dx * dx + dy * dy; dx = (last_point[0] - edge[1][0]); dy = (last_point[1] - edge[1][1]); d1 = dx * dx + dy * dy; if (d0 < d1) { $loc(edge[0][0], edge[0][1]); } else { $loc(edge[1][0], edge[1][1]); } } } ic@@$key_label_ms = "Add Point at Midpoint of Nearest Edge"; function ic@@$key_ms(),INDIRECT { // local edge, new_point, near; $assign_ic_location(@nosnap); if ($ic_loc == undefined) return; near = $get_closest_object_points($ic_loc); // near = [vertex, edge, points, layer] if (near == undefined) { $notify("Unable to find midpoint of nearest edge."); return; } edge = near[1]; new_point = [(edge[0][0] + edge[1][0])/2, (edge[0][1] + edge[1][1])/2]; $loc(new_point[0], new_point[1]); } ic@@$key_label_ns = "Add point at center of nearest object"; function ic@@$key_ns(),INDIRECT { // local obj, new_point, minx, maxx, miny, maxy, xs, ys; $assign_ic_location(@nosnap); if ($ic_loc == undefined) return; obj = $get_closest_object_points($ic_loc); if (obj == undefined) { $notify("Unable to locate the nearest object."); return; } else { local c = $get_containment(obj[2], $ic_loc); if (c != @in && c != @on) { // if point is not contained, do nothing $notify("Nearest object does not contain this point."); return; } } xs = $secondary_vector(obj[2],0); ys = $secondary_vector(obj[2],1); minx = $vector_min(xs); maxx = $vector_max(xs); miny = $vector_min(ys); maxy = $vector_max(ys); new_point = [0,0]; new_point[0] = (minx + maxx)/2; new_point[1] = (miny + maxy)/2; $loc(new_point[0], new_point[1]); } ic@@$key_label_os = "Set Angle Mode 45"; function ic@@$key_os(),INDIRECT { // Set the angle mode $set_angle_mode(@forty_five); // Set location mode to @line, if not already set if ($get_location_mode() != @line) $set_location_mode(@line); } ic@@$key_label_ps = "add Property"; function ic@@$key_ps(),INDIRECT { // if ($ck_sel()) { $$add_property(); } else { $ic_msg_select("Add Property"); $$select_area(); $$add_property(); $ic_msg_clear(); } } ic@@$key_label_qs = "Add point perpendicular from last point"; function ic@@$key_qs(),INDIRECT { // local edge, new_point, near; $assign_ic_location(@nosnap); if ($ic_loc == undefined) return; near = $get_closest_object_points($ic_loc); // near = [vertex, edge, points, layer] if (near == undefined) { $notify("Unable to find midpoint of nearest edge."); return; } edge = near[1]; if (edge[0][0] == edge[1][0]) { // vertical local x, y, miny, maxy; x = edge[0][0]; y = $ic_loc[1]; miny = $vector_min([edge[0][1], edge[1][1]]); maxy = $vector_max([edge[0][1], edge[1][1]]); if (y < miny) y = miny; else if (y > maxy) y = maxy; $loc(x, y); } else if (edge[0][1] == edge[1][1]) { // horizontal local x, y, minx, maxx; x = $ic_loc[0]; y = edge[0][1]; minx = $vector_min([edge[0][0], edge[1][0]]); maxx = $vector_max([edge[0][0], edge[1][0]]); if (x < minx) x = minx; else if (x > maxx) x = maxx; $loc(x, y); } else { // odd angle // just snap to closer vertex $loc(edge[0][0], edge[0][1]); } } ic@@$key_label_rs = "Rotate -90"; function ic@@$key_rs(),INDIRECT { // if ($ck_sel()) { $$rotate(-90, $get_rotation_point(), @selected); } else { $ic_msg_select("Rotate"); $$select_area(); $$rotate(-90, $get_rotation_point(), @selected); $ic_msg_clear(); } } ic@@$key_label_ss = "Splice: Add Point at X coordinate of one point and Y coordinate of second point"; function ic@@$key_ss(),INDIRECT { // local xpoint, ypoint; xpoint = $get_point_nosnap(); if (xpoint == undefined) return; ypoint = $get_point_nosnap(); if (ypoint == undefined) return; $loc(xpoint[0], ypoint[1]); } ic@@$key_label_ts = "add property Text"; function ic@@$key_ts(),INDIRECT { // if ($ck_sel()) { $$add_property_text(); } else { $ic_msg_select("Add Property Text"); $$select_area(); $$add_property_text(); $ic_msg_clear(); } } ic@@$key_label_us = "Unselect all"; function ic@@$key_us(),INDIRECT { // $$unselect_all(); } ic@@$key_label_vs = "Add Point at Nearest Vertex"; function ic@@$key_vs(),INDIRECT { // local obj, vertex; $assign_ic_location(@nosnap); if ($ic_loc == undefined) return; obj = $get_closest_object_points($ic_loc); if (obj == undefined) { $notify("Problem snapping to nearest object"); return; } vertex = obj[0]; $loc(vertex[0], vertex[1]); } ic@@$key_label_ws = " "; function ic@@$key_ws(),INDIRECT { // } ic@@$key_label_xs = "Set Manhattan X Entry Mode"; function ic@@$key_xs(),INDIRECT { // Simply set the location mode $set_location_mode(@mx); } ic@@$key_label_ys = "Set Manhattan Y Entry Mode"; function ic@@$key_ys(),INDIRECT { // Simply set the location mode $set_location_mode(@my); } ic@@$key_label_zs = " "; function ic@@$key_zs(),INDIRECT { // } ic@@$key_label_0 = " "; function ic@@$key_0(),INDIRECT { // } ic@@$key_label_1 = "cycle selecting 1"; function ic@@$key_1(),INDIRECT { // if ($ck_sel()) { $$select_one(); } else { $ic_msg_select("Cycle Selecting 1"); $$select_area(); $$select_one(); $ic_msg_clear(); } } ic@@$key_label_2 = " "; function ic@@$key_2(),INDIRECT { // } ic@@$key_label_3 = " "; function ic@@$key_3(),INDIRECT { // } ic@@$key_label_4 = " "; function ic@@$key_4(),INDIRECT { // } ic@@$key_label_5 = " "; function ic@@$key_5(),INDIRECT { // } ic@@$key_label_6 = " "; function ic@@$key_6(),INDIRECT { // } ic@@$key_label_7 = " "; function ic@@$key_7(),INDIRECT { // } ic@@$key_label_8 = " "; function ic@@$key_8(),INDIRECT { // } ic@@$key_label_9 = "Change Port At Cursor"; function ic@@$key_9(),INDIRECT { $change_port_at_cursor(); }