계산을 최적화하다안녕,
웨이퍼 중심에서 반경 거리를 계산하는 jsl 코드가 있습니다. 데이터 테이블 XYCoord에는 X, Y 및 웨이퍼 ID 열이 있습니다.
거리를 계산하여 테이블 중심에서 1mm 떨어진 거리 열을 추가합니다.
현재 656,000개 행으로 프로세스를 완료하는 데 3~4분 이상 걸리는데, 이는 너무 깁니다.
최적화하고 더 빠르게 만들 수 있는 방법이 있나요?
자동화 및 스크립팅Re: 계산 최적화제공하신 데이터에 대해 스크립트를 실행하려고 했지만 실패했습니다. 제가 수정하려고 시도한 첫 번째 항목은 스크립트의 여러 줄에 있는 "="가 빗나간 것입니다.
23, 25, 106, 139 및 152번 줄에는 모두 단일 "="가 있습니다.
그 다음 오류 메시지는 이전 실행에서 정리 중인 열인 것으로 보이지만, 제공한 표에는 해당 열이 없으므로 스크립트가 실패합니다.
RadiusDieCenter, xcentering, ycentering, 반경 1mm 반올림, 반경 0.51mm 반올림
문제가 있는 줄 주위에 Try()를 추가했습니다.
21번째 줄의 열 X Coord가 참조되지만 데이터 테이블에 존재하지 않습니다.
나는 그것이 실행에 대한 x 좌표 열이라고 가정하고 그것을 U1_x로 변경했습니다.
그런 다음 코드는 2분 12초 동안 오류 없이 실행되었지만 결과가 올바른 결과인지는 모르겠습니다. Xcentering 및 Ycentering 열은 모두 0입니다. 이것이 예상된 것입니까?

Re: 계산 최적화안녕하세요 짐,
네, 맞습니다. X와 Y 그래프를 그려서 결과를 확인하고 1mm col 값을 강조할 수 있습니다. 이것이 더 최적화될 수 있는지 궁금합니다. 위에 첨부된 jsl 파일의 오류를 수정했습니다.
Re: 계산 최적화안녕하세요 @Jackie_ ,
스크립트는 각 루프에서 여러 Col 값을 다시 계산했습니다. 다음을 시도해 보세요.
끝 - 시작 = 6.15000000002328;
Names Default To Here( 1 );
start = Tick Seconds();
dt = Current Data Table();
dt << Clear Column Selection;
Try( dt << delete columns( RadiusDieCenter ) );
Try(
dt << delete columns( RadiusDieEdge );
dt << delete columns( Xcentering );
dt << delete columns( Ycentering );
dt << delete columns( Radius Rounded 1mm );
dt << delete columns( Radius Rounded 0.51mm );
dt << delete columns( Radius Rounded 1mm );
);
z5Identifier = 1;
Xaxis = "U1_x";
Yaxis = "U1_y";
DieXSize = 1.160; //in mm
DieYSize = 0.810;//in mm
WaferColumns = N Items( Associative Array( As Column( Xaxis ) ) << Get Keys );
columnsRad = ((WaferColumns * DieXSize) / 2);
MaxRadiusEntry = 147;
dt << Set Table Variable( "DieXSize", DieXSize );
dt << Set Table Variable( "DieYSize", DieYSize );
dt << Set Table Variable( "MaxRadius", MaxRadiusEntry );
dt << begin data update;
xcoordmax = Col Maximum( As Column( Xaxis ) );
xcoordmin = Col Minimum( As Column( Xaxis ) );
ycoordmax = Col Maximum( As Column( Yaxis ) );
ycoordmin = Col Minimum( As Column( Yaxis ) );
New Column( "RadiusDieCenter",
Formula( Sqrt( (Abs( (As Column( Xaxis ) - CenterXCoord) * DieXSize )) ^ 2 + Abs( ((As Column( Yaxis ) - CenterYCoord) * DieYSize) ) ^ 2 ) )
);
New Column( "RadiusDieEdge",
Formula(
Sqrt(
(Abs( (As Column( Xaxis ) - CenterXCoord) * DieXSize ) + Abs( DieXSize / 2 )) ^ 2 + (Abs(
(As Column( Yaxis ) - CenterYCoord) * DieYSize
) + Abs( DieYSize / 2 )) ^ 2
)
)
);
xcoordrange = xcoordmax - xcoordmin;
ycoordrange = ycoordmax - ycoordmin;
dt << Set Table Variable( "CenterXCoord", xcoordmin + xcoordrange / 4 );
dt << Set Table Variable( "CenterYCoord", ycoordmin + ycoordrange / 4 );
dt << Run Formulas;
xiter = Ceiling( Log( xcoordrange * 1600, 1.8 ) );
yiter = Ceiling( Log( ycoordrange * 1600, 1.8 ) );
maxiter = Max( xiter, yiter );
New Column( "Xcentering",
Numeric,
Formula(
If( As Column( Xaxis ) > :CenterXCoord & :RadiusDieEdge > :MaxRadius,
1,
If( As Column( Xaxis ) < :CenterXCoord & :RadiusDieEdge > :MaxRadius,
-1,
0
)
)
)
);
New Column( "Ycentering",
Numeric,
Formula(
If( As Column( Yaxis ) > :CenterYCoord & :RadiusDieEdge > :MaxRadius,
1,
If( As Column( Yaxis ) < :CenterYCoord & :RadiusDieEdge > :MaxRadius,
-1,
0
)
)
)
);
dt << end data update;
sum_x_centering = Col Sum( :Xcentering );
min_x_centering = Col Min( :Xcentering );
max_x_centering = Col Max( :Xcentering );
sum_y_centering = Col Sum( :Ycentering );
min_y_centering = Col Min( :Ycentering );
max_y_centering = Col Max( :Ycentering );
For( i = 1, i <= maxiter, i++,
centerx = Num( dt << Get Table Variable( "CenterXCoord" ) );
centery = Num( dt << Get Table Variable( "CenterYCoord" ) );
xcoordrange = xcoordrange / 1.8;
ycoordrange = ycoordrange / 1.8;
dt << Run Formulas;
If( sum_x_centering > 0,
dt << Set Table Variable( "CenterXCoord", centerx + xcoordrange );
centerx = centerx + xcoordrange;
,
If( sum_x_centering < 0,
dt << Set Table Variable( "CenterXCoord", centerx - xcoordrange );
centerx = centerx + xcoordrange;
)
);
If( sum_y_centering > 0,
dt << Set Table Variable( "CenterYCoord", centery + ycoordrange );
centery = centery + ycoordrange;
,
If( sum_y_centering < 0,
dt << Set Table Variable( "CenterYCoord", centery - ycoordrange );
centery = centery + ycoordrange;
)
);
If( max_x_centering < 1 & min_x_centering > -1 & max_y_centering < 1 & min_y_centering > -1,
OldRadius = dt << Get Table Variable( "MaxRadius" );
NewRadius = Num( OldRadius ) - 0.01;
dt << Set Table Variable( "MaxRadius", Char( NewRadius ) );
xcoordrange = xcoordmax - xcoordmin;
ycoordrange = ycoordmax - ycoordmin;
dt << Run Formulas;
i = 1;
);
dt << Run Formulas;
);
New Column( "Radius Rounded 1mm", Numeric, "Continuous", Format( "Best", 12 ), Formula( Ceiling( :RadiusDieEdge ) ) );
end = Tick Seconds();
Show( end - start );
Re: 계산 최적화제가 보기에 처리 속도를 높이는 데 도움이 될 만한 방법은 스크립트를 다시 코딩하고 중간 저장소로 테이블 스크립트를 사용하지 않는 것입니다.
테이블 변수를 사용하는 것과 메모리 변수를 사용하는 것의 효율성을 확인하기 위해 간단한 테스트를 실행했는데, 테스트 결과 테이블 변수 방식은 처리하는 데 26초가 걸렸고, 메모리 변수 방식은 0.5초가 걸렸습니다.
중간 계산을 저장하기 위해 전역 메모리 변수를 사용하거나 이름 공간 변수를 만드는 것을 고려하세요. 테이블 변수가 최종 값을 가지게 하려면 스크립트 끝에 한 번만 설정하면 됩니다.
Re: 계산 최적화그거 좋네요. 짐에게 공유해 주시겠어요?
Re: 계산 최적화결과가 틀렸습니다 @robot

내 대본과 함께 있어야 합니다

Re: 계산 최적화내가 사용한 2개의 테스트 스크립트는 다음과 같습니다.
names default to here(1);
dt = new table("example");
dt << new table variable("test",42);
start = tick seconds();
dt=current data table();
for(i=1,i<=1000000,i++,
x=num(dt<<GET table="" variable=""></GET>
<CODE class=" language-jsl">names default to here(1);
If(!isnamespace(t), t = new namespace("temp"));
start = tick seconds();
dt=current data table();
t:x=1;
for(i=1,i<=1000000,i++,
y = t:x;
y=y+1;
t:x=y;
);
end = tick seconds();
show(end -start);Re: 계산 최적화스크립트를 잠깐 살펴보면, 가능한 최적화 방법이 아주 많은 것 같지만, 무엇을 계산하시는지 약간 혼란스럽습니다.
- 이 데이터로부터 웨이퍼의 중심은 어떻게 결정됩니까?
- 웨이퍼 중심에서 반지름까지의 거리는 얼마입니까?
- 주사위 전체가 반지름에 속해야 하나요, 아니면 중심에만 속해야 하나요?
Re: 계산 최적화많은 가정이 이루어짐
/*""" Optimize the computation
author: jthi
date: 2024-09-05
url: https://community.jmp.com/t5/Discussions/Optimize-the-computation/m-p/795219
keywords/tags: [semiconductor,wafer,distance,matrix,die]
Description: Calculate distance from center of wafer (coordinates) to corner of die
"""*/
Names Default To Here(1);
dt_temp = Open("$DOWNLOADS/XYCoord.jmp");
die_width = 1.160;
die_height = 0.810;
dt = dt_temp << Summary(
Group(:U1_x, :U1_y),
Freq("None"),
Weight("None"),
Link to original data table(0),
output table name("Coords")
);
dt << Delete Scripts(dt << Get Table Script Names);
// Use Update to join the distances back using U1_x and U1_y as linking ids
Close(dt_temp, no save); // Close as not needed for this demo
m_x = Column(dt, "U1_x") << get values;
m_y = Column(dt, "U1_y") << get values;
// Origo to 0, 0 and coordinates to "real" measures
// This most likely will require some adjustments but you know your data so you should be able to modify this as needed
xcoords = (m_x - Max(m_x) / 2) * die_width + die_width / 2;
ycoords = (m_y - Max(m_y) / 2) * die_height + die_height / 2;
// Distance from center to each of the corners of rectangle
// assumes that the "coordinate" is at the center of die
top_left = xcoords - die_width / 2 || ycoords + die_height / 2;
bottom_left = xcoords - die_width / 2 || ycoords - die_height / 2;
top_right = xcoords + die_width / 2 || ycoords + die_height / 2;
bottom_right = xcoords + die_width / 2 || ycoords - die_height / 2;
d_tl = Sqrt(Distance(top_left, [0 0]));
d_bl = Sqrt(Distance(bottom_left, [0 0]));
d_tr = Sqrt(Distance(top_right, [0 0]));
d_br = Sqrt(Distance(bottom_right, [0 0]));
// Assume that furthest part of die is the determining factor for distance
die_distance_to_center = Round(V Max((d_tl || d_bl || d_tr || d_br)`));
dt << New Column("D", Numeric, Ordinal, Values(die_distance_to_center));
nw = New Window("Demo",
H List Box(
dt << Data Filter(
Add Filter(columns(:D), Display(:D, N Items(15), Find(Set Text(""))))
),
gb = dt << Graph Builder(
Size(528, 463),
Show Control Panel(0),
Lock Scales(1),
Variables(X(:U1_x), Y(:U1_y)),
Elements(Points(X, Y, Legend(4))),
SendToReport(
Dispatch({}, "U1_x", ScaleBox,
{Format("Fixed Dec", 12, 0), Min(-2.87573722663528), Max(261.04),
Inc(50), Minor Ticks(1)}
),
Dispatch({}, "U1_y", ScaleBox,
{Format("Fixed Dec", 12, 0), Min(-3.300675), Max(380), Inc(100),
Minor Ticks(4)}
)
)
)
)
);
Write();


Re: 계산 최적화@jthi
1. 웨이퍼의 중심은 X 및 Y 좌표의 범위(즉, 최대값에서 최소값을 뺀 값)를 계산하여 결정됩니다. 중심에 대한 초기 추정치는 다음과 같이 계산됩니다.
- 중심 X 좌표 = x 좌표분 + x 좌표범위 / 4
- 중심 Y 좌표 = y 좌표분 + y 좌표범위 / 4
그런 다음 코드는 X 및 Y 중심 조건이 충족될 때까지 각 반복에서 좌표 범위를 1.8로 나누어 이러한 좌표를 반복적으로 조정합니다. 최종 중심은 두 축의 중심 공식이 발견될 때 발견됩니다.
2. 반경은 웨이퍼 중심에서 다이 입구 "RadiusDieCenter" 또는 다이 가장자리 "RadiusDieEdge"까지 계산됩니다.
3. 다이의 중심만 계산된 반경 내에 속하면 됩니다. 반경 계산은 웨이퍼 중심에서 각 다이 중심까지의 거리에 초점을 맞춥니다.