Adaptve Free Space Management of Onlne Placement for Reconfgurable Systems Trong-Yen Lee, Che-Cheng Hu, and Cha-Chun Tsa Abstract The FPGA can be reconfgured both dynamcally and partally. Such reconfgurable FPGA allows several tasks to be executed, placed and removed at the runtme. Therefore, the hardware resources management n FPGA on the onlne placement becomes very mportant. Most technques for fndng empty space are based on rectangle. In ths paper, we propose an adaptve free space management for fndng canddate space wth rectangular or nonrectangular to place newly arrvng tasks. The adaptve free space management uses two procedures to fnd all feasble canddate space for arrvng tasks, namely C-Look and CSAF. Experment results show that the proposed method reduces.% n rejecton rate,.% n total task executon tme, and.% n total task watng tme. Index Terms FPGA, free space management, canddate space. I. INTRODUCTION Dynamcally partal reconfgurable (DPR) fled programmable gate arrays (FPGAs) allow hardware tasks to be placed and removed at the run tme whle other tasks n DPR FPGA system are stll workng. In such a DPR FPGA system, an mportant component of host CPU s the hardware task placer. The hardware task placer must fnd feasble canddate space to place a newly arrvng task. The placement management of DPR FPGA can be classfed nto two types whch are offlne and onlne placement. Current researches solvng the free space management of DPR FPGAs have focused on onlne placement [][]. Moreover, most researches fndng empty space for new task are based on rectangular space []-[]. Bazargan et al. [] proposed a maxmal empty rectangle (MER) management method whch s broadly referenced. The MER wll mantan the set of all maxmal empty rectangles, only one of them wll s decded when a new task can be placed. Walder et al. [] presented three parttoners based on Manuscrpt receved December 0, 00. Ths work was supported n part by Natonal Scence Councl, ROC under Grant NSC---E-0-0. Trong-Yen Lee s wth the Department of Electronc Engneerng, Natonal Tape Unversty of Technology, Tape, Tawan ROC. (e-mal: tylee@ntut.edu.tw). Che-Cheng Hu regstered Ph. D. at the Insttute of Computer and Communcaton, Natonal Tape Unversty of Technology, Tape, Tawan ROC. (e-mal: s0@ntut.edu.tw). Cha-Chun Tsa s wth the Department of Computer Scence and Informaton Engneerng, Nanhua Unversty, Cha-Y, Tawan, ROC. (e-mal: chun@mal.nhu.edu.tw). Bazargan et al. []: enhanced Bazargan, On-The-Fly (OTF) and enhanced OTF. These enhanced methods mprove the placement qualty. They also propose a hash matrx to mantan all free rectangles. Ahmadna et al. [] presented a free space management based on contour of unon of rectangles (CUR) algorthm. The CUR algorthm s appled to fnd out the contour of axs-parallel rectangles. A new task can be placed n any locaton wthn the contour of axs-parallel rectangular. After fndng all feasble free spaces for an arrvng task, they use routng-conscous placement method to decde an optmal placement such as mnmum communcaton cost. In ths paper, we propose an adaptve free space management of onlne placement to fnd all canddate space wth rectangular or nonrectangular for placng newly arrvng tasks. In all feasble canddate space, we use mult-strategy ft (MSF) strategy [] to determne the best canddate space from all canddate space to place the newly arrvng task. The rest of ths paper s organzed as follows. Secton II shows how the free space s managed. The performance comparson of the proposed method wth related works wll be shown n Secton III. Fnally, Secton IV draws conclusons. II. FREE SPACE MANAGEMENT Frst of all, we brefly descrbe the system model, FPGA model and task model n onlne placement system. The onlne placement system model has followng several characterstcs. Frst, the system model knows the propertes of tasks only at runtme. Second, all tasks are no prorty. Thrd, each task s ndependent work. In FPGA model, the FPGA surface s composed of homogeneous confgurable logc blocks (CLBs) and s arranged n a two-dmensonal array. The CLB cannot be confgured alone, because currently FPGA technology confgures reconfgurable logc resources by column-based. We also assume that when confguraton area s enough, then suffcent routng resources are able to meet the requrements of the arrvng task. In task model, the parameters of a sngle task comprse task ndex, task heght, task wdth and task area. Each task area s equal to the number of CLBs. The shape of tasks can be rotated or segmented. The communcaton cost and I/O routes are not consdered n the task whle the task s placed. A more detaled descrpton of system model, FPGA model and task model are descrbed n []. In the followng, proposed effcent free space management for DPR FPGAs s descrbed.
A. Free Space Matrx In [], the free space matrx uses two forms of one-dmensonal array to mantan a two-dmensonal array wth columns and rows. So, t must scans x axs (column) and y axs (row) two tmes that s spendng tme. Moreover, the method only records the free space length of each row and column. Consequently, ths method s not apt to fnd out the contnuous free space of rectangle or nonrectangle. For mprovng the drawback, our proposed method can solve the lmt by recordng row nformaton only. Assume that a placement stuaton of FPGA surface s shown n Fg.. The proposed method only mantans free space nformaton of rows (called R) n the FPGA surface of two-dmensonal arrays, whch s gven by R = {r (,,, H)} s th row wth W {( cs j, sp j) j (,,..., )}, f FS > 0 r = (0, 0), f FS = 0 j = segmentaton quantty of free space n th row (FS ) cs j = contnuous space quantty of jth segmentaton sp j = startng pont of jth segmentaton For example, Fg. shows an FPGA dmenson wth rows and columns. In ths fgure, r = (, ) represents unts contnuous space (cs) and the startng pont (sp) form column respectvely n thrd row. The other example, r = {(, ), (, ), (, )}, represents three segmentatons of free space (j) n the eghth row. B. Resolve Canddate Space The proposed method ncludes two procedures to search canddate space for onlne placement. The frst procedure (C-Look) searches rectangular canddate space that has to meet the form of ncomng task. The second procedure (CSAF) searches nonrectangular canddate that has to equal or exceed the area of ncomng task. These two procedures are detaled descrbed n Subsecton II.B. and II.B., respectvely. B. Crcular Look When a new task requres to load nto an FPGA, there mght be a lot of canddate spaces for devotng the newly ncomng task. Therefore, we propose a procedure called crcular look (C-Look) [] to select all feasble rectangular canddate space for ncomng task. In ths procedure, all of x axs (columns) and y axs (rows) n the FPGA surface must be scanned. But, f there are spaces already used n the scannng range, these spaces wll be left out. For example, when a confguraton of new task s requred, then the scannng range of FPGA surface s llustrated as Fg.. Because the scannng range of FPGA surface s accordng to the column (tcol) and row (t) of ncomng task (see Fg. ), the scannng range (scol and s) of FPGA surface can be reduced, as shown n Fg.. The scannng range of FPGA surface are gven by (H) t = (W) T tcol = T T T T T T T T Fg. : Free space matrces s R (, ) (, ) (, ), (, ), (, ) (, ) (, ) (, ) (, ) (, ) (, ) (, ) scol Incomng task Fg. : Incomng task Scannng range of FPGA surface ss s {,,..., ( - t + )} scols j s j {,,..., ( - tcol + )} and (s s, scol sj ) Free space s of r, (sth row n the FPGA surface) sj (sj r s ), (sjth column n the FPGA surface) In addton, f the C-Look has found canddate space (cas) n sjth column (represented cas sj = True), then C-Look could leave sjth column out n the future scannng. Therefore, the new scannng range of scol s gven by scolnsj nsj { sj :( cassj Τ rue)} nsj = the new scannng rang for column n FPGA Consequently, the C-Look procedure can reduce a lot of scannng ranges. Whle searchng for canddate spaces, each free space wll check resources whch are delmted to rectangular have been used or not. If there s a totally free space, ths space has canddacy. The canddate space s gven by C k = (s s, scol nsj, t, tcol) k s the number of canddate space. Moreover, the upper bound of k s ( tcol + ).
An example for searchng the canddate space by C-Look s shown n Fg.. In ths example, the scannng ranges of C-Look are s s = {,,, } and scol sj = {,,, }. Moreover, the C-Look only scans free space n the FPGA surface such as (s, scol ) and (s, scol ) and so on. When the canddate C = (,,, ) s found, the scannng of s to s wll leave out the scol (cas = True). Smlarly, when the canddate C = (,,, ) s found, the scannng of s to s wll leave out the scol (cas = True). B. Contnuous Space of Arbtrary Form If the C-Look faled to get the canddate space, then the second proposed procedure called contnuous space of arbtrary form (CSAF) s used to search canddate space. The CSAF mproved from a wdely known algorthm contour of unon of rectangles (CUR) [][]-[] for fndng the feasble contnuous space of arbtrary form. The CSAF s based on the observaton that the free space conssts of seral contnuous rectangle spaces, as shown n the Fg.. The Fg. has four rectangles whch can be ntegrated nto a sngle nonrectangle shown as Fg.. Gven a contnuous space structure whch s shown n the Fg.. The data structure of arbtrary contnuous space (acs) s assocated wth free space matrx r. The symbols of acs data structure are defned as followng: sp cr and ep cr are represented as start pont and termnal pont cr represents scan lne n the th row at present (scan by row). seg and ta are represented as the number of segmentaton n acs and total area of contnuous space. The sp cr and ep cr are used for checkng whether t has connecton wth free space of the next row (represented cr+). If FS has connecton wth acs, the sp cr, ep cr and ta are gven by spcr = sp j ep = cs + sp cr j j cr ta = ( cs jof r) = sp j and cs j r cr, moreover, cr of r (r cr r ) Frstly, when the scan lne s n r (cr = ), the CSAF can get two ndependent contnuous spaces (acs and acs ), as shown n Fg.. Next, when the scan lne s n r (cr = ), then the acs and acs are changed, as shown Fg. (c). Thrdly, when the scan lne s n r (cr = ), the contnuous space and form of acs are determned because free space n r has no connecton wth acs, as shown n Fg. (d). Moreover, the acs s redefned agan. Fnally, when the scan lne s n r (cr = ), the contnuous space and form of acs are determned because free space n r has not connecton wth acs, as shown n Fg. (e). Moreover, the CSAF can get a new ndependent contnuous space (acs ). The CSAF may encounter three knds of stuatons, whle CSAF searches for contnuous space of the arbtrary form. The three knds of stuaton are branch to merge (BM), merge to r C C Incomng Task Fg. : An example for of searchng the canddate space by C-Look Rect. Rect. Rect. Rect. Non-Rectangle Fg. : Free space of arbtrary form conssts of smple geometry Scannng (c) R r Typedef struct Area { (sp cr, ep cr ) seg ; Total area (ta); r } Arbtrary Contnuous Space (acs);...... : Task r : Free spaces r acs ={(, ), } acs ={(, ), } acs ={(, ), } r r acs s determned (d) acs ={(, ), } acs ={(, ), } (e) acs ={(, ), } acs s determned Fg. : Contnuous space structure Scan lne n r (c) Scan lne n r (d) Scan lne n r (e) Scan lne n r branch (MB) and BM mx wth MB whch are shown n Fg.. In Fg., frst, there are two ndependent acs (acs and acs ) at the begnnng. Second, a rectangle of x to x' jons acs wth acs. Fnally, two ndependent acs merge nto one acs. Moreover, ta s sum of the area of three rectangles. In Fg., one acs s dvded nto two rectangles (l and l). However, these branches are stll the same acs. Therefore, the acs has two groups of sp cr and ep cr (represented seg = ). In Fg. (c), frstly, the precedng part s the same as Fg.. Next, a rectangle of x to x' combned ths branch. Therefore, the seg reduces form two groups to one group. The ta s sum of the area of four rectangles. For example, the Fg. shows a result of searchng canddate space of arbtrary form. In ths example, we use CSAF procedure to search the contnuous space (see Fg. ) that can get acs and acs, as shown n Fg.. However,
acs ={(x, x`) x acs acs x` acs ={(x l, x l`), (x l, x l`) l acs l acs ={(x, x`) x x` acs (the same as ) Fg. : The three knds of stuatons n CSAF that may meet: BM, two ndependent acs merge nto one acs MB, a acs has branches (seg = ) (c) BM mx wth MB, a acs has the branch and mergence acs (c) acs : Task : Free spaces Fg. : A set of exstng arbtrary contnuous spaces (whte) on a partally reconfgurable FPGA these acs(ta) have to equal or exceed the area of ncomng task. If the acs(ta) s smaller than the area of ncomng task, ths acs wll not has canddacy. Therefore, the acs must accord wth the followng condton that s gven by t tcol, has canddacy acs ( ta) < t tcol, no canddacy In the CSAF procedure, the canddate space C k s redefned as followng. The C k area can be a contnuous space of arbtrary (acs) form. The C k area has to equal or be greater than the area of ncomng task. Note that the acs area may be greater than the area of ncomng task. Therefore, each acs may has a lot of canddate spaces. The canddate spaces for newly arrvng task are selected by C-Look procedure or CSAF procedure n free space management. A ftter s used to fnd the best canddate space from all feasble canddate space to allocate for newly arrvng task. The ftter has been developed n []. The ftter consders tme factor, fragmentaton factor and modfablty factor, n order to mprove tme overhead and placement qualty, such as rejecton rate and fragmentaton. A more detaled descrpton of fttng strategy s descrbed n []. C. Adaptve Free Space Management Algorthm The detaled flow of proposed adaptve free space management (AFSM) wll be descrbed n ths subsecton. The algorthm proposed adaptve free space management s shown n Fg.. The AFSM algorthm conssts of two procedures whch descrbe n the followng. Adaptve Free Space Management (AFSM) Input: FPGA resources status, ncomng task nformaton (t and tcol) Output: All feasble canddate space for newly arrvng task begn If (ASFM has newly arrvng task requrement) { If (the number of free space greater than ncomng task area) { cs C-Look(t, tcol); /*Fnd all canddate spaces (cs).*/ If (cs > 0) Return all canddate spaces; Else { cs CSAF(t, tcol); /*Fnd all canddate spaces (cs).*/ If(cs > 0) Return all canddate spaces; Else Return the ncomng task s rejected; } } Else Return the ncomng task s rejected; } end Fg. : Adaptve free space management algorthm In step, the AFSM receves a newly arrvng task requrement from DPR FPGA system. Next, f the number of free space n DPR FPGA s greater than newly ncomng task area, then steps to are executed. Otherwse, AFSM wll return a message that newly arrvng task s rejected (step ). In step, C-Look procedure wll fnd all feasble canddate space for arrvng task accordng to task nformaton, t and tcol. If canddate space for arrvng task s found by C-Look (cs > 0, step ), the AFSM wll return all feasble canddate space to ftter (step ). Moreover, the flow of AFSM wll be end. If the C-Look procedure faled to get the canddate space, then the second procedure CSAF s used to search canddate space (Step ). If canddate space for arrvng task s found by CSAF (cs > 0, step ), the AFSM wll return all feasble canddate space to ftter (step ). Moreover, the flow of AFSM wll be end. If the CSAF procedure faled to get the canddate space, then AFSM wll return a message that newly arrvng task s rejected (step ). III. EXPERIMENT RESULTS The proposed adaptve free space management of onlne placement has been evaluated and compared n ths secton. The experment envronment uses Dev-C++ compler to evaluate the performance of proposed method. Moreover, measurement envronment have been mplemented on a Pentum D GHz PC runnng under the Wndows XP operatng system. We assume an FPGA wth sze of x0 CLBs, correspondng to the Xlnx Vrtex devce. In the expermentaton framework, we have randomly generated three dfferent knds of task sets. All of task sets are composed of 00 tasks whch have to be placed on the FPGA. In other words, all of tasks must be executed. Moreover, we assumpton those tasks are ndependence and there are no prorty. The sze of task dmensons s between to 0 CLBs. In addton, the executon tme and the arrval tme of tasks are dstrbuted form 0 to 00 tme unts and to tme unts, respectvely.
TABLE I. Performance comparson wth related works Rejecton Rate TT Executon Tme TT Watng Tme BL[] LIF[] BFIT[] Our BL[] LIF[] BFIT[] Our BL[] LIF[] BFIT[] Our Task Set.%.%.%.% 0 Task Set.0%.%.%.0% 0 0 Task Set.%.%.%.% 0 Average.%.%.%.% 00.. 00. 00. 0. Reduced.%.%.% TT: Total task. Reduced: the new method compared to [], [] and [], for example (Rejecton Rate), {[(.-.)/.] + [(.-.)/.] + [(.-.)/.]}/ =.% We also consder an mportant factor whch s to nterfere n other tasks of the same columns whle the confguraton of new task s requred. Then, the nfluenced tasks wll be suspended durng the confguraton of new task [][]-[] that causes extra tme overhead to save and restore them []. Therefore, we assume the nterfered tme s tme unts. Table I compare the rejecton rate, executon tme and watng tme of the method of Bazargan et al. [], S. P. Fekete et al. [] and M. Esmaeldoust et al. [], wth that of the proposed method. The column Rejecton Rate n Table I, clearly, the proposed method on the average has the less rejecton rate n all task sets. Therefore, the proposed method reduces.% compared wth the [], [] and []. The columns TT Executon Tme and TT Watng Tme n Table I, we have consdered the three factors [] n ths work. Clearly, the proposed method requres less executon tme and watng tme n all task sets. Therefore, the proposed method reduces.% and.% compared wth the [], [] and []. IV. CONCLUSION In ths paper, an adaptve free space management of onlne placement to fnd all canddate space for placng newly arrvng tasks n DPR FPGA systems s presented. Moreover, the proposed method uses C-Look and CSAF procedures to fnd the canddate spaces wth rectangular and nonrectangular. The expermental results show that our proposed method reduces.% n rejecton rate, reduces.% n total task executon tme and reduces.% n total task watng tme. REFERENCES [] K. Bazargan, R. Kastner, and M. Sarrafzadeh, Fast template placement for reconfgurable computng systems, IEEE Desgn and Test of Computers, Vol., pp. -, 000. [] A. Ahmadna and J. Tech, Speedng up onlne placement for XILINX FPGAs by reducng confguraton overhead, n Proceedngs of the IFIP Internatonal Conference on VLSISOC, Dec. 00, pp. -. [] H. Walder, C. Steger, and M. Platzner, Fast onlne task placement on FPGAs: Free space parttonng and D-hashng, n Proceedngs of the Internatonal Parallel and Dstrbuted Processng Symposum, Aprl -, 00, p.. [] A. Ahmadna, C. Bobda, S. P. Fekete, J. Tech, and J. v.d. Veen, Optmal free-space management and routng-conscous dynamc placement for reconfgurable devces, IEEE Transactons on Computers, Vol., pp. -0, May 00. [] Trong-Yen Lee, Che-Cheng Hu, and Cha-Chun Tsa, Mult-Strategy Onlne Placement for Dynamcally Partal Reconfgurable Devce, n Proceedngs of the Internatonal Conference on Hgh-Speed Crcuts Desgn, October -, 00, pp. H-0-H-. [] A. A. ElFarag, H. M. El-Boghdad, and S. I. Shaheen, Fragmentaton aware placement n reconfgurable devces, n Proceedngs of the th Internatonal Workshop on System on Chp for Real Tme Applcatons, Dec. 00, pp. -. [] M. Javad and I. Khan, Smulaton and performance comparson of four dsk schedulng algorthms, n Proceedngs of the IEEE TENCON 000, September -, 000, pp. -. [] A. Ahmadna, C. Bobda, S. P. Fekete, J. Tech, and J. v.d. Veen, Optmal routng-conscous dynamc placement for reconfgurable devces, n Proceedng of the Feld Programmable Logc and Applcatons, August 00, pp. -. [] R.H. Gu tng, An Optmal Contour Algorthm for ISO-Orented Rectangles, J. Algorthms, vol., pp. 0-,. [] W. Lpsk Jr. and F.P. Preparata, Fndng the Contour of a Unon of ISO-Orented Rectangles, J. Algorthms, Vol., pp. -, 0, errata n (), ; corrgendum n (), 0-0. [] F.P. Preparata and M.I. Shamos, Computatonal Geometry: An Introducton. Sprnger,. [] Xlnx, Inc. Vrtex seres confguraton archtecture user gude, Xlnx XAPP v., October 0, 00. http://www.xlnx.com/bvdocs/appnotes/xapp.pdf [] D. Mesquta, F. Moraes, J. P. L. Möller, and N. Calazans, Remote and Partal Reconfguraton of FPGA: tools and trends, n Proceedngs of the Internatonal Parallel and Dstrbuted Processng Symposum / Reconfgurable Archtectures Workshop, Aprl 00, p.. [] H. Walder and M. Platzner, Onlne Schedulng for Block-parttoned Reconfgurable Devces, n Proceedngs of the Desgn Automaton and Test n Europe, 00, pp. 0-. [] L. Levnson, R. Männer, M. Sessler, and H. Smmler, Preemptve Multtaskng on FPGAs, n Proceedngs of the Feld-Programmable Custom Computng Machnes Symposum, 000, pp. 0-0. [] S. P. Fekete, Jan C. van der Veen, A. Ahmadna, D. Göhrnger, M. Majer, and J. Tech, Offlne and onlne aspects of defragmentng the module layout of a partally reconfgurable devce, IEEE Transactons on Very Large Scale Integraton Systems, Vol., pp. -, September 00. [] M. Esmaeldoust, M. Fazlal, A. Zakerolhossen, and M. Karm, Fragmentaton aware placement algorthm for a reconfgurable system, n Proceedngs of the Second Internatonal Conference on Electrcal Engneerng, March -, 00, pp. -.