Simulated Annealing in 512 bytes EMICRO2004 Microelectronics School Marcelo Johann B R A Z I L.

Slides:



Advertisements
Similar presentations
H EURISTIC S OLVER  Builds and tests alternative fuel treatment schedules (solutions) at each iteration  In each iteration:  Evaluates the effects of.
Advertisements

ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
FPGA-Based System Design: Chapter 4 Copyright  2004 Prentice Hall PTR Topics n Logic synthesis. n Placement and routing.
Neural and Evolutionary Computing - Lecture 4 1 Random Search Algorithms. Simulated Annealing Motivation Simple Random Search Algorithms Simulated Annealing.
Simulated Annealing Premchand Akella. Agenda Motivation The algorithm Its applications Examples Conclusion.
Acoustic design by simulated annealing algorithm
Meng-Kai Hsu, Sheng Chou, Tzu-Hen Lin, and Yao-Wen Chang Electronics Engineering, National Taiwan University Routability Driven Analytical Placement for.
A Size Scaling Approach for Mixed-size Placement Kalliopi Tsota, Cheng-Kok Koh, Venkataramanan Balakrishnan School of Electrical and Computer Engineering.
Early Days of Circuit Placement Martin D. F. Wong Department of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Easy Optimization Problems, Relaxation, Local Processing for a single variable.
1 Chapter 5 Advanced Search. 2 Chapter 5 Contents l Constraint satisfaction problems l Heuristic repair l The eight queens problem l Combinatorial optimization.
Math443/543 Mathematical Modeling and Optimization
Placement 1 Outline Goal What is Placement? Why Placement?
Task Assignment and Transaction Clustering Heuristics.
EDA (CS286.5b) Day 6 Partitioning: Spectral + MinCut.
Generating Supply Voltage Islands In Core-based System-on-Chip Designs Final Presentation Steven Beigelmacher Gall Gotfried 04/26/2005.
Reconfigurable Computing (EN2911X, Fall07)
EDA (CS286.5b) Day 7 Placement (Simulated Annealing) Assignment #1 due Friday.
CSE 144 Project Part 2. Overview Multiple rows Routing channel between rows Components of identical height but various width Goal: Implement a placement.
Threshold Voltage Assignment to Supply Voltage Islands in Core- based System-on-a-Chip Designs Milestone 2: Steven Beigelmacher Gall Gotfried
7/15/ VLSI Placement Prof. Shiyan Hu Office: EERC 731.
Ant Colony Optimization (ACO): Applications to Scheduling
CSE 242A Integrated Circuit Layout Automation Lecture 5: Placement Winter 2009 Chung-Kuan Cheng.
MGR: Multi-Level Global Router Yue Xu and Chris Chu Department of Electrical and Computer Engineering Iowa State University ICCAD
Escaping local optimas Accept nonimproving neighbors – Tabu search and simulated annealing Iterating with different initial solutions – Multistart local.
Section 11.4 Language Classes Based On Randomization
Placement by Simulated Annealing. Simulated Annealing  Simulates annealing process for placement  Initial placement −Random positions  Perturb by block.
Simulated Annealing.
1 Local search and optimization Local search= use single current state and move to neighboring states. Advantages: –Use very little memory –Find often.
Swarm Intelligence 虞台文.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Analytic Placement. Layout Project:  Sending the RTL file: −Thursday, 27 Farvardin  Final deadline: −Tuesday, 22 Ordibehesht  New Project: −Soon 2.
Boltzmann Machine (BM) (§6.4) Hopfield model + hidden nodes + simulated annealing BM Architecture –a set of visible nodes: nodes can be accessed from outside.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Massachusetts Institute of Technology 1 L14 – Physical Design Spring 2007 Ajay Joshi.
Placement. Physical Design Cycle Partitioning Placement/ Floorplanning Placement/ Floorplanning Routing Break the circuit up into smaller segments Place.
Modern VLSI Design 3e: Chapter 10 Copyright  1998, 2002 Prentice Hall PTR Topics n CAD systems. n Simulation. n Placement and routing. n Layout analysis.
Quadratic VLSI Placement Manolis Pantelias. General Various types of VLSI placement  Simulated-Annealing  Quadratic or Force-Directed  Min-Cut  Nonlinear.
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
An Effective Congestion Driven Placement Framework André Rohe University of Bonn, Germany joint work with Ulrich Brenner.
Online Social Networks and Media
Simulated Annealing G.Anuradha.
Optimization Problems
Parallel Graph Partioning Using Simulated Annealing Parallel and Distributed Computing I Sadik Gokhan Caglar.
Unified Quadratic Programming Approach for Mixed Mode Placement Bo Yao, Hongyu Chen, Chung-Kuan Cheng, Nan-Chi Chou*, Lung-Tien Liu*, Peter Suaris* CSE.
Network Flow Problems – The Assignment Problem
Ramakrishna Lecture#2 CAD for VLSI Ramakrishna
Local Search Algorithms and Optimization Problems
A Snap-On Placement Tool Israel Waldman. Introduction.
D EPARTMENT OF E LECTRICAL AND C OMPUTER E NGINEERING S EOUL N ATIONAL U NIVERSITY S OLVING THREE DIMENSIONAL ASSIGNMENT PROBLEM BY DETERMINANTAL POINT.
Genetic Algorithm(GA)
Hirophysics.com The Genetic Algorithm vs. Simulated Annealing Charles Barnes PHY 327.
Optimization Problems
Scientific Research Group in Egypt (SRGE)
Van Laarhoven, Aarts Version 1, October 2000
Dynamic Graph Partitioning Algorithm
VLSI Quadratic Placement
ECE 556 Project Algorithm Presentation
Mixture Density Networks
Collaborative Filtering Matrix Factorization Approach
Optimization Problems
Department of Computer Science University of York
ESP: A new Standard Cell Placement Package using Simulated Evolution
ALGORITHMS.
Topics Logic synthesis. Placement and routing..
EDA Lab., Tsinghua University
Boltzmann Machine (BM) (§6.4)
Md. Tanveer Anwar University of Arkansas
Solutions of Linear Functions
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

Simulated Annealing in 512 bytes EMICRO2004 Microelectronics School Marcelo Johann B R A Z I L

EMICRO Marcelo Johann – SA512.2 minimize total wire length (WL); minimize maximum local congestion (MLC); Placement thanks to Renato Hentschke

EMICRO Marcelo Johann – SA512.3 General Approaches Abstraction Placement with Overlaps Steps Global Placement Detailed Placement –eliminate overlaps and set exact positions Legalization –Fit into slots, grid position, mirroring

EMICRO Marcelo Johann – SA512.4 Basic Algorithms Recursive Bisection Cluster Growth, Force-Directed,... General combinatorial optimization: –Simulated annealing, simulated evolution, linear programming, quadratic assignment, resistive networks, neural networks, etc... Analytical Placement –integer programming to spread cells Most used: –simulated annealing, recursive bisection; –multi-level, Analytical;

EMICRO Marcelo Johann – SA512.5 Simulated Annealing Three basic functions: Temperature Schedule (above), Cost (wire length) and Perturbation (changes in current solution). Perturbation Cost Reject / Accept thanks to Renato Hentschke

EMICRO Marcelo Johann – SA512.6 S. A. in 512+ bytes #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} Looks crazy, but works!

EMICRO Marcelo Johann – SA512.7 S. A. in 512+ bytes #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} A big number!!!

EMICRO Marcelo Johann – SA512.8 S. A. in 512+ bytes #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} Loop a times Read a from stdin Exchange k[a] with k[b]

EMICRO Marcelo Johann – SA512.9 S. A. in 512+ bytes #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} x,y position of each node

EMICRO Marcelo Johann – SA S. A. in 512+ bytes #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} source and target of each arc

EMICRO Marcelo Johann – SA Input graph reading: number of cells and wires, number of rows and list of wires (node node) #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} S. A. in 512+ bytes

EMICRO Marcelo Johann – SA Input graph reading: number of cells and wires, number of rows and list of wires (node node) initial placement #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} S. A. in 512+ bytes

EMICRO Marcelo Johann – SA Cost function: adds the length of all arcs in the graph #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} S. A. in 512+ bytes

EMICRO Marcelo Johann – SA Temperature scheduling #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} S. A. in 512+ bytes

EMICRO Marcelo Johann – SA Perturbation: exchange a random selected pair of cells #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} S. A. in 512+ bytes

EMICRO Marcelo Johann – SA Accepting criteria (inverted) Reject if the cost is higher and the probability is not satisfied #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} S. A. in 512+ bytes

EMICRO Marcelo Johann – SA Probabilistic: inversely proportional to the temperature #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z* exp(-d/t) ){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} S. A. in 512+ bytes

EMICRO Marcelo Johann – SA Take off cost reports to get your 512-byte SA placer! #include #define z 9999 #define F(a)for(i=0;i<a;++i) #define R(a)scanf("%d",&a); #define T(k)d=k[a];k[a]=k[b];k[b]=d; long a,b,c=0,i,v,e,d,l,X[z],Y[z],E[9*z],G[9*z];double t; w(){int i;d=0;F(e)d+=abs(X[E[i]]-X[G[i]])+abs(Y[E[i]]-Y[G[i]]);return d;} main(){R(v)R(e)R(a)F(v){X[i]=i/a;Y[i]=i%a;}F(e){R(E[i])R(G[i])} for(t=z*a;c++<z*9;t*=.9){F(1){a=rand()%v;b=rand()%v;l=w();T(X)T(Y); if(d=(w()-l)>0)if(rand()%z>z*exp(-d/t)){T(X)T(Y)}}} F(v)printf("%d %d %d %d\n",i,X[i],Y[i],w());} S. A. in 512 bytes

Marcelo Johann That’s it! EMICRO2004 Microelectronics School Simulated Annealing in 512 bytes