Hi all!
I'm writting a skill to check at start point & end point of a cline if pin exist or not, if pin exist and pin's netname ="dummy",
then assign that cline to that pin. AND , if the coordinate is in the restrict area (box_xy) then do nothing. But I got the problem,
when I put the code to get restrict area, the code still run but the function axlSingleSelectPoint not accurately, otherwise, it's ok.
Who can show me where's wrong? and how can I fix it?.
..............
; =====Get box xy, (default: leftdonwn- rightup)=====
box_xy = axlEnterBox(?prompts list("First rectangle point, please...", "Second rectangle point, please..."))
axlClearSelSet()
loc1_x = xCoord(car(box_xy))
loc1_y = yCoord(car(box_xy))
loc2_x = xCoord(cadr(box_xy))
loc2_y = yCoord(cadr(box_xy))
;=====process if user pick from any coner for making axlEnterBox()=====
if(loc1_x < loc2_x && loc1_y < loc2_y then
box1x = loc1_x
box1y = loc1_y
box2x = loc2_x
box2y = loc2_y
else
if(loc1_x < loc2_x && loc1_y > loc2_y then
box1x = loc1_x
box1y = loc2_y
box2x = loc2_x
box2y = loc1_y
else
if(loc1_x > loc2_x && loc1_y < loc2_y then
box1x = loc2_x
box1y = loc1_y
box2x = loc1_x
box2y = loc2_y
else
box1x = loc2_x
box1y = loc2_y
box2x = loc1_x
box2y = loc1_y
);enf if 1
);end if 2
);end if 3
;=====Prepare =====
axlSetFindFilter(?enabled '(noall pins) ?onButtons '(noall pins))
axlClearSelSet()
axlVisibleDesign(nil)
axlVisibleUpdate(t)
axlVisibleLayer("Pin/top" t)
axlUIWUpdate(nil)
axlClearSelSet()
;=====Main process=====
foreach(clines allWiresInDesign
netname = clines->net->name
if(stringp(netname) then
when(nindex(netname, "__")
;=====get location xy at start cline & end cline=====
cline_seg = clines->segments ;get all segment in a cline
first_seg = car(cline_seg) ;get first segment
last_seg = car(last(cline_seg)) ;get last segment
first_seg_xy = car(first_seg->startEnd)
last_seg_xy = cadr(last_seg->startEnd)
x1= xCoord(car(first_seg->startEnd))
y1= yCoord(car(first_seg->startEnd))
x2= xCoord(lastelem(last_seg->startEnd))
y2= yCoord(lastelem(last_seg->startEnd))
;===CHECK LOCATION X1:Y1 IF PIN EXIST OR NOT=====
if(and(x1>box1x, x1<box2x, y1>box1y, y1<box2y) == nil then
pinselect = axlGetSelSet(axlSingleSelectPoint(x1:y1))
axlClearSelSet()
if( pinselect != nil then
pinselect = car(pinselect)
sym_name = pinselect->component->name
pin_net_name = pinselect->net->name
pin_number = pinselect->number
if(pin_net_name == "" then
fprintf(writeOutFile, "%s %s\n", "FORM mini netlist ", netname)
fprintf(writeOutFile, "%s %s.%s\n", "FORM mini pinname ", sym_name, pin_number)
fprintf(writeOutFile, "next\n")
);endif
);end if pinselect==nil
);end if
;===CHECK LOCATION X2:Y2 IF PIN EXIST OR NOT=====
if(and(x2>box1x, x2<box2x, y2>box1y, y2<box2y) == nil then
pinselect = axlGetSelSet(axlSingleSelectPoint(x2:y2))
axlClearSelSet()
if( pinselect != nil then
pinselect = car(pinselect)
sym_name = pinselect->component->name
pin_net_name = pinselect->net->name
pin_number = pinselect->number
if(pin_net_name == "" then
fprintf(writeOutFile, "%s %s\n", "FORM mini netlist ", netname)
fprintf(writeOutFile, "%s %s.%s\n", "FORM mini pinname ", sym_name, pin_number)
fprintf(writeOutFile, "next\n")
);end if - (1-24)
);end if pinselect==nil)
);end if
);end when
);end if stringp
);end foreach via allWiresInDesign
.........
Tks!
Luan.