How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA...
Transcript of How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA...
![Page 1: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/1.jpg)
How Game Engines Can Inspire EDA Tools Development:A use case for an open-source physical design library
Tiago Fontana, Renan Netto, Vinicius Livramento, Chrystian Guth,Sheiny Almeida, Laercio Pilla, Jose Luıs Guntzel
Embedded Computing Lab, Computer Science DepartmentFederal University of Santa Catarina, Brazil
ISPD - March, 2017 - Portland, OR
phidian
![Page 2: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/2.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Outline
1 Introduction
2 Memory Hierarchy
3 Modularity
4 The Entity-Component System Design Pattern
5 Experimental Results
6 Conclusions
![Page 3: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/3.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modern Game Engines
Process huge amount of data
Render high-resolution graphics
Model realistic physical systems
Run artificial intelligence enginesVinicius Livramento ISPD - March, 2017 - Portland, OR 3
![Page 4: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/4.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modern Game Engines
Memory: better cache locality
Modularity: few data dependency
Parallelism: multithreading and GPU
Testing: small functionsVinicius Livramento ISPD - March, 2017 - Portland, OR 4
![Page 5: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/5.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Understanding the Memory Hierarchy
Vinicius Livramento ISPD - March, 2017 - Portland, OR 5
![Page 6: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/6.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
How Object-Oriented Design (OOD) Leads to More Cache Misses
Vinicius Livramento ISPD - March, 2017 - Portland, OR 6
![Page 7: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/7.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
How Object-Oriented Design (OOD) Leads to More Cache Misses
Vinicius Livramento ISPD - March, 2017 - Portland, OR 6
![Page 8: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/8.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
How Data-Oriented Design (DOD) Improves Cache Locality
Vinicius Livramento ISPD - March, 2017 - Portland, OR 7
![Page 9: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/9.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
How Data-Oriented Design (DOD) Improves Cache Locality
Vinicius Livramento ISPD - March, 2017 - Portland, OR 7
![Page 10: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/10.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modularity: Modeling Nets and Pins
P8P7
P2 A
BP1
P4
P3 P5
P6
N1
N2
N3
N4
Vinicius Livramento ISPD - March, 2017 - Portland, OR 8
![Page 11: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/11.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modularity: Modeling Nets and Pins Using OOD
Vinicius Livramento ISPD - March, 2017 - Portland, OR 9
![Page 12: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/12.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modularity: Modeling Nets and Pins Using OOD
Vinicius Livramento ISPD - March, 2017 - Portland, OR 9
![Page 13: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/13.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modularity: Integrating Placement and Timing Using OOD
Vinicius Livramento ISPD - March, 2017 - Portland, OR 10
![Page 14: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/14.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modularity: Modeling Nets and Pins Using DOD
Vinicius Livramento ISPD - March, 2017 - Portland, OR 11
![Page 15: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/15.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modularity: Modeling Nets and Pins Using DOD
Vinicius Livramento ISPD - March, 2017 - Portland, OR 11
![Page 16: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/16.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Modularity: Integrating Placement and Timing Using DOD
Vinicius Livramento ISPD - March, 2017 - Portland, OR 12
![Page 17: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/17.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Entities and Components (Properties)
Vinicius Livramento ISPD - March, 2017 - Portland, OR 13
![Page 18: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/18.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
The Entity System: find, create, and delete entity in O(1)
Vinicius Livramento ISPD - March, 2017 - Portland, OR 14
![Page 19: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/19.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
The Entity System: find, create, and delete entity in O(1)
Vinicius Livramento ISPD - March, 2017 - Portland, OR 14
![Page 20: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/20.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
The Entity System: find, create, and delete entity in O(1)
Vinicius Livramento ISPD - March, 2017 - Portland, OR 14
![Page 21: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/21.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Relationships Between Entities: aggregation and composition
Entity System: Nets Entity System: Pins
AGGREGATION
Net 2- Name: N2- Pins: 2 3 6
Net 1- Name: N1- Pins: 1 4 5
- Name: P6- Net: 2
Pin 6- Name: P5- Net: 1
Pin 5
- Name: P4- Net: 1
Pin 4- Name: P3- Net: 2
Pin 3
- Name: P2- Net: 2
Pin 2- Name: P1- Net: 1
Pin 1
Vinicius Livramento ISPD - March, 2017 - Portland, OR 15
![Page 22: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/22.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Relationships Between Entities: aggregation and composition
Entity System: Nets Entity System: Pins
Entity System: Nets Entity System: Pins
AGGREGATION
Net 2- Name: N2- Pins: 2 3 6
Net 2- Name: N2- Pins: 2 3 6
Net 1- Name: N1- Pins: 1 4 5
- Name: P6- Net: 2
Pin 6
- Name: P6- Net: 2
Pin 6
- Name: P5- Net: 1
Pin 5
- Name: P5- Net: --
Pin 5
- Name: P4- Net: 1
Pin 4
- Name: P4- Net: --
Pin 4
- Name: P3- Net: 2
Pin 3
- Name: P3- Net: 2
Pin 3
- Name: P2- Net: 2
Pin 2
- Name: P2- Net: 2
Pin 2
- Name: P1- Net: 1
Pin 1
- Name: P1- Net: --
Pin 1
Vinicius Livramento ISPD - March, 2017 - Portland, OR 15
![Page 23: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/23.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Relationships Between Entities: aggregation and composition
Entity System: Nets Entity System: Pins
Entity System: Nets Entity System: Pins
Entity System: Cells Entity System: Pins
AGGREGATION COMPOSITION
Net 2- Name: N2- Pins: 2 3 6
Net 2- Name: N2- Pins: 2 3 6
Cell 2- Name: C2- Pins: 2 3 6
Net 1- Name: N1- Pins: 1 4 5
Cell 1- Name: C1- Pins: 1 4 5
- Name: P6- Net: 2
Pin 6
- Name: P6- Net: 2
Pin 6
- Name: P6- Cell: 2
Pin 6- Name: P5- Net: 1
Pin 5
- Name: P5- Net: --
Pin 5
- Name: P5- Cell: 1
Pin 5
- Name: P4- Net: 1
Pin 4
- Name: P4- Net: --
Pin 4
- Name: P4- Cell: 1
Pin 4- Name: P3- Net: 2
Pin 3
- Name: P3- Net: 2
Pin 3
- Name: P3- Cell: 2
Pin 3
- Name: P2- Net: 2
Pin 2
- Name: P2- Net: 2
Pin 2
- Name: P2- Cell: 2
Pin 2- Name: P1- Net: 1
Pin 1
- Name: P1- Net: --
Pin 1
- Name: P1- Cell: 1
Pin 1
Vinicius Livramento ISPD - March, 2017 - Portland, OR 15
![Page 24: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/24.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Relationships Between Entities: aggregation and composition
Entity System: Nets Entity System: Pins
Entity System: Nets Entity System: Pins
Entity System: Cells Entity System: Pins
Entity System: Cells Entity System: Pins
AGGREGATION COMPOSITION
Net 2- Name: N2- Pins: 2 3 6
Net 2- Name: N2- Pins: 2 3 6
Cell 2- Name: C2- Pins: 2 3 6
Cell 2- Name: C2- Pins: 2 3 6
Net 1- Name: N1- Pins: 1 4 5
Cell 1- Name: C1- Pins: 1 4 5
- Name: P6- Net: 2
Pin 6
- Name: P6- Net: 2
Pin 6
- Name: P6- Cell: 2
Pin 6
- Name: P6- Cell: 2
Pin 6
- Name: P5- Net: 1
Pin 5
- Name: P5- Net: --
Pin 5
- Name: P5- Cell: 1
Pin 5
- Name: P4- Net: 1
Pin 4
- Name: P4- Net: --
Pin 4
- Name: P4- Cell: 1
Pin 4- Name: P3- Net: 2
Pin 3
- Name: P3- Net: 2
Pin 3
- Name: P3- Cell: 2
Pin 3
- Name: P3- Cell: 2
Pin 3
- Name: P2- Net: 2
Pin 2
- Name: P2- Net: 2
Pin 2
- Name: P2- Cell: 2
Pin 2
- Name: P2- Cell: 2
Pin 2
- Name: P1- Net: 1
Pin 1
- Name: P1- Net: --
Pin 1
- Name: P1- Cell: 1
Pin 1
Vinicius Livramento ISPD - March, 2017 - Portland, OR 15
![Page 25: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/25.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Infrastructure & Experimental Results
ICCAD 2015 infrastructure: 8 circuits with sizes between 768k and 1.93M cellsObjective: Analyze cache misses and runtimeScenario A: check if all circuit cells’ positions lie within the circuit’s boundariesScenario B: computing the interconnection wirelength for all circuit nets
Machine (31GB)
Processor
L3 (6144KB)
L2 (256KB) L2 (256KB) L2 (256KB) L2 (256KB)
L1d (32KB) L1d (32KB) L1d (32KB) L1d (32KB)
L1i (32KB) L1i (32KB) L1i (32KB) L1i (32KB)
Core P#0 Core P#1 Core P#2 Core P#3
PU P#0 PU P#1 PU P#2 PU P#3
Cache
Processor Elements
Vinicius Livramento ISPD - March, 2017 - Portland, OR 16
![Page 26: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/26.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Total Cache Miss for Scenario A: exploiting cache locality
Vinicius Livramento ISPD - March, 2017 - Portland, OR 17
![Page 27: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/27.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Total Cache Miss for Scenario A: exploiting cache locality
Vinicius Livramento ISPD - March, 2017 - Portland, OR 17
![Page 28: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/28.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Runtime for Scenario A: exploiting cache locality
Vinicius Livramento ISPD - March, 2017 - Portland, OR 18
![Page 29: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/29.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Runtime for Scenario A: exploiting cache locality
Vinicius Livramento ISPD - March, 2017 - Portland, OR 18
![Page 30: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/30.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Total Cache Miss for Scenario B: less benefits from cache locality
Vinicius Livramento ISPD - March, 2017 - Portland, OR 19
![Page 31: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/31.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Total Cache Miss for Scenario B: less benefits from cache locality
Vinicius Livramento ISPD - March, 2017 - Portland, OR 19
![Page 32: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/32.jpg)
Introduction Memory Hierarchy Modularity The Entity-Component System Design Pattern Experiments Conclusions
Conclusions and Perspectives
Data-Oriented design can be efficiently applied to physical design
Modular code is more suitable for parallel implementationsBetter testability
Opportunities for future work
Organize data according to access patternMultiple copies of the same vector of properties sorted in different order
Vinicius Livramento ISPD - March, 2017 - Portland, OR 20
![Page 33: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/33.jpg)
How Game Engines Can Inspire EDA Tools Development:A use case for an open-source physical design library
Questions?
Vinicius Livramento
phidian
![Page 34: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/34.jpg)
Aggregation code example
P8P7
P2 A
BP1
P4
P3 P5
P6
N1
N2
N3
N4
class Net : public entity_system::EntityBase{
};
class Pin : public entity_system::EntityBase{
};
EntitySystem<Net> nets;EntitySystem<Pin> pins;Aggregation<Net, Pin> aggregation(nets, pins);
Cell n3 = nets.add();Pin p5 = pins.add();Pin p6 = pins.add();
aggregation.addAssociation(n3, p5);aggregation.addAssociation(n3, p6);
Vinicius Livramento ISPD - March, 2017 - Portland, OR 22
![Page 35: How Game Engines Can Inspire EDA Tools Development: A use ... · How Game Engines Can Inspire EDA Tools Development: A use case for an open-source physical design library Tiago Fontana,](https://reader034.fdocuments.in/reader034/viewer/2022042310/5ed846500fa3e705ec0e2bac/html5/thumbnails/35.jpg)
Composition code example
class Cell : public entity_system::EntityBase{
};
class Pin : public entity_system::EntityBase{
};
EntitySystem<Cell> cells;EntitySystem<Pin> pins;Composition<Cell, Pin> composition(cells, pins);
Cell a = cells.add();Pin p3 = pins.add();Pin p5 = pins.add();
composition.addAssociation(a, p3);composition.addAssociation(a, p5);
P8P7
P2 A
BP1
P4
P3 P5
P6
N1
N2
N3
N4
Vinicius Livramento ISPD - March, 2017 - Portland, OR 23