Full text
Departament de Ciències de la Computació Ph.D. in Computing Structure discovery techniques for circuit design and process model visualization Javier de San Pedro Martín Advisor: Jordi Cortadella Fortuny Barcelona, April 2017
Abstract Graphs are one of the most used abstractions in many knowledge fields because of the easy and flexibility by which graphs can represent relationships between objects. The pervasiveness of graphs in many disciplines means that huge amounts of data are available in graph form, allowing many opportunities for the extraction of useful structure from these graphs in order to produce insight into the data. In this thesis we introduce a series of techniques to resolve well-known challenges in the areas of digital circuit design and process mining. The underlying idea that ties all the approaches together is discovering structures in graphs. We show how many problems of practical importance in these areas can be solved utilizing both common and novel structure mining approaches. In the area of digital circuit design, this thesis proposes automatically discovering frequent, repetitive structures in a circuit netlist in order to improve the quality of physical planning. These structures can be used during floorplanning to produce regular designs, which are known to be highly efficient and economical. At the same time, detecting these repeating structures can exponentially reduce the total design time. The second focus of this thesis is in the area of the visualization of process models. Process mining is a recent area of research which centers on studying the behavior of real-life systems and their interactions with the environment. Complicated process models, however, hamper this goal. By discovering the important structures in these models, we propose a series of methods that can derive visualization-friendly process models with minimal loss in accuracy. In addition, and combining the areas of circuit design and process mining, this thesis opens the area of specification mining in asynchronous circuits. Instead of the usual design flow, which involves synthesizing circuits from specifications, our proposal discovers specifications from implemented circuits. This area allows for many opportunities for verification and re-synthesis of asynchronous circuits. The proposed methods have been tested using real-life benchmarks, and the quality of the results compared to the state-of-the-art.
Acknowledgments This thesis would have been impossible without the expertise, guidance, and, sometimes, necessary insistence of my advisor, Prof. Jordi Cortadella. As all his students will attest, including myself, it is quite an opportunity to be able to work with him. I am thus extremely thankful for this opportunity, that has allowed me a firsthand view of both the academic and industrial worlds of Computer-aided design; as well as his ability to make sense even from the most terrible of my explanations. I would also like to thank every person I have had the pleasure to work with. For the extremely useful guidance during the early days, Nikita Nikitin, Prof. Josep Carmona, and Prof. Jordi Petit. For their insights on Chip multiprocessors and Networks-on-Chip, Francesc Guim, Antoni Roca and Daniel Rivas. For his knowledge on the, for me, novel topic of Process Mining, Jorge Muñoz-Gama. For our discussions on asynchronous circuits and transition systems, Thomas Bourgeat. I hope that I have been as useful to you as you have been to me in, believe me, very stressful times. And then, I would also like to thank all the people I have not been able to work with, but would have enjoyed to. From my lab colleagues working on similar topics, I would like to thank Alex Vidal, Alberto Moreno, and Lucas Machado. A special gratitude goes to Seppe vanden Broucke, Joos Buijs, and the CoSeLoG, ActiTraC, and 4TU.Datacentrum projects, for providing the benchmarks that have been used to evaluate many of the methods proposed in this thesis. Plus, big thanks to all the excellent people in UPC, including professors, researchers, and administrative staff. I obviously will not forget about all the support provided by my family, nor from all all the friends made during this experience – Daniel Alonso, Sergi Oliva, Adrià Gascón, Ramón Xuriguera, Josep Lluís Berral, Alberto Gutiérrez, Evelia Lizárraga, Eva Martinez, Carles Creus, Albert Vilamala and M. Àngels Cerveró. Good luck you all in your future endeavors! This work has been supported by a scolarship from the Catalan Government (FI-DGR 2013).
Contents 1 Introduction 1 1.1 Contributions of this thesis . . . . . . . . . . . . . . . . . . . . . . . 4 1.2 Structure of this document . . . . . . . . . . . . . . . . . . . . . . . 7 2 Preliminaries 9 2.1 Graph mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2 Process mining . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 2.3 VLSI design flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 2.4 Asynchronous circuits . . . . . . . . . . . . . . . . . . . . . . . . . . 27 2.5 Mathematical optimization . . . . . . . . . . . . . . . . . . . . . . . 31 3 Physical planning for chip multiprocessors 33 3.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 3.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 3.3 Architectural exploration . . . . . . . . . . . . . . . . . . . . . . . . 41 3.4 Floorplanning methodology . . . . . . . . . . . . . . . . . . . . . . . 43 3.5 Wire planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 3.6 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 3.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 4 Regularity-constrained floorplanning 57 4.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 4.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 4.3 Exploring regularity and hierarchy . . . . . . . . . . . . . . . . . . 61 4.4 Regular floorplanning algorithm . . . . . . . . . . . . . . . . . . . . 65 4.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 4.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 5 Log-based simplification of process models 81 5.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 5.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.3 Metrics for relevant arcs . . . . . . . . . . . . . . . . . . . . . . . . . 85 5.4 Simplification methods . . . . . . . . . . . . . . . . . . . . . . . . . . 88 5.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 5.6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 6 Structured mining of Petri nets 103 6.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 6.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 6.3 Structured mining flow . . . . . . . . . . . . . . . . . . . . . . . . . 105 6.4 Construction of an LTS from a log . . . . . . . . . . . . . . . . . . . 106 6.5 Extraction of LTS slices . . . . . . . . . . . . . . . . . . . . . . . . . . 110 6.6 Synthesis of Petri Nets . . . . . . . . . . . . . . . . . . . . . . . . . . 115 6.7 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 6.8 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120 7 Discovery of duplicate tasks 121 7.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 7.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 7.3 Local Excitation Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 7.4 Discovering duplicate tasks . . . . . . . . . . . . . . . . . . . . . . . 125 7.5 Meta-transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132 7.6 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 7.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137 8 Specification mining of asynchronous controllers 139 8.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140 8.2 Related work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144 8.3 Circuits with constrained environment . . . . . . . . . . . . . . . . 144 8.4 Specification mining . . . . . . . . . . . . . . . . . . . . . . . . . . . 148 8.5 Properties of the specification model . . . . . . . . . . . . . . . . . 151 8.6 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 8.7 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 9 Conclusions and future work 161 9.1 Summary of contributions . . . . . . . . . . . . . . . . . . . . . . . . 161 9.2 Future work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162 Bibliography 165
Chapter 1 Introduction The ever increasing amount of information generated and captured during day-to-day activities have firmly entrenched data mining as an essential part of almost every sector in the global economy. The goal of data mining is to allow the extraction of useful knowledge from large amounts of data. This data may be generated either as a by-product of other activities, e.g. trails of consumer interactions with both physical and online services, or data expressly captured by all types of sensors. Data of interest may be represented in various forms. Unstructured data is perhaps the most simple, and includes free-form text, untagged audio or video, or any other data that does not reside in fixed fields [105]. On the other hand, structured data is organized according to some model. Fixed fields, tags and other types of markers are used to separate the individual data elements. With the rise of the Internet, relational databases, semantic tagging and other advances, the amount of usable structured data has increased significantly. Furthermore, in many knowledge domains data naturally lends itself to a certain structure. It is common for trails of consumer interactions to be comprised of well-delimited events tagged with timestamps, even if the event information itself is unstructured. It is also common to find data described in terms of relations between objects, such as in relational databases, or any dataset describing a physical structure or a network. Structure mining, a subfield of data mining, centers on extracting information from all types of structured and semi-structured data. Graphs provide an ideal abstraction model for structured data. At its core, a graph represents the relationships between a set entities in a specific knowledge domain. Because of the ease and flexibility by which graphs can represent structured data, they are abundant in many topics of interest. Thus, there has been a growing interest in the structured mining of graph data, an area referred as graph mining [81].
8Chapter 1. Introduction Chapters 5–7 center on the visualization of process models. Chapter 5 introduces a method to simplify process models for visual consumption by directly removing control flow structures that are least important to reproduce the most frequent behavior in the log. In Chapter 6, we propose an alternative method that allows simplification by generating a sequence of visually-friendly process models, each of them centering on specific aspects of the process, rather than constructing a unique model that may be difficult to simplify. Chapter 7 proposes a method to exploit the concept of duplicate tasks for further simplification of process models. Chapter 8 opens the topic of specification mining for asynchronous circuits, and shows a method to obtain the specifications of asynchronous controllers with specific constraints for various delay models.
Chapter 2 Preliminaries This chapter introduces the necessary background of concepts, algorithms and knowledge areas that will be used in the rest of this document. Section 2.1 introduces the area of graph mining, which is behind most of the algorithms and methods presented in this thesis. Section 2.2 gives an overview of the area of process mining, that will be the basis of Chapters 5, 6, 7. Section 2.3 provides a tour of the basic design flow of VLSI circuits to help understand the context of Chapters 3, 4 and 8. Section 2.4 reviews the area of asynchronous circuit design used in Chapter 8. Finally, Section 2.5 summarizes the area of mathematical optimization, including satisfiability and linear programming. 2.1 Graph mining The domain of data mining concerns itself with the extraction of patterns and knowledge from data to facilitate understanding and further use of the data. Structure mining is a proper subset of data mining that centers on structured datasets. In particular, graph mining centers on providing efficient algorithms to mine structures embedded in graphs [136]. Graphs, being one of the most generic types of structure, are naturally suited to represent most types of structured datasets. Some examples of popular research areas in graph mining are [81]: frequent subgraph mining; graph classification, clustering, and search; work-flow mining. This section will provide an introduction to two of the most common subareas of graph mining, frequent subgraph mining and graph clustering.
10 Chapter 2. Preliminaries 2.1.1 Graph basics An undirected graph G = 〈V,E〉 is a two-tuple comprising a set V of vertices and a set E of edges. An edge e = {v1,v2} ∈ E is an unordered pair of vertices v1,v2∈V . We say that any two vertices v1,v2∈V are adjacent if there is an edge e = {v1,v2} ∈ E connecting them. In this case, we also say that v1 and v2 are incident to e . The degree of a vertex v∈V is the number of edges incident to v . Note that there can be only one edge between any pair of vertices v1,v2∈V . A path in G is a finite sequence of different vertices v1,..., vn∈V so that e1 = {v1,v2},...,en = {vn−1,vn} ∈ E . A path v1,..., vn∈V where v1 = vn is also called a cycle. A graph is connected if there exists a path between each pair of vertices. It is cyclic if contains any cycle. In a directed graph G = 〈V,E〉 , V is the set of vertices, while E = V2 is a set of ordered pairs of vertices. Every e = ( v1,v2 ) ∈E is a directed edge. Unlike undirected graphs, every edge e = ( v1,v2 )has a direction, with v1,v2 being the head and the tail of e respectively. In addition, v2 is direct successor of v1 , while v1is a direct predecessor of v2. A path in a directed graph respects the direction of the edges: v1,..., vn∈V is a path only if e1 = ( v1,v2 ) ,...,en = ( vn−1,vn ) ,∈E . Given a directed graph G and two vertices v1,v2∈V , if there exists a path between v1,v2 , we say that v2 is a successor of v1 , while v1 is a predecessor of v2 . Similarly to undirected graphs, a directed cycle is a path v1,..., vn∈Vin which v1=vn. A directed graph is strongly connected if there is a path between every ordered pair of vertices. Otherwise, a graph is weakly connected if there is a path between each unordered pair of vertices. A directed acyclic graph (DAG) is directed graph in which there are no cycles. Asubgraph G0 of graph G = 〈V,E〉 is another graph G0 = 〈V0,E0〉 in which V0⊆V and E0⊆E . We say G0 is an induced subgraph if for every v∈V0 , all of the incident edges of vin Gare in E0. A graph vertex labeling is a function L : V→Σ that assigns a label l∈Σ for each vertex, where Σ is the alphabet of labels. Conversely, an edge labeling L : E→Σ maps a label to every edge. Often the combination of a graph and labeling is referred as labeled graph. Planar graphs An embedding or drawing of a graph G = 〈V,E〉 on a surface S is an assignment of a unique geometric position to each vertex v∈V and of a curve to every edge e = {v1,v2} ∈ E so that the starting and ending points of the curve correspond to the positions of v1 and v2 . Unless specified, we will always assume S to be the two-dimensional plane, R2 . An embedding is planar if no two edges
2.1. Graph mining 11 intersect except possibly at the endpoints. A graph is planar if it has no planar embedding in R2. The crossing number of an embedding is the number of all intersections of the curves representing the edges (excluding the common endpoints). For a graph G , its crossing number is the minimal crossing number from all of its possible embeddings in R2 . Thus, a graph is planar iff its crossing number is 0. The crossing number of a graph has often been used as a more accurate measure of its complexity than its number of vertices or average degree. For example, the crossing number of a netlist has been used to provide bounds on the area and wire length required for routing a design [102]. Computing the crossing number of an arbitrary graph is a well-known NP- complete problem [68]. Despite that, there are several methods to estimate it. In this thesis we will use a technique derived from the mincross procedure as used in the commonly used graph drawing program dot [66]from the Graphviz suite [67]. As it is only an estimation, mincross may sometimes overestimate the number of crossings in large, dense graphs. These pathological cases, most often, are already highly complex even if the crossing number is overestimated. Graph isomorphism Two graphs G1 = 〈V1,E1〉,G2 = 〈V2,E2〉 are isomorphic if there exists a bijective function f : V1→V2 so that if any two vertices v1,v2∈V1 are adjacent in G1 iif f(v1),f(v2)are adjacent in G2. This forms an equivalence relation on graphs. Two graphs G1,G2 labeled respectively with L1 and L2 are usually only considered isomorphic if the bijection f preserves the labeling of the vertices. That is, if ∀v∈V1,L1(v) = L2(f(v)). The complexity of computing whether two general graphs are isomorphic is currently an open question. There are polynomial-time algorithms for specific types of graphs, such as for planar graphs. However, this not the case for all types of graphs, even if in practice it can often be solved efficiently [44]. Given two graphs G1,G2 , the subgraph isomorphism problem is defined as finding G0 1 , a subgraph of G1 isomorphic to G2 . Unlike graph isomorphism, the problem of subgraph isomorphism is well-known to be NP-complete [44]. 2.1.2 Frequent subgraph mining Frequent subgraph mining (FSM) [81,90]is one of the most important areas of graph mining. The objective of FSM is to extract all the subgraphs in a given dataset (a labeled graph, or a set of labeled graphs) which satisfy certain constraints. The most common goal is to find frequently recurring patterns, i.e. runs of isomorphic or almost isomorphic subgraphs with high occurrence
12 Chapter 2. Preliminaries S1 S1 S1 S1 (a) Frequent subgraph discovery. S1 S1 S1 S1 S2S2 S2S2 (b) Iteration of FSM. S1= S1 S1 S2= (c) Discovered subgraphs. Full graph S2 S1S1 S2 S1S1 (d) Discovered hierarchal structure. Figure 2.1: Frequent subgraph and structure discovery. counts. However, additional constraints may be used. For example, finding subgraphs that satisfy specific structural properties. Some of the most important applications of FSM have been seen in the domains of chemistry, biology, and web mining [81]. An example of the objectives of FSM can be seen in Fig. 2.1a [90]. We will refer to the graph shown in this figure as G . Different labels for every vertex in G are represented by different visual shapes in the figure. In G , subgraph S1 has been identified as the most frequent, since there are 4 instances of S1 in G . Any other subgraph of Gis either less frequent than S1, or has fewer vertices. Note how the south-west instance of S1in Fig. 2.1a contains an additional edge that does not exist in other instances of S1 . Most FSM algorithms allow for inexact isomorphism, in which two subgraphs are not required to be entirely isomorphic to be counted as two instances of the same pattern. Instead, an approximate measure of similarity is used, depending on the nature of the underlying problem.
2.1. Graph mining 13 Instances =12 Instances =4 Instances =2 Instances =1 4 2 1 4 2 2 ... 4 2 2 ... 2 2 ... Figure 2.2: Partial search tree of frequent subgraph mining. General-purpose FSM is a high-complexity problem because of its dependence on subgraph isomorphism, an NP-complete problem. The basic idea behind most FSM algorithms is based on two alternating steps: candidate generation and filtering. During candidate generation, each of the candidate subgraphs from the previous iteration is grown by adding new vertices and edges. The new, enlarged subgraphs form the set of candidates for the next step. This next step, filtering, counts the number of instances of each candidate subgraph: any candidate that is not frequent enough or violates any other constraint is purged. The process iterates until there are no further candidates. Figure 2.2 illustrates this by showing a potential search tree of FSM in the graph from Fig. 2.1a ( G ). The first column corresponds to the first subgraph candidate set, composed of all possible 1-vertex subgraphs of G . The number of instances of each subgraph is also shown. On each next iteration (successive columns), every candidate is extended by adding exactly one vertex. Each candidate has multiple extensions, depending on the number of possible vertex labels. Note how, given a candidate, the number of instances of each successor is
14 Chapter 2. Preliminaries Purpose Input graph Desirable subgraphs Optimizing regularity in chip floorplans (Chapter 4) Netlist Maximally frequent subgraphs. Visually simplify process models (Chapter 5) Process model (e.g. Petri net) Subgraph of a specific size that maximizes an objective function. Mine structurally-simple process models (Chapter 6) Mine specifications from asynchronous circuits (Chapter 8) Labeled transition system Subgraphs that satisfy structural properties. Table 2.1: Summary of graph mining variations proposed in this thesis. always less or equal that of the candidate. The largest, most frequent candidate found in the search tree is indicated by a dashed line. Different FSM algorithms are distinguished [81]by the candidate generation method (e.g. whether to enlarge a single vertex at at time or by combining multiple graphs), search strategy (e.g. BFS, DFS, ...), and candidate evaluation (metrics used for selecting the best graph, filtering, etc.). Adapting the algorithm to the nature of the specific application domain may allow significant reductions in the search space. Subgraph mining is a core concept behind many of the approaches proposed in this thesis. In Chapter 4, frequent subgraph mining is used to discover repetitive patterns in netlists in order to increase the regularity of floorplans. Chapter 5 shows how to simplify existing process models by extracting a single subgraph that maximizes the quality of the model while keeping the complexity under check. In both Chapter 6 and Chapter 8, graph mining is performed on top of a labeled transition system An overview of these variations is described in Table 2.1. 2.1.3 Structure discovery One of the practical applications of FSM is structure discovery, sometimes also called hierarchical clustering. The goal of structure discovery is to enhance the interpretation of data in graph form by producing a hierarchical description of the structural regularities in the data [43]. While FSM can be used to discover repeated structures in the graph, structure discovery can be used to organize these repeated structures into a hierarchical description of the data, allowing an higher level of abstraction.
2.1. Graph mining 15 A simple yet common method to perform structure discovery is by performing multiple passes of FSM. This approach is described in Fig. 2.1. Once a frequent subgraph S1 is discovered in Fig. 2.1a, each of its instances is replaced by a new vertex that acts as a placeholder to the discovered subgraph instance, as seen in Fig. 2.1b. This is commonly referred to as compressing the graph, since it reduces the size of the graph. The better a particular set of frequent subgraphs describe a graph, the more the graph will be compressed by replacing the instances of each subgraph with a placeholder vertex. Repeated iterations will discover additional subgraphs, including hierarchical ones, containing previously compressed subgraphs. This is exemplified by subgraph S2 in Fig. 2.1b, which comprises two instances of S1 . Whenever a newly-discovered subgraph is defined in terms of existing identified subgraphs, these form a hierarchy. For example, the hierarchy tree formed by S1 and S2 is shown in Fig. 2.1d. This structure describes the graph in a much more compact way, and also provides an abstracted view of the regular patterns in the graph. Structure discovery has been applied to areas such as data compression [117] or knowledge conceptual clustering [84]. The discovered hierarchies can provide varying levels of interpretation, with increased or decreased detail depending on the goals of the data analysis. As in FSM, inexact compression is often used, even allowing for potentially overlapping subgraphs. In this thesis, structure discovery is the basis of the method described in Chapter 4 to generate regular floorplans. Existing structure in the input netlist is automatically discovered and used to enhance the quality of floorplans. 2.1.4 Graph clustering Despite the name, graph clustering is the problem of trying to find sets of “related” vertices in a graph [124]. It should not be confused with the clustering of graphs themselves. Clustering in general is one of the main areas of research in data mining. Unfortunately, no single definition of a cluster is universally accepted. Formally, the vertices assigned to a particular cluster should be similar and/or connected in some predefined sense. In some applications, it is desirable for clusters of vertices to be connected: the number of edges that remain within a cluster should be high, while there should be few edges that cross cluster boundaries. In this scenario, good clusters usually form dense subgraphs. Alternatively, it might be desirable for clusters to be composed of similar vertices. The higher the similarity index, the more likely two vertices are clustered together. Computing similarities between vertices may not be necessarily
16 Chapter 2. Preliminaries simple. The most straightforward manner to compute a similarity index between two vertices is by using adjacency information, i.e., the overlap of their neighborhoods [124]. The method described in Chapter 7 to simplify process models using duplicate tasks involves clustering vertices on a transition system by their context. 2.2 Process mining The digital data revolution that is taking place worldwide requires new algorithms that enable acquiring value from the vast amount of data stored by the current technology. Process-Aware Information Systems (PAIS) are at the center of this revolution, since they are in charge of monitoring processes taking place in our daily life, like banking, municipalities, shopping, health care, etc. Event data, recorded in a PAIS in the form of event logs, denotes the footprints of process executions, and is an important source of information for reasoning on how the PAIS interacts with its environment when running its processes. The area of Process mining uses these logs to discover, analyze and extend process models [2]. Process models deliver valuable insight into the execution of the underlying processes. Models can be used to find errors in real-life systems, such as deadlocks. Bottlenecks and other factors influencing the response time of a system can be identified by using simulation techniques. A process model may also be used as description or specification of a PAIS. Discovery, one of the major areas of process mining, fosters this goal by constructing abstract process models that describe the high level structure of the process. These models are automatically learned from the execution traces of the proces, without using any other a-priori information. An additional important area in process mining is conformance, in which existing process models are compared with event logs generated by the same process. Conformance checking verifies if the behavior described by the model corresponds to the behavior observed in the event log. Deviations may be detected in either the model or the event log, indicating potential hazards in the execution of the PAIS. The area of enhancement, on the other hand, aims at changing or extending an existing process model to better reflect the behavior observed in the event log. Traces and event logs Event logs are the starting point to apply process mining techniques, guided towards the discovery, analysis or extension of process models. Informally, an event log is a set of traces, each of them being the footprint of a single execution
2.2. Process mining 17 Trace Parikh vector a b c d abcd 1 1 1 1 acba 2 1 1 0 aaaa 4 0 0 0 Table 2.2: Event log and Parikh vectors for each trace. a b c d (a) Marked graph. a bc (b) Free choice. a b c d (c) Non-free choice. Figure 2.3: Petri net types. of a process. Traces, thus, are a chronological sequence of events, such as “Request rejected”. Usually we will refer to the different types of events with a single letter, e.g. A,B,.... Let Σ be an alphabet of events. A trace is a word σ∈Σ∗ that represents a finite sequence of events. An event log L ∈ B(Σ∗)is a multiset of traces1. Given a trace σ∈Σ∗ , the Parikh vector of σ , ψ ( σ ): Σ→N maps every event e∈Σ to the number of times it appears in σ . Table 2.2 illustrates this with an example. Parikh vectors are an important concept in transition systems, as will be seen in the rest of this thesis. Events usually contain additional attributes, such as the timestamp or the actor that initiated the event. However, this work centers on the control flow itself, and thus event attributes are not used. In many scenarios we propose how the work could be improved by the use of such additional information. 2.2.1 Process models Process models are formalisms to represent the behavior of a process. Among the different formalisms, Petri nets are perhaps the most popular, due to its well-defined semantics. In this thesis, we will primary focus on Petri nets as a process model, although some of the work may be adapted to other formalisms like BPMN [140], EPC [88]or similar.
24 Chapter 2. Preliminaries Architectural Core Cache Logical A Circuit Vss AQ Vdd module M assign Q = A or not B Q B Physical Core L1 IO Router L2 Figure 2.6: Summary of the main VLSI design flow stages. chip. In the case of CMPs, this stage involves finding the promising configurations (combinations of different core architectures, on-chip memories, etc.) that satisfy the performance, cost and other requirements. 2. Logic design describes how the diverse components of a chip work. For a core, the behavior of the ALU, floating point, etc. is described. 3. Circuit design considers how to implement the logic design into an electronic circuit (selection of transistors, etc.) 4. Physical design layouts all required transistors and wires and thus determines the final geometry of the chip. Each of these stages will be described in more detail in the following sections. 2.3.1 Architectural design During architectural design the system-level structure of the chip is defined. A designer usually has a set of required metrics (desired performance, etc.) and a limited budget (in cost, chip area, power usage, etc.). In traditional CPU design, this involved deciding on parameters such as the length of the pipeline, the memory hierarchy, whether to use out-of-order execution, etc. For example, in the case of CMP design, it is generally assumed that the designer has a library of components (cores, caches, etc.) at its disposal, and that he/she needs to decide which (and how many) of those components are to be placed on the CMP, and how to interconnect each of those components. Because these components may have never been built yet, or have been manufactured before but using different physical parameters, there might be no real-world estimations of their parameters. Additionally, the high number of possible combinations and permutations of the components in the library often generates a design space with billions of possible configurations. For this reason, during architectural design fast estimators for each of the diverse component
2.3. VLSI design flow 25 metrics are necessary. Interpolation, analytical modeling or simulations are used, depending on the accuracy required. These methods will be discussed in Section 3.3. 2.3.2 Logic design At this stage, the required functionality is implemented in terms of boolean functions. The interfaces (inputs and outputs) for the different modules are also usually defined during this stage. However, logic is not necessarily specified in terms of the traditionally used logic gates. This is because during physical design there is a step, technology mapping, in which, depending on the manufacturing technology used, there might be be more efficient ways to convey boolean functions that by using the standard logic gates. 2.3.3 Circuit design During circuit design, a electronic circuit is created from the previously created logic. Exactly at which level the circuit is designed depends on the manufacturing technology. When using HDLs, this process is usually fully automated using a tool called synthesizer, which handles an HDL input and converts it to the required representation. The output is usually a list of logic gates and the connections or nets between them (a netlist). Technology mapping is the process by which the high-level logic gets mapped into lower-level elements such as cells. 2.3.4 Physical design At the start of physical design, the design is represented in terms of a netlist including all low-level components (cells, gates, transistors, ...) with their shapes and the appropriate interconnections between those components. The result of physical design is a physical layout, including both the positions of each of the design components (the placement) as well as the paths for each of the interconnections (the routing). From this stage and until the final circuit, limitations of the physical world are now taken into account. Depending on the implementation technology, design rules prohibit certain layouts. For example, by setting minimum distance between wires or forcing insertion of repeaters whenever wires exceed a certain maximum length [75]. Physical design is often split in the following sub-stages [86]:
26 Chapter 2. Preliminaries 1. Floorplanning is often the first step during physical design. A floorplan provides an estimation of the shapes and locations of the major units in the circuit. For the case of CMPs, this usually confers the locations of the individual cores, memories, etc. In a hierarchic fashion, a single core might also have a floorplan containing the locations for the arithmetic and logic units, etc. Because no physical information about the innards of the components is available at this early stage of physical design, floorplanning often uses area estimations as inputs. As more accurate estimations become available during later physical design stages, the floorplan is updated. Additionally, creating a floorplan allows early estimations of the length of the largest nets. This is often called wire planning. 2. Placement defines the final locations for the individual low-level units (e.g. cells) inside each high-level block. Unlike floorplanning, regular structures such as grids are often considered because most of the cells have similar sizes or sizes in multiples of a common base unit. 3. Clock tree synthesis. In sequential circuits, keeping the propagation delay of the clock signal to a minimum is usually mandatory to avoid clock skew. Because of this importance and singularity, the clock signal is usually the first net to be routed. 4. Global routing estimates and reserves the required routing resources that are required by the interconnections. Usually, global routing considers only those nets that use the most resources. Each net is given a estimated width depending on the design rules and the number of wires composing it, but individual wires are not considered. These estimated paths reduce the search space for the detailed routing stage that will come next. 5. Detailed routing, on the other hand, calculates the final routes for each individual wire of the chip, at the same time verifying that the previously generated global routing is feasible. 6. Timing analysis checks that all of the design’s timing constraints are satisfied. Different logic paths have different timing requirements, and during this process every factor that alters net delay is taken into account: length of wires, repeaters, transistor sizing, etc. If any of the constraints is not met, the design is reiterated, restructuring the layout of the critical paths. Thus, even the floorplan might need to be changed and the physical design process restarted.
2.4. Asynchronous circuits 27 In this thesis, Chapter 3 will center on the topic of physical design oriented towards CMPs, while Chapter 4 will expand the proposed methods towards general VLSI design. 2.4 Asynchronous circuits One the focus of this thesis will be to propose the concept of specification mining for asynchronous controllers (Chapter 8). This chapter introduces the context of this contribution by providing an overview of asynchronous circuit design. Asynchronous circuits are logic circuits that do not rely on a global synchronization signal, the clock, to dictate when signals are sampled. Instead of clocks, asynchronous circuits favor handshaking to synchronize the different components in a circuit. Asynchronous logic offers many advantages [46], among them: increased performance, reduced power consumption, and better composability and modularity. While early computers were mostly asynchronous, the prevalence of asynchronous design today has significantly decreased in favor of synchronous design and global clocks. In part, this is because of the complexity usually associated with the design of asynchronous circuits. There are few asynchronous design tools in comparison with the huge amount of well-entrenched synchronous tools. In asynchronous circuits two main parts are often distinguished: the data path and the control. While the former comprises wide units performing arithmetic or other types of transformations on the data processed by the circuit, the control unit determines and generates the diverse control signals that will configure the data path units. As control manages the synchronization requirements, this thesis will exclusively focus on the analysis of control circuits. We define a circuit Cas a tuple C=〈X,G,s0〉where: •X = I∪O∪Z is the set of signals, with I , O and Z being pairwise disjoint sets that represent the input, output and internal signals of the circuit, respectively. •G :( O∪Z ) →f ( X )is a set of gates that assigns a Boolean function to each non-input signal of the circuit. We denote by fxi ( X )the Boolean function assigned to signal xi. •s0 is a binary vector representing the value of the signals at the initial state. The environment of a circuit reacts to the outputs from the circuit and sends new inputs to it.
28 Chapter 2. Preliminaries 2.4.1 Operating modes and delay models Ahazard is a deviation from the expected behavior of a circuit caused by the delay present in real-word gates and wires. Hazards are one of the main challenges during asynchronous circuit design. To help manage the complexity associated with asynchronous circuits, several design styles have been developed. Within each style, different models and assumptions are made about the timing and behavior of physical elements of the circuit: gates, wires, and the environment. This section overviews some of the common styles. Broadly, we distinguish between delay models, i.e. assumptions about the operating delays of gates and wires, and operating modes, models about the interaction between a circuit and its environment. For an exhaustive analysis into the design of asynchronous circuits, we refer the reader to existing documentation [17,46]. Operating modes Operating modes model the interaction between the circuit and its environment. In fundamental mode [77], inputs from the environment are constrained to change only when all the outputs are stable, i.e., the environment allows the circuit to stabilize before generating new inputs. Burst mode [53]is a related operating mode in which a burst of multiple sequential input changes are allowed. However, when all inputs in the burst have changed, the environment must wait for the circuit to stabilize before starting a new burst. Compare with input-output mode [110], in which new inputs may occur at any time, as part of specified responses to changes in the outputs. Thus, input and output changes may be concurrent. Delay models The delay model defines the assumptions made, during the design, about delays in gates and wires. Strong assumptions may simplify the design flow, while less strict ones generally lead to designs that are more robust to manufacturing process variations. In this section we describe some of the common models. • In the bounded delay model, delays of both gates and wires are assumed to be lying within given minimum and maximum bounds. The circuit is guaranteed to work correctly if these bounds are satisfied. While this may lead to smaller circuits, extensive analysis is needed to ensure all bounds are met in all conditions.
2.4. Asynchronous circuits 29 C a bc (a) C-element. a b cn 0 0 0 0 1 cn−1 1 0 cn−1 1 1 1 (b) Truth table. c− a+ b+ c+ a− b− (c) Signal transition graph. 000 100 010 110 001 011 101 111 a+ b+ b+ a+ a− b− b− a− c−c+ (d) State graph. Figure 2.7: C-element and specifications. • Aspeed-independent (SI) circuit works correctly even in the presence of arbitrary but finite delay on its gates. However, it works with the assumption that wires, on the other hand, are ideal, i.e., with zero delay [110]. • A circuit is delay-insensitive (DI) when its correct operation does not depend on neither the delays in the gates nor the wires. While this is an extremely interesting class of circuits because of its robustness, unfortunately it has been proven that very few circuits can truly be made delay insensitive [106,121]. • Delay-insensitive interfacing proposes that only inputs to the circuit are required to be handled in a delay-insensitive fashion. This is a compromise in order to alleviate the impracticality of DI circuits while still allowing long interconnects. The assumption is that even if it is not practical to assume that long wires have zero delay, a designer may still keep control on the delays of short internal wires [121]. 2.4.2 Signal transition graphs The most common design methodologies for asynchronous controllers involve first specifying the behavior of the circuit and the necessary requirements from the environment. From these specifications, automated tools generate hazardfree implementations of the circuits [46].
30 Chapter 2. Preliminaries Asynchronous circuits are intrinsically concurrent, and thus naturally suited to Petri nets (Section 2.2.1), one of the most powerful formalisms for reasoning about concurrent systems. A Signal Transition Graph (STG) is formal model based on Petri nets for conveying the behavior of an asynchronous circuit. Given a circuit C=〈X,G,s0〉 , a Signal Transition Graph is a labeled Petri net N=〈P,Σ,T,L,F,m0〉 in which Σ = X× { + ,−} ∪ τ . Thus, each transition label corresponds to either the transition (rising or falling) from a signal of C , or a silent event τthat does not change the state of the circuit. By x+and x−, we will distinguish the rising and falling transitions of signal x∈X respectively. Figure 2.7c shows an example STG of a C-element, one of the fundamental components in asynchronous circuits, whose truth table is depicted in Fig. 2.7b. The C-element is a stateful element that sets its output to 0 when both inputs are 0, and to 1 when both inputs are set to 1. In any other input combination, the output does not change. 2.4.3 State graphs An STG is just a succinct representation of (a part of) the behavior of the circuit, which focuses on the causality relations amongst events. An state graph also represents the behavior of the circuit by enumerating all of its possible states and transitions between states as a Labeled Transition System (LTS). While this may result in a much larger representation than an STG, many algorithms require exhaustive explorations of the state space. For the full definition of an LTS, we refer to Section 2.2.2. Given a circuit C=〈X,G,s0〉 , an state graph of C is an LTS A=〈S,Σ,T,s0〉 in which: •S = { 0 , 1 }n , with n = |X| , the set of binary vectors representing all possible states of the signals. •Σ = X× { + ,−} , i.e. the set of signals of the circuit plus the direction of the transition. •T={s1 x −→ s2}with s1,s2∈Sand x∈Σ, is the set of transitions. • The initial state s0coincides with the initial state of the circuit. Given a state s= (x1,..., xn) , we denote by s ( xi )the value of signal xi in s . Given a state s= (x1,..., xi,..., xn) , we denote by s¬xi= (x1,...,¬xi,..., xn) the state in which the values of the signals are identical to the ones of s except for xi , that has the complementary value. Notice thus that for each s1 x −→ s2∈T , s2=s¬x 1and s1=s¬x 2.
2.5. Mathematical optimization 31 Figure 2.7d shows an example of the state graph associated to the behavior of the C-element described by the STG in Fig. 2.7c. 2.5 Mathematical optimization Many of the methods described in this thesis involve optimization problems. This section provides a brief introduction to two commonly used subfields of mathematical optimization, albeit it is not indented to cover the finer details. The approaches described in this section will be frequently used in this thesis when encoding, e.g., desired structural constraints in graphs. An optimization problem involves finding the best solution out of a set of feasible solutions. The search space of feasible solutions is delimited by a set of constraints, such as formulas, inequalities, etc. Generally, the best solution is that which maximizes (or minimizes) the value, usually defined as a real function. 2.5.1 Boolean satisfiability Aformula P is a combination of boolean variables (denoted by p,q,... ) built using the 3 logical operators and,or,not (represented respectively by ∧,∨and¬ ). An interpretation I of P is an assignment of { 0 , 1 } to each variable in P . I satisfies P iff the evaluation of P under I is 1. P is satisfiable if it is satisfied by at least one interpretation. Generally, formulas are written as conjunctions of clauses, which are disjunctions of (possibly negated) variables. Satisfiability (SAT) is the problem of determining, given a formula P , whether there is an interpretation I that satisfies it. SAT is a well-known NP-complete problem, with all known algorithms having worst-case exponential cost on the size of P[24]. The maximum satisfiability problem (MaxSAT) is the optimization version of SAT. Given an formula P , MaxSAT involves finding an interpretation that maximizes the number of clauses that evaluate to 1. Inversely, the minimum satisfiability problem (MinSAT) finds satisfying interpretations that minimize the number of clauses that evaluate to 1. As typical extensions, weights can be added to individual clauses, allowing for arbitrarily complicated optimization goals [24]. MaxSAT and MinSAT are heavily used as a natural way to model many optimization problems.
32 Chapter 2. Preliminaries 2.5.2 Linear programming A linear inequality a·x≤b is defined by a vector a∈Rn and a constant b∈R . Alinear programming problem (LP) is a set of linear inequalities plus a linear function that needs to be maximized, called the objective function. It is usually represented as: maximize cT·x subject to A·x≤b where A is a matrix with a row for every linear inequality, b contains the constant terms of the inequalities, and c is a vector with the coefficients of the objective function. A solution of the LP, thus, is a vector x∈Rn that satisfies all linear inequalities. From the potentially infinite set of solutions, a solution x is optimal if it also maximizes the objective function cT·x over the set of all solutions. An LP is feasible if it has at least one solution. There are algorithms to solve LPs in polynomial time [91]. However, the most common algorithm used is simplex, which is exponential in the worst case, although performs efficiently in practice [93]. An integer linear program (ILP) is an LP in which some of the variables are constrained to have only integer values. Unlike LP, ILP is NP-complete. There are many available methods to solve ILP. ILP solvers may also be used to solve MaxSAT problems [52].
Chapter 3 Physical planning for the architectural exploration of Chip multiprocessors At the early stages of the design of a CMPs, physical parameters are often ignored and postponed for later design stages. In this chapter, the importance of physical-aware system-level exploration is investigated. Additionally, this chapter presents an strategy for deriving chip floorplans that include physical constraints specific for tiled hierarchical CMPs. Over-the- cell routing is also used as a major area savings strategy. Wire planning of the on-chip interconnect is also studied, as its topology and organization affect the physical layout of the system. This chapter will be structured as follows. Section 3.1 introduces and motivates the topic, evaluating the impact of the physical aspects on the selection of architectural parameters. Section 3.2 reviews the existing literature. Section 3.3 describes the proposed combination of architectural exploration and physical planning. Section 3.4 and Section 3.5 give details on how to perform efficient physical planning, centering on floorplanning and wire planning respectively. Finally, in Section 3.6 the proposed flow is evaluated, with future work and conclusions discussed in Section 3.7. 3.1 Motivation This section will justify the need to adapt the traditional physical design flow with physical planning constraints during CMP design. In addition, it will show how using this new physical design flow during early design stages improves the quality of designs and minimizes the number of design reiterations.
40 Chapter 3. Physical planning for CMPs A 16% increase in area may induce an unacceptable overhead in manufacturing cost. This fact may encourage a designer to select an alternative architectural configuration, with a slightly lower performance, although with better floorplan properties. 3.2 Related work Floorplanning as a part of the VLSI design flow has been extensively studied for decades. The traditional definition involves minimizing a linear combination of area and estimated wire length [85], leaving actual wire planning to posterior stages in the design process. Hierarchical approaches to floorplanning have already been shown to reduce the algorithm runtime. Quite often hierarchical floorplanning is applied to the design of Systems-on-Chip (SoCs), for which every component can be considered as a fixed-size block. These blocks can be generated using fixedoutline floorplanners such as [12], while the system-level floorplanning can be solved using the traditional minimal area techniques such as [37]. In this work, we will instead exploit the regularity of tiled hierarchical CMPs. When floorplanning a CMP, it might also be desirable to optimize factors other than area and wire length. Previous approaches exist that evaluate floorplans based on other qualities such as temperature minimization [109,123] or power consumption [129], using analytical models. For floorplanning at the system-level, [145]proposes a method that creates tile arrangements which minimize the overall wire length for several 3D topologies. Floorplanning with constraints is also commonly considered in modern floorplanning [131]. For example, restrictions on the valid placement of blocks: adjacency constraints, limits in the distance between pairs of blocks, and objects in fixed positions [146]. Specifically considering CMP constraints at this stage, as in this chapter, is less common. In [142]the authors show how over-simplified models for those constraints (e.g., disregarding pin placement) produces suboptimal floorplans, but only for classic bus-based interconnects. On the integration of floorplanning with earlier design stages, the work in [20]incorporates a linear programming-based floorplanner into a synthesis framework for application-specific System-on-Chips. The floorplanner is used to obtain better area estimates. The influence of physical information on system performance at the microarchitectural level was studied in [42]. The authors proposed physical planning to estimate area and link delay, which were then used to refine the accuracy of throughput estimations obtained by simulation.
3.3. Architectural exploration 41 3.3 Architectural exploration This section overviews the flow for architectural exploration of CMPs and introduces the context for physical planning. Consider the problem of maximizing CMP performance (throughput) subject to a resource budget, i.e. constraints on area and power. The given formulation is an example of the architectural exploration problem with the objective of efficiently distributing the chip resources among the components of a multi-core system, e.g. cores, memories and interconnect. The design space for exploration is specified through a set of models and design constraints. The models describe the behavior of individual components. There can be different models for cores characterizing different microarchitectural features that trade-off area, power and performance (in-order/out- of-order execution, multi-threading, etc). The memory models define the size, area and latency of different memory modules. The models for the interconnect define their physical and performance properties (latency, contention, etc). The expected workload for the CMP requires another type of models that characterize the observable behavior produced by the generated memory patterns (memory locality, burstiness, etc). Constraints on power consumption and area are typically defined to confine the design space. Exploration is a complex optimization problem due to the vast discrete space of architectural variables that determine the configuration of a CMP (e.g. number of cores, cache sizes, interconnect topology, link width). To handle this complexity, in this work we resort to a three-stage divide-and- conquer approach to solve the exploration problem. Figure 3.6 illustrates our methodology, with the main stages being the architectural exploration,physical planning and validation. Architectural exploration During the first stage, analytical models are used to rapidly prune the design space and generate a set of promising configurations in the area/power/ performance space. The analytical model from [114]is used to evaluate CMP configurations and discriminate those with poor performance. Static and dynamic power are also evaluated using analytical approximations based on the area and activity of the CMP components [115]. The area is approximated as the sum of the areas of all components on chip. Analytical models are used as a cost estimator for an iterative metaheuristicbased search to efficiently navigate through the design space. This space is described with a set of architectural variables and a set of transformations is defined to explore the neighborhood of any particular configuration. Some
42 Chapter 3. Physical planning for CMPs Cores On-chip caches Off-chip memories Interconnects Workloads Models (performance/power) Number of cores Cluster size L2/L3 cache size Intra-cluster interconnect Inter-cluster interconnect Architectural configuration Cluster-level floorplan Wire length estimation Generation of configurations Analytical modeling Simulation Pool of promising configs Wire planning Floorplanning Architectural exploration Physical planningValidation Area Throughput Power Constraints Search direction Cores Caches Interconnects Physical info Figure 3.6: Modified architectural exploration flow that includes physical planning. examples of transformations include modifying the dimensions of the top-level mesh, the number of cores per cluster or the topology of the local interconnect, among others. Simulated Annealing [92]and Extremal Optimization [26]are used to explore the design space by probabilistically applying transformations and tracking the best discovered solution. Physical planning The objective of this stage is to evaluate wire length and give a more accurate area estimation. The floorplanning and wire planning algorithms at this stage consider physical constraints for individual CMP components, such as the aspect ratio and the number of metal layers. This accuracy comes at the expense of a higher algorithmic cost, which is however tolerated by performing the planning for a moderate number of configurations, selected during the first stage. Validation Finally, the validation phase of the flow is aimed at verifying performance and power, which may differ from the initial analytical estimates. In the current setup we use a cycle-accurate simulation for CMP interconnect, supplied with probabilistic automata models for cores and memories [55]. The following sections will focus on algorithms for the physical planning of hierarchical CMPs. Their objective is to accurately estimate the chip area and wire length, subject to the physical constraints. The methods proposed in this work are applied at the second phase of the described exploration flow.
3.4. Floorplanning methodology 43 A B C h v A B C Figure 3.7: Example of a slicing floorplan and associated slicing tree. 3.4 Floorplanning methodology This section presents the first step of physical planning: floorplanning. 3.4.1 Floorplan representations Floorplanning is the task of defining tentative locations for the blocks of system under certain geometric constraints. The blocks represent pre-designed CMP components such as cores, memories and routers. The blocks can either have a fixed size or accept a set of different aspect ratios. The traditional floorplanning problem only considers the minimization of the total area occupied by the components. More advanced floorplanning strategies can also consider the minimization of other metrics such as the estimated wire length. Because of the complexity of the problem, it is essential to select efficient data structures to represent floorplans. In this work, we use Simulated Annealing for the exploration of slicing floorplans similarly as proposed in [141], where the cost function is defined as a linear combination of area and wire length approximated with half-perimeter wire length. In addition, the cost function is extended with other components that aim at generating floorplans with some properties and constraints for tiled hierarchical CMPs. Slicing trees Slicing trees [141]is one of the most popular floorplan representations. It can represent only a family of floorplans called slicing floorplans. This subset of all possible floorplans contains only floorplans that can be represented entirely by a series of horizontal or vertical cuts. A slicing tree is just a tree representation of such series of cuts (see Fig. 3.7). It has been proven that slicing trees, when combined with a compaction post-process, can represent all possible maximally compact layouts of any given library of components [99]. Hence the use of the slicing floorplans does not limit the search space. In this work, compaction is not applied and the generation of area-optimal floorplans is not guaranteed. However, the difference is expected to be acceptable, specially in the presence of soft blocks [147].
44 Chapter 3. Physical planning for CMPs C h CB CC BB C B C B C B C B x y (2,1)(2,1) x y (2,4) (4,2) x y (2,4+1) (4,2+1) Figure 3.8: Example of vertical composition of the bounding curves for two components Band C. Bounding curves To represent the possible shapes of the individual components, bounding curves are used. A point ( x,y )belongs to the bounding curve of a component if x and y are a valid width and height for that component (Fig. 3.8). There are efficient vertical and horizontal composition operations on bounding curves [116]to calculate all the valid aspect ratios of such compositions. 3.4.2 Search strategy Algorithm 1 Floorplanning algorithm (Simulated Annealing) FP←“Initial slicing floorplan” T←“Initial temperature” while improvements in the last kiterations do for piterations do select FPnew randomly from neighbors of FP gain ←COST(FP)−COST(FPnew) if RANDOMACCEPT(T,gain)then FP←FPnew T←T·α return FP Even reducing the search to slicing floorplans, the space of solutions is high enough that the use of metaheuristics is unavoidable [144]. The floorplanning process described in this work uses an extension of the Wong-Liu algorithm, except for changes to the cost function that will be described in this section and Section 3.4.3. The Wong-Liu algorithm [141]is a customization of Simulated Annealing [92]for the search of slicing trees. It defines a neighborhood function
3.4. Floorplanning methodology 45 NoC Router Core Cache FEOL m1 Area available for interconnect m2 m3 m4 m5 m6 BEOL Figure 3.9: Multi-layered CMOS technology: FEOL includes the front-end layers (polysilicon and diffusion), m1-m6 represents the available metal layers. consisting of three movements that operate on top of Polish expressions, which are a string representation of slicing trees. An overview of the search procedure is presented in Algorithm 1. One important ingredient of any Simulated Algorithm is the cost function. To allow trade-offs between area and other factors to be explored, we introduce weights to the different factors of the cost function: COST(FP)=αArea(FP) + βWL(FP) + γWLEq(FP) + P(FP) In this expression, FPis the floorplan being evaluated, Area is defined as the effective area of the floorplan, WL is the sum of the wire length estimation for each net, and WLEq is the sum of the squares of the estimated wire lengths for nets in the ring interconnect, if any. The goal of WLEq is to penalize floorplans where equidistantly-spaced nets have excessively diverging lengths. The last term, P(FP), aggregates all possible penalties. We will explain each of these factors in more detail in section Section 3.4.3. The α , β and γ parameters are weights that a designer can use to guide the search towards floorplans with smaller area or towards floorplans with smaller wire lengths. An example of this trade-off will be seen in Section 3.6. 3.4.3 CMP-aware floorplanning In Section 3.1 we mentioned some of the requirements for the physical planning of tiled hierarchical CMPs. In this section we address them in more detail. Over-the-cell routing Current CMOS-VLSI design is multilayered. Individual devices such as transistors are patterned on the bottom layer, which in modern fabrication is composed of polycrystalline silicon (polysilicon)[139]. This layer is often called the front
46 Chapter 3. Physical planning for CMPs end of line (FEOL). Successive layers are applied that can be used to make connections between the different transistors and external connections, collectively called the back end of line (BEOL). An example can be seen in Fig. 3.9. The BEOL layers are used for the required wiring inside the various CMP components. However, different component types have different requirements of routing resources. On-chip memory often uses less layers than more complex circuits such as cores. If the input data models this, these free layers can be used for the wires between the different CMP components. Because of the prevalence of cache memories in CMP tiles, we can assume that every configuration can be routed using the available metal layers on top of the components without requiring any extra whitespace. During floorplanning, and as part of the wire length estimation that will be described later in this section, unroutable configurations are discarded. Abutability Because only a single tile of a chip is floorplanned, some nets that connect different clusters will have floating terminals that must be placed on one of the boundaries of the tile. However, the placement of this terminal must lie adjacent to the placement of a corresponding terminal on the next cluster. Thus, a special symmetry constraint is created between pairs of nets. All the global interconnectnets have this property. Wire length constraints Due to performance reasons, certain critical nets must have a wire length constraint. In case these constraints are violated the floorplan is rejected. This maximum length will depend on the desired interconnect operating frequency, wire sizing and other parameters [80]. Equidistantly-spaced nets For most interconnects, the communication delay is determined by the maximum length of a set of links. For example, in a ring, the cycle period must be long enough to allow packets to propagate across the longest of the ring hops. In these cases, it is desirable not to strictly minimize the total wire length, but to balance the individual lengths of the respective links. For this reason, nets that must satisfy this requirements are evaluated differently in the cost function (Section 3.4.2), minimizing the sum of the squares of the lengths instead: WLEq(FP) = X ∀net∈Ring WL(net)2
3.4. Floorplanning methodology 47 0 0 00 0 1 1 2 2 3 3 4 4 4 5 5 55 6 6 76 8 7 7 8 9 1 23 3 4 4 5 5 4 6 N S R Figure 3.10: Maze routing a pair of nets with abutability constraint (floorplan from Fig. 3.4, blockages marked in black). Wire length estimation A good wire length estimator is important for the evaluation of the cost function. Wire length estimations are used in the WL ( FP )and WLEq ( FP )terms of the cost function. Additionally, it is used to check satisfiability of some of the constraints, such as abutability and wire length limits. In over-the-cell routing, the only space considered for routing is the free space over the components that have the top metal layers available. Since cores and routers typically implement a complex internal wiring and thus utilize the highest number of layers, memories are the only components in the entire design that leave some metal layers unused. In fact, the relative area of memories in a tile is defined by the configuration, but it usually ranges between 50%-60% for the best configurations as seen in our tests. Thus, the lowest metal layers will typically have no space for routing, while the upper layers will have up to 60% of space available, thereby making overthe-cell routing possible. An example can be seen in Fig. 3.10, which represents a middle metal layer from the floorplan in Fig. 3.4, with the area occupied by components marked in a dark color. The work upon this floorplanning algorithm has been based on, [141], proposes the use of the half-perimeter wire length as an estimator. In this work, we propose the use of Lee’s algorithm [119], often known as Maze routing. The reduce the complexity of the algorithm, three relaxations are applied:
48 Chapter 3. Physical planning for CMPs 1. Routing full links, not individual wires 2. Routing each net independently, so that no collisions are considered 3. Routing is performed on one metal layer only Thus, routes might be generated that may be found unfeasible during wire planning. However, for the case of nets with two terminals, we can guarantee that a route found using this method is a valid lower bound. Thus, this information can be used to verify wire length and routability constraints. Because of simplification (1), the size of the routing grid is determined by the minimum link width. The use of Lee’s algorithm also enables checking for violations of the abutability requirement. When planning pairs of nets with such requirement, the algorithm will only accept a path if a matching path has been found on the opposite side for the paired net. The algorithm also will not stop at the first path, but rather collect all paths and select the one where the route is shortest to both opposing extremes of the tile. In Fig. 3.10, this algorithm is applied to estimate the length of the two vertical mesh links (from the Router to the north side and from the Router to the south). The shortest route for the north net is discarded because at the opposing side of the tile (same column, last row) there has been no path found for the south net. A more accurate estimation of routability is performed during wire planning (Section 3.5) to discard those floorplans that are unroutable when considering all signals simultaneously. 3.5 Wire planning In order to fully realize the floorplan estimated in the previous section, we need to establish a wire planning that connects all the required nets between the components and that allows the tiling of the cells. This wire planning must use over-the-cell routing and minimize its wire lengths, while balancing the nets. This problem corresponds to a routing problem and we solve it in two steps. In the first step, we formulate the routing problem as a Boolean satisfiability problem for which we obtain a feasible solution with a SAT solver. Then, in the second step, we iteratively reduce the wire length of several nets by converting the satisfiability problem to an integer linear programming problem that we solve with an ILP solver. In the following, we describe their essential elements.
3.5. Wire planning 49 Top view Cross-section view Figure 3.11: Grid structure used for wire planning. 3.5.1 Problem formulation We formulate the routing problem as a Boolean satisfiability problem in the lines of [78], which we extend with some insights that are needed in the context of CMPs. At this early design stage, wire planning is only performed on the wide communication links of the system, neglecting local control wires. These links can have more than 10 3 wires, e.g. full cache lines with data, address and control bits. The routes are calculated globally for the complete links and not for the individual wires that compose each link. The routing region is represented by a uniformly-sized coarse grid (Fig. 3.11). The grid unit is determined by the minimum width of a link, w = n·p , where n is the number of wires of the narrowest link and p is the wire pitch, i.e., the smallest distance between wires. Routing is performed on a 3D grid with blockages according to the metal layers occupied by the CMP components, as illustrated in Fig. 3.9. The main variables of the SAT problem correspond to the presence (or absence) of a wire segment between two adjacent nodes of this 3D grid. Another set of variables encodes the assignment of wire segments to specific nets. The SAT problem includes several types of constraints: • Consistency constraints enforce the expected behavior of the variables we have introduced, e.g., if an edge is assigned to a net, then the edge must be occupied by a wire. • Routability constraints define a legal routing between the components. Basically, these constraints establish that a set of wire segments guarantee the connectivity of all pins of a net. The formulation is similar to the one presented in [78]but extended to handle floating terminals. Our
56 Chapter 3. Physical planning for CMPs address the issues of physical planning for alternative interconnect topologies, such as crossbars. Additionally, the accuracy of performance prediction can be improved by using physical information while estimating the system throughput. Another important task is to look for alternative approaches to physical planning in order to speed-up the phase of system-level design for CMPs.
Chapter 4 Regularity-constrained floorplanning The complexity of the VLSI physical design flow grows dramatically as the level of integration increases. An effective way to manage this increasing complexity is through the use of regular designs which contain more reusable parts. In this chapter we introduce HiReg, a new floorplanning algorithm that generates regular floorplans. In Chapter 3, the benefits of regular designs were already demonstrated with tiled Chip multiprocessors (CMPs). In a tiled CMP, there is a single design for a tile that is designed once but replicated many times, thereby reducing the design effort. HiReg goes further and automatically extracts repeating patterns in a design by using graph mining techniques, without any information from the designer. As will be seen, this also allows HiReg to extract multiple hierarchical levels of repeating patterns, instead of being limited to a single tile pattern. Regularity is exploited by reusing the same floorplan for multiple instances of a pattern, as long as neither area, wire length or existing hierarchy constraints are violated or compromised. Experiments will show the scalability of the method for many-core CMPs and competitive results in area and wire length with traditional floorplanners. This chapter starts by giving a brief motivation of the problem in Section 4.1. The current state of the art is reviewed in Section 4.2. Section 4.3 uses an example to demonstrate the challenges solved by the presented approach. Section 4.4 describes the inner workings of HiReg. In Section 4.5, HiReg is compared with other floorplanning tools to evaluate the benefits of regularity. Conclusions are discussed in Section 4.6.
58 Chapter 4. Regularity-constrained floorplanning 4.1 Motivation The computational complexity of the floorplanning problem highly depends on the number of components of the system. For large systems, a flat view makes the floorplanning problem intractable. For this reason, hierarchical methods [135,143]has been proposed and successfully used to reduce this complexity. Hierarchical methods divide the floorplanning problem into multiple subproblems that may be either fully or partially independent from each other, thereby enhancing scalability. An important metric often disregarded during floorplanning is regularity, known to lead to efficient and economical designs [128]. Large-scale systems have significant amounts of regular patterns than can be exploited (on-chip memories, many-core CMPs, etc.). The design cost of such systems can be brought down by reducing the number of distinct subcircuits to be designed, and then replicating the pre-designed subcircuits as many times as possible. To allow this reduction, a regular floorplan uses the exact same layout for all replications of a subcircuit. To reduce complexity of timing closure, it is also desirable for all of the adjacent components to be placed in similar relative positions, so that the interconnect geometries are regular and timing analysis is similar. In many-core CMPs, tiled layouts [16]are often used to exploit regularity, as in the previous chapter. The design is split into homogeneous tiles that are only floorplanned once and then replicated. However, with industry moving towards heterogeneous CMPs [97], it is no longer possible to assume that most CMPs will have only a single type of tile. Integrated graphics, accelerators and I/O blocks are some of the special types of co-processors that introduce heterogeneity. On the other hand, enforcing regularity in a design may compromise other floorplan metrics such as area or wiring. Existing designs are often hierarchical in nature. CMPs with hierarchical topologies are a good example. Preserving the pre-defined hierarchy may result in a better wiring quality (e.g. by reducing the number of wires that cross between different subcircuits). Very often, hierarchy is manually enforced by designers to split the design and assign components to different design teams. Thus, breaking the existing hierarchy could be counterproductive to the goal of simplifying design. Another example is the concept of choppability [122]. In a choppable floorplan, large functional blocks can be chopped away, reducing the total die size and varying performance/power metrics in order to construct multiple versions of a product from the same basic design. In this chapter we introduce a new floorplanning algorithm, HiReg, that considers area, wiring, regularity and hierarchy as floorplanning objectives. Very often these objectives are conflicting, e.g., reducing final area compromises regularity and vice versa. To deal with this issue, HiReg uses a new method
4.2. Related work 59 C C C M M C C C C C M C C M C C C M C C C C M C MCCCCCCM M C C C C C C M C M C C C C M C C C M C C M C C C C C M M C C C (a) Diamond pattern r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r rr r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r rr r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r rr rr r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r r rr r r r r r rr rr r r R RR R RR R R RR R R RR R R RR R R R RR R RR R R R RR R R RR R R R R RR R R RR R RR R R RR R R RR R R RR R R R R L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2 L2L2 C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C CC C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C CC C C C C C C C C CC C C C C C C C C C C C C CC C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C C CC C C C C CC C C C C C C C C C C C C C C C C C C C C C C C C C C CC C CC C C C C C C MC MC MC MCMC MC MC MC MC MC MCMC MC MC MC MC L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 L3 Buf Buf Buf Buf Buf Buf Buf Buf Buf Buf Buf Buf Buf Buf Buf Buf (b) CompaSS R rC L2 r C L2 rC L2 r CL2 r L3 r R r C L2 rC L2 r CL2 r C L2 rL3 r R r C L2 rC L2 r CL2 r CL2 rL3 r RMC Buf R MC Buf R r CL2 r C L2 r CL2 r C L2 r L3 rR r C L2 rC L2 r CL2 r C L2 r L3 r Rr C L2 r C L2 r C L2 r C L2 r L3 r R r CL2 r C L2 rC L2 rC L2 r L3 r R rCL2 r C L2 r CL2 rC L2 r L3 r RMC Buf R r C L2 rC L2 r CL2 r CL2 rL3 r R rC L2 rCL2 r C L2 rC L2 r L3 r R MC Buf R r C L2 rC L2 r CL2 r C L2 r L3 r R r C L2 r C L2 rC L2 r CL2 r L3 r R r CL2 r CL2 r C L2 r C L2 r L3 r RMC Buf R r C L2 r C L2 r CL2 r CL2 r L3 r R r C L2 rC L2 r CL2 r C L2 rL3 r R r C L2 rC L2 r CL2 r C L2 r L3 r R r CL2 r C L2 r CL2 r C L2 r L3 rR MC Buf R r C L2 r C L2 r C L2 r C L2 r L3 r R MC Buf R r C L2 rC L2 r CL2 r CL2 rL3 r R rCL2 r C L2 r CL2 r CL2 r L3 r R r CL2 r C L2 rC L2 r CL2 r L3 r R r C L2 rC L2 r CL2 r C L2 r L3 r R rC L2 r C L2 r CL2 rC L2 r L3 r R r CL2 r CL2 r C L2 r CL2 r L3 r R MC Buf R MC Buf R r CL2 r C L2 r CL2 r C L2 r L3 r R r C L2 rC L2 r CL2 r C L2 rL3 r R r C L2 r C L2 r C L2 r C L2 r L3 r R r C L2 r C L2 r CL2 r CL2 r L3 r R r C L2 rC L2 r CL2 r C L2 rL3 rR r CL2 r CL2 r C L2 r C L2 r L3 r RMC Buf R rC L2 rC L2 r C L2 rC L2 r L3 r R MC Buf R r C L2 rC L2 r CL2 r C L2 rL3 r R r CL2 r C L2 rC L2 r CL2 r L3 r R rCL2 r C L2 r CL2 r CL2 r L3 r R rC L2 r C L2 r CL2 rC L2 r L3 r R MC Buf R r C L2 rC L2 r CL2 r CL2 rL3 r R r C L2 rC L2 r CL2 r C L2 rL3 r R r CL2 r C L2 r CL2 r C L2 r L3 rR MC Buf R r C L2 r C L2 r C L2 r C L2 r L3 r R r CL2 r CL2 r C L2 r C L2 r L3 r RMC Buf R rCL2 r C L2 rC L2 rC L2 r L3 r R r C L2 rC L2 r CL2 r C L2 rL3 r R r C L2 rC L2 r CL2 r C L2 rL3 r R r C L2 r C L2 rC L2 r CL2 r L3 rR r CL2 r C L2 r C L2 r CL2 r L3 r R MC Buf R MC Buf R r C L2 rC L2 r CL2 r CL2 r L3 r R r C L2 r C L2 rC L2 rC L2 r L3 r R r CL2 r C L2 rC L2 r CL2 r L3 r (c) DeFer r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r (d) HiReg Figure 4.1: Example CMP floorplans generated using different floorplanning strategies. that can trade-off hierarchy and regularity constraints. Both hierarchy and regularity are automatically discovered from the block netlist. 4.2 Related work There has been little work in the area of regular floorplans. Regularity is more common in the area of physical design for analog circuits, where it is often a strict requirement due to the peculiarities of analog design [15]. However,
60 Chapter 4. Regularity-constrained floorplanning Hierarchy Regularity [38]No Arrays only REGULAY [145]Yes Tiles only DeFer [143]Yes No CompaSS [37]By similarity No [135]Yes No ArchFP [64]Manual Manual HiReg Yes Yes Table 4.1: Comparison of related work. most of the techniques in analog design involve symmetry properties that are not relevant for maximizing design reusability. [38]acknowledges the importance of regular designs in CMPs and describes a simulated annealing-based floorplanner that organizes groups of similar blocks in regular arrays. However, the technique does not fully exploit regularity since adjacent components may not be placed in aligned locations that enable regular interconnection geometries. The blocks that are to be placed in regular groups must also be manually selected by the designer. In System-on-Chip design, REGULAY [145]also mentions the importance of preserving regularity and hierarchy. REGULAY discovers the optimal mapping of heterogeneous tiles into a regular grid arrangement, and does not consider the floorplanning of the individual tiles themselves. On the other hand, the advantages of using hierarchy during floorplanning are not new [49]. Nonetheless, most existing work uses hierarchy only to improve the scalability of the floorplanning problem, allowing efficient generation of floorplans with large numbers of components, and differ in the methodologies used to discover hierarchy. DeFer [143]uses graph bipartitioning to generate a binary tree of balanced netlist partitions, a method similar to the one proposed in this work for hierarchy discovery. This hierarchy tree is then used to generate a slicing tree, reducing the number of floorplans that need to be explored during the search. CompaSS [37]automatically clusters blocks with similar or identical shapes, and then creates grid floorplans for them. However, CompaSS ignores connectivity information. [135]applies a recursive slice-and-partition method derived from cell placement strategies. All three examples use slicing floorplans and bounding curves that will also be used in this work to efficiently represent floorplans. Slicing floorplans are not able to represent the entire set of optimal floorplans. However, this difference is minimal given a large number of soft blocks [147], as it often occurs in CMPs.
4.3. Exploring regularity and hierarchy 61 Component Area Aspect ratio Core (C) 1.38 mm20.8 or 1.25 L2 cache 1 mm20.5 ÷2 L3 cache 3 mm20.5 ÷2 Ring router (r) 0.27 mm21 Mesh router (R) 0.99 mm21 Memory controller (MC) 2.5 mm20.8 or 1.25 Buffer (Buf) 12 mm20.5 ÷2 Table 4.2: Physical information for Fig. 4.1. Whitespace HPWL (m) CompaSS 6.3% 6801 DeFer 8.2% 630 HiReg 12.6% 516 Table 4.3: Floorplanning results for Fig. 4.1. ArchFP [64]describes a different strategy that can produce floorplans that are both regular and hierarchical. However, ArchFP assumes that a designer will construct, previously to the floorplanning process, a manual hierarchy of the CMP components and will choose a floorplanning approach for each group of components. Our work extracts hierarchy and regularity in an automated way, without any previous knowledge of the topology of the input netlist. Table 4.1 summarizes the differences between these strategies. 4.3 Exploring regularity and hierarchy This section will use an example to illustrate the trade-offs between regularity and hierarchy. Figure 4.1 shows the result of floorplanning the same netlist using HiReg and two other hierarchical floorplanners. Table 4.3 contains whitespace and wire length results. This netlist represents a hierarchical tiled CMP, with 192 cores. It contains 64 tiles, with 48 processing tiles containing 4 cores each, and 16 memory controller tiles. This CMP uses a hierarchical Network-on- Chip topology. An 8 × 8 mesh interconnects all tiles. Inside each tile, a ring provides connectivity. The mapping of processing and memory controller tiles has been selected to match the diamond pattern (Fig. 4.1a, [9]) which maximizes off-chip memory performance. Thus, this configuration is representative of a potential many-core CMP design. For the sake of easy visualization, both types of tiles have similar
62 Chapter 4. Regularity-constrained floorplanning C C C M M C C C C C M C C M C C C M C C C C M C MCCCCCCM M C C C C C C M C M C C C C M C C C M C C M C C C C C M M C C C (a) Regularity without hierarchy CL2 r CL2 r r C L2 rC L2 rr R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 R MC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 RMC Buf CL2 r CL2 r r C L2 rC L2 rr R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 R MC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 RMC Buf C L2 r C L2 rr C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 R MC Buf CL2 r CL2 r r C L2 rC L2 rr R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 R MC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 r r C L2 r C L2 r r R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 R MC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 RMC Buf CL2 r CL2 r r C L2 rC L2 rr R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 R MC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 RMC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 r r C L2 r C L2 r r R L3 RMC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 r r C L2 r C L2 r r R L3 RMC Buf C L2 r C L2 rr C L2 r C L2 r r RL3 CL2 r CL2 r r CL2 r CL2 r r R L3 CL2 r CL2 r r CL2 r CL2 r r R L3 C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 r r C L2 r C L2 r r R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 R MC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 RMC Buf CL2 r CL2 r r C L2 rC L2 rr R L3 CL2 r CL2 r r C L2 rC L2 rr R L3 R MC Buf C L2 r C L2 r r C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 C L2 r C L2 rr C L2 r C L2 r r R L3 RMC Buf (b) Floorplan generated from (a) C C C M M C C C C C M C C M C C C M C C C C M C MCCCCCCM M C C C C C C M C M C C C C M C C C M C C M C C C C C M M C C C (c) Regularity preserving hierarchy r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r RMC Buf r L2 C r L2 C r L2 C r L2 C R L3 r r (d) Floorplan generated from (c) Figure 4.2: Example floorplans with and without hierarchy constraints.
4.3. Exploring regularity and hierarchy 63 area requirements in this example. In general, each tile may have a different area constraint. In addition to cores ( C ), processing tiles contain L2 caches private to each core, a tile-shared L3 cache block, ring routers for intra-tile communication ( r ) and mesh routers for inter-tile communication ( R ). The memory controller tiles each contain a buffer (Buf), mesh router, and a memory controller itself (MC). Physical information is described in Table 4.2. Cores come in several hard aspect ratios, but we assume memories to be flexible within a limited range. We also assume every net represents a link with 1024 wires. In Fig. 4.1b, CompaSS groups blocks by similarity and creates arrays in order to improve packing quality, thus resulting in floorplans that have some regularity. However, connectivity information is not considered, resulting in floorplans with good area metrics but poor wire length. DeFer minimizes area and wire length, and uses hierarchy to floorplan efficiently. In Fig. 4.1c, we disabled compaction in order to easily visualize the effects of hierarchy, but it was enabled for obtaining the results in Table 4.3. Because of hierarchy, the floorplan is divided in 4 quadrants, with each quadrant also divided in 4 quadrants, and so on. However, small differences in the floorplans used for every quadrant prevent reusing the same design for all subquadrants. The construction of hierarchy from connectivity information results in a 2% area increase compared to CompaSS, but generates a significantly reduced wire length. HiReg, on the other hand, constructs a floorplan that exploits the regularity and hierarchy inherent to a tiled CMP design. It is able to extract additional regularity by grouping cores inside tiles in blocks of 2. This tiled structure is discovered despite HiReg not having any previous knowledge of the interconnect topology. The use of hierarchy and regularity causes an additional 4% area increase over DeFer results, but generates a 20% reduction in wire length. Because of regularity, the entire CMP can now be constructing by replicating the two types of tiles. At the same time, two cores in every processing tile can be constructed by replication, resulting in significant design time savings. 4.3.1 Discovering regularity In order to create regular floorplans, HiReg automatically finds repeating patterns in the input netlist. We define a pattern as a subgraph from the netlist. We consider a pattern P to be repeated if there is at least one additional subgraph in the netlist isomorphic to P . We call all the repetitions of P the instances of P . An example of the way HiReg extracts regularity is shown in Fig. 4.4a. The initial netlist contains 4 instances of the same pattern (composed of C , L 2 and r each). After identifying this pattern, HiReg compresses the graph, replacing
64 Chapter 4. Regularity-constrained floorplanning C C P1= M C C P2= C C M C C M P3= (a) Patterns used in Fig. 4.2a Full CMP Left half Right half NE corner SE corner SW corner NW corner (b) Discovered hierarchy tree Figure 4.3: List of patterns and hierarchy tree. C L2 r C L2 r L3 r C L2 C L2 r r L3 r L3 r r R r R r R (a) Regular extraction process Full CMP L3 r C L2 r CL2 r R (b) Generated DAG Figure 4.4: Regular extraction process and example generated DAG. every instance with a new vertex, representing the compressed instance. The process iterates until no additional patterns can be found. Because of this iterative process, the result of regularity discovery is actually a directed acyclic graph (Fig. 4.4b). In this DAG, there is a leaf node (with no exit edges) for each component type in the netlist. Every other node represents a pattern. An edge between two patterns Pa , Pb indicates that pattern Pa contains an instance of Pb . The root pattern (with no entry edges) represents the entire original netlist. HiReg uses this DAG to apply a divide-and-conquer strategy. Instead of floorplanning the entire netlist, the problem is split into floorplanning every pattern. To ensure regularity, HiReg enforces using the same or similar floorplans for all instances of a pattern, albeit this restriction may be relaxed if better area or wire length results are required. 4.3.2 Trading off regularity and hierarchy An important contribution of this chapter is the importance of preserving existing hierarchy when discovering regularity.
4.4. Regular floorplanning algorithm 65 Our initial approach completely disregarded hierarchy and centered on regularity as defined in Section 4.3.1. The regularity extraction process is primarily based on local decisions and lacks a global vision of the entire netlist. By centering on regularity only, the results may contradict existing design hierarchy, which can be counterproductive to the goal of reducing design time. A visual example is shown in Fig. 4.2. This example shows a CMP design identical to the one in Fig. 4.1, containing processing ( C ) and memory controller ( M ) tiles. In a and b floorplanning is performed using discovered regularity only, without preserving hierarchy. c and d show the results of floorplanning using both regularity and hierarchy discovery. The set of repeating patterns that have been extracted to construct a are shown in Fig. 4.3a. Because the regularity discovery process lacks global vision of the netlist, it discovers a set of patterns that break the natural tile hierarchy of the CMP. Despite patterns P1 and P2 being frequent patterns, using these to compress the netlist limits further extraction of regularity. The only remaining patterns left after compressing the netlist with P1 and P2 are combinations that do not respect the mesh topology, such as P3 . P3 groups a non-rectangular set of tiles. In these situations, good area and wire length metrics cannot be obtained if the same layout must be strictly replicated for all instances of P3 . Thus, the regularity of the design is compromised, as shown in Fig. 4.2b. In HiReg, existing netlist hierarchy is automatically discovered using recursive graph bisection (similar to [143], described in Section 4.4.1). The recursive graph bisection procedure divides the design into a recursive series of area-balanced partitions. To account for topologies with a non-power-of-two number of partitions, HiReg allows for up to 1-to-3 imbalance in the area of the automated bisections. Alternatively, the hierarchy information may be provided by the designer. This hierarchy information is represented as a tree, such as the one in Fig. 4.3b, which guides the regularity discovery process. Specifically, no pattern instances can cross boundaries delimited by hierarchy. In Fig. 4.2c, no pattern instance was allowed to extend to more than one CMP quadrant, based on the hierarchy tree discovered by bisection (Fig. 4.3b) which separates the four CMP quadrants. This restriction reduces the number of P1 instances, but eventually allows a larger number of more regular patterns to be found. In this way, maintaining hierarchy adds a global vision to the regularity extraction process. 4.4 Regular floorplanning algorithm The algorithm can be divided in 5 stages, as seen in Fig. 4.5. The first 3 stages of the algorithm perform hierarchy discovery and regularity discovery based on
72 Chapter 4. Regularity-constrained floorplanning by a post-order walk in the hierarchy tree. This is similar to the techniques used in other hierarchical floorplanners [37,143]. Every regular hierarchy tree is a directed acyclic graph where every non-leaf node is a subcircuit representing a regular pattern, and and edge between P1 and P2 indicates that P1 ’s definition contains an instance of P2 . Only once the bounding curves for every children of a pattern P have been constructed the algorithm can proceed to construct the bounding curve of Pitself. To construct the bounding curve of a pattern P , two different search strategies are used depending on the number of blocks n . For patterns where n is less than a threshold N , an exhaustive branch-and-bound search algorithm is used. This algorithm explores every possible slicing floorplan. If n≥N , a more efficient heuristic search based on simulated annealing and slicing trees is used. This heuristic search generates a much reduced number of results than the branch-and-bound approach, but is capable of handling patterns with a much larger number of components. The threshold N depends on the specifications of the host computer, such as the amount of available memory. The bounding trees for each hierarchy tree are combined into a single bounding curve that represents the outlines of all floorplans found. Because many hierarchy trees will contain similar sets of patterns, HiReg uses memoization in order to decrease the runtime of this stage. 4.4.5 Floorplan construction After selecting a subset of points from the final bounding curve ( Γ ), the final stage of the algorithm constructs floorplans starting from the outlines specified by these points. A single point in a bounding curve can represent multiple floorplans with the same outline, including floorplans that only differ in mirroring and simple block swapping (but also floorplans with entirely different layouts that happen to share the same outline). Because the outline is fixed, the selection of these floorplans cannot affect whitespace, but it may have a significant impact on the wire length and regularity metrics. The algorithm in Algorithm 6 implements a greedy search that finds a combination of floorplans for a selected point P of the bounding curve that minimizes a given cost function comparing wire length and regularity. By manipulating the cost function, the designer is able to guide the search to either enforce more regular floorplans, or on the other hand prefer floorplans with increased connectivity quality. An important technique used during this process is terminal propagation [59]. When selecting a floorplan for a pattern T , we know the layout and positions of all instances of other subpatterns t1,t2,..., tn contained in T . Thus, for all
4.5. Results 73 nets that have a terminal in a child subpattern ti , but also have other terminals in any other subpatterns of T , the algorithm can propagate the approximate terminal positions of those terminals outside ti . This allows calculation of the wire length when selecting floorplans for ti, even for nets external to ti. Algorithm 6 Floorplan construction function CONSTRUCTFLOORPLANS(P,T) .P is the selected point of Γ .T is the hierarchy tree that was used F←floorplans from Γwith size P for all tin CHILDREN(T)do propagate terminal positions from Fto t p←shape of tin F Ft←CONSTRUCTFLOORPLANS(p,t) select combination of F1,..., Fnthat minimizes COST(F,F1,..., Fn) expand Fwith F1,..., Fn return F function COST(F,F1,F2,..., Fn) return WIRELENGTH(F1)+WIRELENGTH(F2)+... number of floorplans in F1,F2,... with the same layout To increase floorplan quality or in order to generate more than one result, HiReg combines this algorithm with the technique of beam search [120]. Instead of keeping a single current solution, the bbest solutions are kept. 4.5 Results We implemented HiReg in C++ and tested it on a set of design examples. All the experiments in this section were run on a Intel Xeon 2.8Ghz CPU with 32GB of RAM. While the implementation can make use of multiple cores, it was limited to a single thread for fair comparisons. METIS [87]was used to generate the graph bisections required for hierarchy discovery. Since there is little previous work on regularity-constrained floorplanning for multi-processors, there are not many available benchmarks designed to compare the quality of regular floorplans. Commonly used floorplanning public domain benchmarks are mostly from old designs that do not contain much regularity. Thus, during this section, we will use artificial benchmarks based on many-core CMP designs. It is hard to give a numerical metric for regularity in a floorplan. For HiReg generated floorplans, we can provide an estimation of regularity based on the
74 Chapter 4. Regularity-constrained floorplanning C1 L2 r C1 L2 r r L3 C1 L2 r C1 L2 r r R C2 L2 r r L3 r rL2 C2 R AB BABA... BA Figure 4.7: Netlist used for the scalability and quality experiments. regularity DAG used to generate them. Every node in the DAG with multiple input edges represents a sublayout that has been replicated. Thus, a regularity metric can be built by comparing the area of all nodes in this DAG with an expanded version where none of the layouts are replicated: Regularity =1−area of DAG area of equivalent expanded tree Because other tools do not target the creation of regular floorplans, we cannot provide similar regularity metrics for non-HiReg floorplans. 4.5.1 Heterogeneous tiled CMP example We start this section by mentioning the results presented during Section 4.3, the heterogeneous tiled CMP. We also show the differences in wire length from a floorplanning that preserves hierarchy versus one that does not. The netlist used represents a CMP containing 64 tiles, with 48 tiles being processing tiles, containing 4 cores each, and 16 memory controller tiles. The tiles are arranged according to the diamond pattern from [9]. The benchmark has a total of 816 blocks. The physical information for these blocks is shown in Table 4.4. For this example CMP configuration, HiReg generates a floorplan (Fig. 4.2d) with 12.6% whitespace and a HPWL of 516 m . Up to 81% of the floorplan area is regular. This floorplan was used by combining hierarchy and regularity. HiReg automatically prefers floorplans where hierarchy is preserved to around the tile level, as those provide the best regularity with minimal loss in other metrics. For comparison, the floorplan in Fig. 4.2b, which was created without hierarchy constraints, has a slightly worse whitespace (13.5%), worse regularity (66.6%
4.5. Results 75 0.1 1 10 100 1000 200 2000 100 1000 Floorplanning runtime [secs.] Number of components HiReg DeFer 0 2 4 6 8 10 200 2000 100 1000 Total whitespace [%] Number of components HiReg DeFer 101 102 103 104 200 2000 100 1000 HPWL [m] Number of components HiReg DeFer Figure 4.8: Comparison of runtime, area and wire length.
76 Chapter 4. Regularity-constrained floorplanning Component Area Aspect ratio Global ring routers (R) 0.27 mm21 Clusters of type A 4×Core (C1) 1.38 mm20.8 or 1.25 4×L2 cache 1 mm20.5 ÷2 1×L3 cache 3 mm20.5 ÷2 6×Local ring router (r) 0.27 mm21 Clusters of type B 2×Core (C2) 3.75 mm20.8 or 1.25 2×L2 cache 2 mm20.5 ÷2 1×L3 cache 6 mm20.5 ÷2 4×Local ring router (r) 0.27 mm21 Table 4.4: Physical information for Fig. 4.7. of area) and a much worse HPWL ( 1076 m ). These hierarchy-less floorplans were explored but discarded by HiReg because of the lower metrics. When compared to other tools (Table 4.3), HiReg provides results that are competitive in wire length but slightly less in area. We configured DeFer to optimize for area and wire length given a maximum aspect ratio constraint of 4 5 . CompaSS was configured to optimize for area within the same aspect ratio constraint. HiReg used 15.4 seconds to generate that example floorplan. 13% of the time was spent during hierarchy and regularity discovery, 27% of the time was spent floorplanning all the discovered patterns, and 60% generating the final floorplans. Both DeFer and CompaSS took less than one second to generate the floorplans. 4.5.2 Scalability and floorplan quality This experiment measures the loss of optimality in area and wire length caused by the use of regularity, as well as measure the execution time required for the implemented algorithm. We compare HiReg, configured to optimize for maximum regularity, to DeFer, configured to optimize for both area and HPWL. All the test cases were generated based on the configuration shown in Fig. 4.7. This configuration is a ring of rings, where a global ring connects a set of clusters of two alternating types. The physical characteristics are detailed in Table 4.4. For this example, every net contains 1024 wires, and the wire pitch is 0.1 µm . This configuration is used in this testcase because the total number of clusters in the ring can be easily parameterized, providing multiple testpoints with different numbers of components.
4.5. Results 77 r L2 C2 r L2 C2 r r r L2 C1 r L2 C1 rL2 C1 rL2 C1 L3 R R r r L3 r L2 C2 r L2 C2 r r r L2 C1 r L2 C1 rL2 C1 rL2 C1 L3 R R r r L3 r L2 C2 r L2 C2 r r r L2 C1 r L2 C1 rL2 C1 rL2 C1 L3 R R r r L3 r L2 C2 r L2 C2 r r r L2 C1 r L2 C1 rL2 C1 rL2 C1 L3 R R r r L3 r L2 C2 r L2 C2 r r r L2 C1 r L2 C1 rL2 C1 rL2 C1 L3 R R r r L3 r L2 C2 r L2 C2 r r r L2 C1 r L2 C1 rL2 C1 rL2 C1 L3 R R r r L3 r L2 C2 r L2 C2 r r r L2 C1 r L2 C1 rL2 C1 rL2 C1 L3 R R r r L3 r L2 C2 r L2 C2 r r r L2 C1 r L2 C1 rL2 C1 rL2 C1 L3 R R r r L3 A B BABABABA ABAB B A A B (a) r L2 C2 r L2 C2 R L3 r r r L2 C2 r L2 C2 R L3 r r r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C2 r L2 C2 R L3 r r r L2 C2 r L2 C2 R L3 r r r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C2 r L2 C2 R L3 r r r L2 C2 r L2 C2 R L3 r r r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C2 r L2 C2 R L3 r r r L2 C2 r L2 C2 R L3 r r r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr B A A B A B B A A BBBBB AAAA (b) Figure 4.9: Regular floorplans for two different ring configurations. Figure 4.8 shows the results of the comparison. For a highly regular netlist such as the one used in this experiment, the runtime growth of both hierarchical floorplanners (proposed and DeFer) is close to linear. However, a purely hierarchical floorplanner such as DeFer is still much faster. On the other hand, the results show that both the whitespace and HPWL of floorplans generated by HiReg are comparable to the results provided by DeFer. 4.5.3 Trading off hierarchy and regularity Figure 4.9 shows two different potential configurations for the ring configuration described in Fig. 4.7. These two configurations differ in the organization of the global ring. In configuration a, clusters A and B appear in alternating order in the global ring. Configuration b contains the same clusters but configured so that clusters of the same type are grouped together. The net for the global ring is shown in both figures as a dashed line. For Fig. 4.9b, HiReg generates a regular floorplan where the different cluster types are strictly separate. The floorplan provides good whitespace metrics because the similar clusters are being packed into arrays. However, in case a, such packing would not be possible without impacting wire length. Therefore, the best floorplan found by HiReg relaxes hierarchy a bit, and combines the two cluster types into a single repeating pattern, providing better packing. HiReg can also be configured to further relax regularity when improved wire length or other metrics are preferable. In figure 4.10, we show three different floorplans for the configuration in Fig. 4.9b. Figure 4.10b and c are generated by varying the cost function mentioned from Section 4.4.5, while a
78 Chapter 4. Regularity-constrained floorplanning 100 110 120 130 140 150 0 0.2 0.4 0.6 0.8 1 (b) (c) HPWL [m] Regularity HiReg DeFer R r C1 L2 r C1 L2 r C1 L2 rC1 L2 rL3 r R rC1 L2 r C1 L2 r C1 L2 rC1 L2 rL3 r R r C1 L2 r C1 L2 r C1 L2 rC1 L2 r L3 r R r C1L2 r C1 L2 r C1 L2 rC1 L2 r L3 r R rC1 L2 r C1 L2 r C1 L2 r C1 L2 r L3 r R r C1 L2 r C1 L2 r C1 L2 r C1 L2 rL3 r R r C1 L2 r C1 L2 r C1 L2 r C1 L2 rL3 r R r C1 L2 r C1 L2 r C1 L2 r C1 L2 rL3 r Rr C2 L2 r C2 L2 rL3 r Rr C2 L2 r C2 L2 rL3 r Rr C2 L2 r C2 L2 rL3 r Rr C2 L2 r C2 L2 rL3 r R r C2 L2 r C2 L2 r L3 r R r C2 L2 rC2 L2 r L3 r R r C2 L2 r C2 L2 r L3 r R r C2 L2 r C2 L2 r L3 r (a) DeFer r r r r C2 L2 C2 L2 L3 R R r r r r C2 L2 C2 L2 L3 r r C1 L2 C1 L2 r r C1 L2 C1 L2 r r L3 R R r r C1 L2 C1 L2 r r C1 L2 C1 L2 r r L3 r r r r C2 L2 C2 L2 L3 R R r r r r C2 L2 C2 L2 L3 r rC1 L2 C1 L2 r r C1 L2 C1 L2 r rL3 R R r r C1 L2 C1 L2 r r C1 L2 C1 L2 r r L3 r r r r C2 L2 C2 L2 L3 R R r r r r C2 L2 C2 L2 L3 r r C1 L2 C1 L2 r r C1 L2 C1 L2 rr L3 R R r r C1 L2 C1 L2 r r C1 L2 C1 L2 r r L3 r r r r C2 L2 C2 L2 L3 R R r r r r C2 L2 C2 L2 L3 r rC1 L2 C1 L2 r r C1 L2 C1 L2 r rL3 R R r r C1 L2 C1 L2 r r C1 L2 C1 L2 r r L3 (b) r L2 C2 r L2 C2 R L3 r r r L2 C2 r L2 C2 R L3 r r r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C2 r L2 C2 R L3 r r r L2 C2 r L2 C2 R L3 r r r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C2 r L2 C2 R L3 r r r L2 C2 r L2 C2 R L3 r r r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C2 r L2 C2 R L3 r r r L2 C2 r L2 C2 R L3 r r r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr r L2 C1 r L2 C1 r L2 C1 r L2 C1 R L3 rr (c) Figure 4.10: Trading off regularity and wire length in configuration described in Fig. 4.9b
4.6. Conclusions 79 is generated using DeFer. The plot shows how by trading off regularity, HPWL can be improved, approaching the HPWL of the floorplan generated by DeFer for the same configuration. As DeFer does not generate regular floorplans, the plot uses only its HPWL as baseline for comparisons. 4.5.4 Publications As part of this research topic we have published the following conference article: • J. de San Pedro, J. Cortadella, and A. Roca, A hierarchical approach for generating regular floorplans, in Proceedings of the 33th IEEE/ACM International Conference on Computer-Aided Design, San Jose, California, USA, 2014. 4.6 Conclusions This chapter has introduced HiReg, a new floorplanning tool that generates regular floorplans while preserving the inherent regularity of the design. The method is specially suited for CMPs with many cores and can handle systems with heterogeneous tiles. The method delivers layouts with high regularity and acceptable area, and also reduces wire length when compared to other hierarchical approaches.
80 Chapter 4. Regularity-constrained floorplanning
Chapter 5 Log-based simplification of process models The visualization of models is essential for user-friendly human-machine interactions during Process mining. A simple graphical representation contributes to give intuitive information about the behavior of a system. Quality-preserving model simplifications can be of paramount importance to alleviate the complexity of finding useful and attractive visualizations. This chapter presents a collection of log-based techniques to simplify process models. The techniques trade off visual-friendly properties with quality metrics related to logs, such as fitness and precision, to avoid degrading the resulting model. The algorithms, either cast as optimization problems or heuristically guided, find simplified versions of the initial process model, and can be applied in the final stage of the process mining life-cycle, between the discovery of a process model and the deployment to the final user. A tool called PNsimpl has been developed and tested on large logs, producing simplified process models that are one order of magnitude smaller while keeping fitness and precision under reasonable margins. This chapter is organized as follows. Section 5.1 exemplifies the goals of this work with a simple example, and Section 5.2 compares these goals with the state of the art. In Section 5.3, a log-based technique to estimate the importance of arcs and places in a Petri net is described. Section 5.4 proposes several algorithms to simplify a Petri net using this information. The techniques are evaluated in Section 5.5. Finally, conclusions are discussed in Section 5.6.
88 Chapter 5. Log-based simplification of process models 5.4 Simplification methods The triggering and utilization scores computed in previous section provide an estimation of the importance of the arcs in replaying the log. Arcs F ( p,t ) 6 =0 with high trigger score correspond to frequent situations in the model where more behavior should not be allowed (i.e., the arc, and therefore p , is frequently disabling certain transitions to occur). By keeping these arcs/places in the model, one aims at deriving a model where precision is not degraded. Conversely, an arc F ( t,p ) 6 =0 with high utilization score denotes a situation where transition t is frequently fired (thus frequently adding tokens to p ), and therefore should not be removed to avoid degrading fitness. In this section, 3 different approaches to the simplification problem are shown. Figure 5.3 illustrates these approaches by applying each one to the input model shown in Fig. 5.3a. The first approach reduces the input to a Petri net that is visually close to a series-parallel graph, removing the least important arcs and places according to their scores (Fig. 5.3b). However, it has the greatest computational cost. We introduce a second approach that reduces the simplification problem to an Integer Linear Programming (ILP) optimization problem that is more efficient and optionally guarantees the preservation of fitness (Fig. 5.3c and d). These two techniques use scoring information computed from the log, as described in the previous section. The third approach, however, does not consider this information. Instead, the Petri net is projected into different structural classes: free choice (Fig. 5.3e) and state machine (5.3f). The following subsections will describe each one of these approaches in detail. 5.4.1 Simplification to a Series-Parallel Net A series-parallel net is one obtained by the recursive series or parallel composition of smaller nets. Series-parallel Petri nets are amongst the most comprehensible types of models. In a series-parallel net, forks and choices (and thus concurrency) are immediately visible. In fact, existing documentation often uses series-parallel nets as examples to illustrate concepts related to Petri nets. For this reason, one of the main contributions in this work is a heuristic that reduces a complex Petri net into an almost series-parallel net. The algorithm iteratively removes the least important edges until the graph is either strictly series-parallel, or no additional reduction can be applied without losing the connectedness of the net. The importance of every arc is determined by their trigger score T ( p,t ), for place-transition arcs, and their utilization score U ( t,p ) for transition-place arcs. The approach is grounded in the notion of a set of reduction rules, explained below.
5.4. Simplification methods 89 b d e g f c a (a) Original model using the algorithm in [138]. a c g f db e (b) Simplified to series-parallel. a c d b g e f (c) Simplified using ILP model. ac fg e b d (d) Simplified using ILP model, preserving fitness. bd c f e g a (e) Simplified to free choice. f b a g d e c (f) Simplified to state machine. Figure 5.3: Overview of the different simplification techniques.
90 Chapter 5. Log-based simplification of process models (a) Reduction rule. (1) (2) (b) Source Petri net (with rule violations). (c) Transformed net. Figure 5.4: Applying a transformation and transformation cost. Reduction rules In [112]a set of reduction rules used for the analysis of large Petri net systems is introduced. Each of the transformations preserves liveness, safeness and boundedness of a Petri net. Thus, verification of these properties can be done in the simplified net instead of the original one. The transformations proposed are: fusion of series places/transitions,fusion of parallel places/transitions and elimination of self-loop places/transitions. A rule can be applied only when its preconditions are satisfied. An example of the fusion of parallel places rule can be seen in Fig. 5.4a. Because of the construction of a series-parallel Petri net, it is possible to reduce such a net to a single place or transition by recursive application of these transformations. Therefore, every violation of the preconditions of a rule indicates a subnet which is not series-parallel. To reduce a Petri net to a series-parallel skeleton, this work uses these reduction rules in an indirect way. We do not use the transformed Petri net that results from the application of the rules. Instead, the proposed method removes those arcs and places which prevent the rules from being applied. For every one of the reduction rules, a transformation cost is defined: the sum of the trigger and utilization scores of all the arcs that would need to be removed in order to apply such transformation. The transformation cost therefore models the importance of the arcs that would need to be removed. Figure 5.4 shows an example rule, the computation of its transformation cost, and the resulting graph after applying the transformation rule. This rule can only be applied in this input Petri net if two arcs (dashed lines in Fig. 5.4b) are removed. Thus, the transformation cost is equal to the trigger score of arc (1) and utilization score of arc (2).
5.4. Simplification methods 91 Algorithm Algorithm 8 describes the main iteration of the method. Function APPLICABLETRANSFORMATIONS identifies all possible applications of the reduction rules, and computes the transformation cost for each of the possible applications. Algorithm 8 Series-Parallel algorithm Input: A Petri net N0=〈P,Σ,T,L,F,m0〉 , a trigger score T ( p,t )for every (p,t)arc, and a utilization score U(t,p)for every (t,p)arc. Output: A simplifed Petri net N←N0 M←APPLICABLETRANSFORMATIONS(N) while |M|>0do m←transformation with least cost from M N0←APPLYTRANSFORMATION(N,m) if N0is disconnected then M←M\ {m} continue N0←N0\PRECONDITIONVIOLATINGARCS(N,m) N←N0 M←APPLICABLETRANSFORMATIONS(N) return N0 At every iteration the transformation m with the least cost is selected, that is, the one that requires removing the least amount of important arcs in order to be applied. Function APPLYTRANSFORMATION applies such transformation m . If applying the transformation breaks the net into more than one connected component, the next best transformation is selected instead. Otherwise, function PRECONDITIONVIOLATINGARCS enumerates all the arcs that had to be removed in order to satisfy the preconditions of transformation m . Those arcs are removed them from the original Petri net N0 . The next iteration repeats the process on the transformed net N0 , finding new APPLICABLETRANSFORMATIONS only around the nodes that were changed on the previous iteration. Once no additional reduction rules can be applied (e.g. because the net is now a single place or transition), the algorithm stops. The currently graph N is discarded, and the result of the algorithm is the simplified Petri net N0 . A final postprocessing step removes unneeded places (e.g. without incident arcs). The nets generated by this heuristic are not necessarily fully series-parallel, since arcs necessary to preserve connectivity are never removed. This is the only method from this work that presents such a global guarantee, with the
92 Chapter 5. Log-based simplification of process models other methods providing weaker connectivity constraints. It is also possible to configure the method to generate strictly series-parallel models. 5.4.2 Simplification Using ILP Models This section shows a different approach to simplify a Petri net for visualization. The selection of which arcs to remove is seen as an optimization problem, and modeled as an Integer Linear Program (ILP). The use of ILP allows for highly efficient solving strategies. On the other hand, some constraints cannot be modeled using ILP. For example, the models attempt to preserve connectivity of the net at a localized level (i.e. ensuring transitions maintain at least one predecessor and successor place), but cannot guarantee global net connectivity. The aim of the ILP model is to reduce the number of arcs as much as possible. The inputs are a Petri net N=〈P,Σ,T,L,F,m0〉 , trigger scores T ( p,t )and utilization scores U ( t,p ). We define a binary variable S ( p )for every p∈P , and a binary variable A ( p,t )or A ( t,p )for every arc in N . In a solution of this model, variable S ( p )is 0 when place p is to be removed from the input graph (similarly for arc variables A ( p,t )and A ( t,p )). Below we describe the ILP model in detail. min X F(p,t)>0 A(p,t) + X F(t,p)>0 A(t,p)(5.1) s.t. ∀p∈P:S(p)⇐⇒ X t∈p• A(p,t)>0∧X t∈•p A(t,p)>0 (5.2) X F(p,t)>0 T(p,t)A(p,t)>=Γ(5.3) X F(t,p)>0 U(t,p)A(t,p)>=Φ(5.4) ∀t∈T:X p∈t• A(t,p)>0∧X p∈•t A(p,t)>0 (5.5) ∀p∈P:M(p)>0=⇒S(p)(5.6) ∀t∈T,p∈P:F(t,p)>0∧S(p) =⇒A(t,p)(5.7) The objective function, Eq. 5.1, minimizes the number of preserved arcs. Constraint 5.2 encodes the relationship between A and S variables. A place is retained in the output net iff at least one predecessor/successor arc is retained. The model ensures that the most important arcs, according to the trigger scores T , are preserved. For this, constraint 5.3 imposes a minimum number of preserved arcs. Γ can be configured as a percentage of the combined trigger
5.4. Simplification methods 93 score from all place transition arcs. A similar threshold constant Φ is imposed using the utilization score Ufor transicion place arcs (Eq. 5.4). A fully connected graph cannot be guaranteed by the ILP model. Instead, Eq. 5.5 models a weaker constraint: every transition will preserve at least one predecessor and successor arc. In addition, every place marked in m0 is always preserved, to avoid deriving a structurally deadlocked model (Eq. 5.6). Preserving fitness (optional) The ILP model as described so far does not guarantee preservation of fitness from the original Petri net. A simple modification can ensure that the existing fitness is preserved, at the cost of being able to remove only a reduced number of arcs from the model. Following a well-known result in Petri net theory, removing only F ( t,p )arcs never reduces the fitness of a model for any given log. Constraint 5.7 implements this restriction. 5.4.3 Projection into structural classes In this section we present ILP models to reduce Petri nets to two types of structural classes: free choice and state machines [112]. These methods do not require a log as they do not use trigger or utilization scores. Therefore, these proposals can be used to simplify Petri nets for visualization even when logs are not available, albeit their results may be of lower quality since scoring information is not used. Note that [138]can also be configured to generate state machines or marked graphs, but this approach requires having a log. In addition, the models extracted may still be complex because of the requirement to preserve fitness. Free Choice In this method, we simplify Petri nets by converting them into free choice nets. This method preserves the fitness of the model, but reduces precision. While this reduction does not necessarily result in models simple enough for visualization, complexity is reduced while mantaining most structural properties. Thus, reducing a dense net into free choice both opens the door to efficient analysis and to further decomposition (state machine or marked graph covers) techniques [57]. We encode this definition as a set of constraints and create a ILP problem which maximizes the number of arcs. For every p∈P,t∈T , we define a binary variable A(p,t)which indicates whether arc F(p,t)is preserved.
94 Chapter 5. Log-based simplification of process models max X F(p,t)>0 A(p,t)(5.8) s.t. ∀p∈P:|p•|>1∧ |•(p•)|>1=⇒ X t∈p• A(p,t) = 1∨ ∀t∈p•,p0∈•t:p6=p0=⇒ ¬A(p0,t)(5.9) Equation 5.9 guarantees a free choice net. If |p•|> 1 (it is a choice) and •|p•|> 1 (it is not free), then p contains a non-free choice, and one of the conditions must be removed. Either only one of the successor arcs of p is preserved, eliminating the choice, or it is turned free by removing every predecessor arc of p• except for the ones originating from p itself. Because F(t,p)arcs are never being removed, this simplification preserves fitness. State Machine In a state machine Petri net, every transition has exactly one predecessor arc and one successor arc. To encode this requirement into an ILP model, we again define a binary variable A(p,t)or A(t,p)for every arc in N. max X F(p,t)>0 A(p,t) + X F(t,p)>0 A(t,p)(5.10) s.t. ∀t∈T:X F(p,t)>0 A(p,t) = 1 (5.11) ∀t∈T:X F(t,p)>0 A(t,p) = 1 (5.12) Constraints 5.11 and 5.12 encode the definition of a state machine. However, note that this method may reduce the fitness of the model. A similar ILP model can be created to extract a marked graph. 5.5 Results The methods proposed in this chapter have been implemented in C++. The ILP-based methods have been implemented using a commercial ILP solver, Gurobi [72]. To obtain the input models, the ILP miner [138]available in ProM 6.4 was used over a set of 10 complex logs, both real-life [29,56]and synthetic [137]. The publicly available dot utility [66]has been used to generate the visualizations of all the models of this section. The measurements
5.5. Results 95 Nodes Arcs Crossings Fitness Precision (a) Original net 13 35 7 100% 43.1% (b) Series-parallel 13 17 0 100% 37.9% (c) ILP model 12 16 0 68% 75.4% (d) ILP (fitting) 11 21 0 100% 40.7% (e) Free choice 13 24 1 100% 31.3% (f) State machine 13 13 0 49.2% 81.3% Table 5.1: Simplicity, precision and fitness comparison for models in Fig. 5.3. of fitness and precision have been done using alignment-based conformance checking techniques [10]. Both the logs and our implementation are publicly available at http://www.cs.upc.edu/~jspedro/pnsimpl/. 5.5.1 Comparison of the simplification techniques In Section 5.4 (Fig. 5.3), an artificial model was used to illustrate the different simplification techniques presented in this work. Table 5.1 shows the details for each one of the simplified models. Several metrics are used to evaluate the results from the simplification techniques. To evaluate the understandability and simplicity of a model, we use the size of the graph, in number of nodes and arcs, as well as the number of crossings. This is the number of arcs that intersect when the graph is embedded on a plane. Thus, a planar graph has no crossings. A graph with many crossing arcs is clearly a spaghetti that is poorly suited for visualization. To approximate the number of crossings, the mincross algorithm from dot [66]is used. To measure how much the simplified Petri nets model the behavior of the original process we use fitness and precision, as defined in [10]. In this example, the series-parallel reduction offers perfect fitness, and only 5% loss of precision while removing half of the arcs and all crossings. However, the other methods also remain interesting. For example, the state machine simplification offers the best reduction in simplicity and increases the precision of the model to 80%, at the cost of reducing the fitness by 50%. This section also includes a comparison with some of the previous work in the area: the Inductive Miner (IM) [101]and a unfolding-based method [63]. The IM is a miner guided towards discovering block-structured models and which we see as a promising technique (see Section 5.2) since it can be tunned to guarantee perfect fitness. On the other hand, the unfolding procedure is more closely related to the methods proposed in this work. This technique uses an unfolding process to simplify an existing Petri net. We have evaluated both methods using the same nets as with our proposed methods.
96 Chapter 5. Log-based simplification of process models Figure 5.5 shows the Petri nets produced by the different techniques on a real-life log [56]that is more spaghetti-like. The high number of crossings in the original model make it unsuitable for visualization. In this example, the series-parallel method no longer offers perfect fitness but still shows a good trade-off between complexity and fitness/precision. The other methods may be used if for example strict fitness preservation is required, at the cost of more complex models. In Fig. 5.6, we compare numerically the techniques of this chapter for the 10 logs. For most of the logs, the series-parallel reduction and the ILP-based techniques are able to reduce the number of crossing edges by several orders of magnitude (note the logarithmic scale), creating small visualizable graphs from models that would otherwise be impossible to layout. On the other hand, the simplification to free choice results in very large and complex models. As mentioned, the benefits of deriving free choice models come from the ability to apply additional reduction strategies. Simplifying to state machines generally produces poorly fitting models, but they tend to have very few crossings and high precision. The models generated by the Inductive Miner, one of the existing methods included in the comparison, generally contain fewer crossings, caused by the addition of a significant number of silent transitions 1 which increase the size of the model. For example, in the incidenttelco example the number of transitions of the model derived by the IM is 37, whilst the original model (and, correspondingly, those generated by the simplification techniques) has 22. The addition of silent activities can be beneficial for visualization, specially if the underlying process model is meant to be block-structured. On the other hand, the unfolding procedure is more closely related to the methods proposed in this work. This technique uses an unfolding process to simplify an existing Petri net, and has been evaluated using the same nets as with our proposed methods. In general, it produces better results in terms of fitness and precision with respect to the ILP models, at the expense of longer computation time. When compared with the series-parallel method, the results in fitness and precision are comparable, but the unfolding method requires more computation time and the results are worst in terms of visualization. In Fig. 5.7 we compare the runtimes of the different methods. The ILP solver resolved all the ILP simplification models in less than 1 minute, even for the largest of the input Petri nets from the test set (25K nodes and arcs). The series-parallel simplification, which is not ILP based, has a lower performance. However, there are many parts where the algorithm could be optimized. Still, the total execution runtime for the largest graph (25 minutes) was less than the 1A silent activity in the model is not related to any event in the log.
5.5. Results 97 (a) Original Petri net. (b) Simplified to Free Choice. sp e ci tv r ah j k m u b f l n d g q o (c) Using ILP model, 60% threshold. q s p c i t v r e b f ln d g o a hj km u (d) Using ILP model (fitting), 60% thres. rs b p i c a hj k m u fn q d t e g o l v (e) Simplified to Series-parallel. a b u c d e f h k s t l g i j m n p q ro v (f) Using Inductive Miner [101]. a d i m b c el q fj oh k r g np s t uv (g) Using unfoldings-based method [63]. Nodes Arcs Crossings Fitness Precision (a) 54 448 9805 100% 31.5% (b) 54 320 5069 100% 19.4% (c) 44 93 76 76.7% 42.2% (d) 37 163 728 100% 15.6% (e) 39 54 2 74.5% 37.8% (f) 56 76 0 100% 47.24% (g) 41 158 1448 99.5% 25.8% (h) Fitness and precision results. Figure 5.5: Running all methods on real-life log (incidenttelco).
104 Chapter 6. Structured mining of Petri nets One possible way for simplifying a model is by over-generalizing the model, i.e. allowing behavior that is not present in the execution traces. This is the method that has been explored in Chapter 5. When the log contains unstructured behavior, however, it may be difficult to find a balance between a complicated model and an underfitting one [5]. In this chapter, we propose a new methodology to mine easy-to-understand process models (Petri nets) from logs, even those containing unstructured data. At the core of this proposal is a new clustering approach which automatically separates out behaviors with structural properties that induce visually friendly models. Thereby, our approach generates multiple process models, each of them conceptually simple, but without removing any of the behaviors. For most types of processes, only a few models are required to cover a majority of the behavior. 6.2 Related work The problem of trying to find simple yet fitting models from process logs has been approached from several areas. The closest approaches are those related to clustering. Our approach is novel in that clustering is performed by examining properties of transition systems, not log properties, thus being more accurate in determining which clusters will be visually friendly. A related approach is presented in [56], where the quality and simplicity of the models obtained by the heuristic miner is used to determine similarity of traces. Our approach does not depend on any miner during the clustering process. Most other clustering methods estimate similarity based on the log structure, such as vector distance [127] or edit distance [27]. Significantly, event ordering information can be used to construct the pattern vectors [14].[61]also targets complexity reduction, but it does so by using hierarchical clustering, unifying repeated patterns. Another group of techniques try to mine simple nets directly, by selectively ignoring noise from logs, such as the inductive miner [100]or the region-based FSM miner [5]. When two or more significantly distinct behaviors are present in the input logs, these methods must greatly reduce fitness or precision to generate simple models. Our clustering approach, instead, generates separate models for the separate behaviors. The rest of simplification approaches reduce the complexity of models already mined, such as the approach proposed in Chapter 5. Like the previous strategies, these approaches also end up generating a single model. For example, the authors of [62]perform a log-based unfolding of the model and compute a new model that only keeps the frequent parts.
6.3. Structured mining flow 105 Log Saturation Labeled Transition System Clustering LTS slice 1 LTS slice n ... Synthesis Synthesis Petri net 1 ... Petri net n Log slice n Mining Figure 6.1: Scheme of the proposed flow. 6.3 Structured mining flow In this section we give an overview of the contributions of this chapter. Figure 6.1 shows the main components of the mining flow. The most important step is the clustering process, which separates the log into several (possibly non-disjoint) subsets of traces. The classification criteria is based on exploring properties of the labeled transition system (LTS) constructed from the log. The procedure extracts slices from the LTS induced by subsets of transitions satisfying certain properties. Each LTS slice has an associated subset of traces from the log (a log slice). By ensuring certain properties on each LTS slice, Petri nets with specific structures can be synthesized. This work focuses on Marked Graphs and Free- Choice nets because of their inherent visually friendly structure. However, the paradigm does not preclude to use other structural properties that may induce other classes of nets. The details on how the slices are generated are described in Sections 6.4 and 6.5. In the second step, the different log slices are converted into Petri nets (dashed line in Fig. 6.1). Any miner can be used to transform these clusters into a Petri net. However, this work proposes a method (Section 6.6) based on the theory of regions that generates Petri nets based on the LTS slices produced by the clustering step.
106 Chapter 6. Structured mining of Petri nets 6.3.1 Visual example Figure 6.2 illustrates the different stages of the mining flow with a simple example. Fig. 6.2a contains a fictional event log used as input to the flow. Fig. 6.2b shows the LTS constructed from the log, where the presence of transition s1 d −→ s11 , coloured in Fig. 6.2b, violates certain structural properties (later detailed in Section 6.5). These violations imply that it is not possible to synthesize a visually-friendly Petri net from the LTS. The result is the intricate structure shown in Fig. 6.2c. The clustering process proposed in this work finds a set of slices of the LTS that satisfy certain structural properties. In this case, the LTS only needs to be split into two slices, shown in Fig. 6.2d. Each slice also fits only a subset of the traces from the log, shown in Fig. 6.2e, and these log slices are the result of the clustering process. In this particular case, the log slices are disjoint. However, overlapping slices can be produced in the most general case. Fig. 6.2f shows the Petri nets synthesized from the individual LTS slices. The LTS properties give rise to free-choice nets, which are more visually friendly. 6.4 Construction of an LTS from a log This section details the first step of the mining process, which starts from the input log, constructs a transition system, and performs an initial set of transformations to simplify the relationships between events in the LTS. Many methods exist to construct an LTS from a log. This work uses a variation of the prefix multiset conversion [5]which will detailed below. In real-life, logs obtained from execution traces often miss information required to fully learn the correct process model. For example, in the log in Fig. 6.3a, events a and b are seemingly concurrent as a is still enabled after firing b and viceversa. The log shows trace b a , but does not contain a b . The original prefix multiset technique would generate an LTS where a and b are not concurrent (Fig. 6.3b). The technique presented below generates an LTS where a b is also feasible. For an input log L∈ B(Σ∗), the procedure creates a new LTS Aas follows: 1. The Parikh vector ψ ( σ )of every possible prefix σ∈Σ∗ appearing in L is computed. A new state is created for every such different Parikh vector. 2. A transition s1 ei −→ s2 is inserted in A for every pair of states s1,s2∈A if ψ(s1) = (x0,..., xi,..., xn)and ψ(s2) = (x0,..., xi+1,..., xn). 3. The initial state s0is the zero Parikh vector.
6.4. Construction of an LTS from a log 107 abcdeab acdbecb acbdeab acbea a d e c acbec a d e a (a) Input log. s0 s1 as2 c s11 d s14 b s3 d s8 b s12 e c s4 b d s9 e s13 a s17 c s5 e s10 c s18 a s6 c s15 a s7 b s16 b (b) Labeled Transition System. a c d a d e b b (c) Petri Net covering the full log. s0 s1 a s2 c s14 b s3 d s8 b c s4 b d s9 e s5 e s18 a s10 c s6 c s15 a s7 b s16 b s0 s1 as11 ds12 e s18 c s13 a (d) Two slices extracted from the LTS. abcdeab acdbecb acbdeab acbea acbec a d e c a d e a (e) Corresponding log-slices. a c b d e b a c a d e c a (f) Synthesized Petri nets. Figure 6.2: Examples at different stages of the mining flow.
108 Chapter 6. Structured mining of Petri nets a a b b a (a) Log. (0, 0) (1, 0) ab (0, 1) (2, 0) a (1, 1) b (2, 1) a (b) Prefix multiset LTS. (0, 0) (1, 0) ab (0, 1) (2, 0) ab (1, 1) b (2, 1) a a (c) Arc-completed LTS. Figure 6.3: Log and steps to construct LTS. a a a a b b b c c c d d 1 a 1 a a2 a2 c2 c1 c1 b b b d d Figure 6.4: Splitting maximal connected ESs. An example of a log and the LTS generated using this method can be seen in Fig. 6.3c. The transformations presented in the rest of the section aim at enforcing unique concurrency/conflict relationships between pairs of events. 6.4.1 Splitting events with disconnected Excitation Sets It is frequent to observe disconnected instances of the same event in different states of the LTS. This transformation considers each instance as a different event. The transformation splits each event e into a set of events e1...ek such that the ESs of each event is maximally connected (only has one connected component). Figure 6.4 illustrates this transformation with an example, in which event a has two maximally connected sets of states in ES ( s ). Therefore, two new events, a1 and a2 are created to substitute the original event a . A similar situation occurs with event c.
6.4. Construction of an LTS from a log 109 a a a a b b b b c c c c x a a a b b b c c c x aa bb c c c x (b) (c)(a) Figure 6.5: Examples to illustrate c-saturation. When synthesizing a Petri net from the LTS, these events may end up by being represented by different transitions in the Petri net if the Free-Choice property requires the splitting. The decision about whether the splitting is necessary is left at the criterion of the synthesis tool [47]. 6.4.2 Saturation of concurrency The goal of this transformation is to define a unique relationship between every pair of events. For every pair aand b, there are two options: ES(a)∩ES(b) = ; ⇒ ordered. ES(a)∩ES(b)6=; ⇒ concurrent and/or conflict. This transformation aims at disambiguating the second case by exclusively choosing between concurrency or conflict. The following definition formally describes what concurrency saturation is. Definition 6.1 (C-saturation) . Two concurrent events are concurrency-saturated ( c-saturated ) if they are concurrent in all states of ES ( a ) ∩ES ( b ). An LTS is said to be c-saturated if all pairs of events are c-saturated. An analogue concept can be defined for the reversed LTS, in which the direction of all transitions has been reversed. Figure 6.5 shows three LTSs with different concurrency properties. The one in 6.5a is c-saturated since all pairs of concurrent events, ( a,b ),( b,c ), and ( a,c ), are c-saturated. The one in 6.5b is also c-saturated with the pairs ( a,c ) and ( b,c )being concurrent. However, 6.5c is not c-saturated since the pair ( a,b )is concurrent, but not in all the states of ES ( a ) ∩ES ( b ). Therefore the pair (a,b)is also in conflict. Any LTS can be transformed into c-saturated by adding states and transitions to complete the missing diamonds of the concurrent events. This process can be applied iteratively, both in the original and reversed LTS, until reaching a fixpoint in which all pairs of concurrent events are c-saturated.
110 Chapter 6. Structured mining of Petri nets In the example of Fig. 6.5, the LTS in 6.5c would become the one in 6.5a after c-saturation. With this transformation, there is no pair of events that can be concurrent and in conflict simultaneously. This contributes to remove intricate event relations, thus resulting in simpler Petri net structures. 6.5 Extraction of LTS slices Once an LTS A representing the input log L is constructed and transformed, the following step extracts several LTS slices A1,A2,...,Ak satisfying a set of properties than make it amenable for the synthesis of visually friendly Petri nets. Each slice Ai covers a subset of traces (log-slice) Li of L . The output of the clustering process is a set of log-slices that completely cover L . In the example of Fig. 6.2, two log-slices are delivered, shown in Fig. 6.2e. We first describe the properties enforced in the LTS slices and then the satisfiability model that extracts the slices. 6.5.1 Properties of the LTS slices Three properties are desired in the LTS slices: forward persistency, backward persistency and free-choiceness. Persistency is a property tightly related to the state spaces of Marked Graphs (see Section 2.2.2). An LTS A=〈S,Σ,T,s0〉is forward persistent (FP) if ∀s1 a −→ s2,s1 b −→ s3:∃s3 a −→ s4. Informally, if two events are simultaneously enabled, they must be concurrent. Backward persistency (BP) is an analogous property applied to the reversed LTS (reversing the direction of transitions). It is known that forward and backward persistency are necessary conditions for an LTS to be the state space of a Marked Graph [21]. The third property is free-choiceness (FC). An LTS is said to be free-choice if for every pair of events aand b, the following condition holds: aand bare in conflict =⇒ES(a) = ES(b). FC characterizes the state space for conflicts in Free-Choice Petri nets. Given that two transitions in conflict have the same predecessor places in a free-choice net, the set of markings in which they are enabled is identical for both transitions. This means that both excitation sets will be identical in the corresponding LTS. The FC property is the one used in [47]to split events and guarantee free-choiceness.
6.5. Extraction of LTS slices 111 aa b c c c d d e e d f f d a d b b 0 1 2 3 45 6 7 8 9 11 10 12 b c d e f a F kkC S bkkC c dk k e Figure 6.6: LTS with various conflict relations between events. b ac ed f abed f c (a) (b) Figure 6.7: Petri nets obtained from the synthesis of the LTS in Figure 6.6: (a) from the the full LTS, (b) from a slice obtained by removing states 1 and 4. Figure 6.6 shows an LTS and the relationship between pairs of events ( k : concurrent, C: conflict, F: free-choice conflict). Blank cells in the table represent ordered events (disjoint ES’s). We observe that the only free-choice conflict is between a and b , given that ES ( a ) = ES ( b ) = {s0,s2,s6} . The conflicts for the pairs (a,e)and (b,e)are not free-choice. Figure 6.7 depicts two Petri nets obtained from the LTS in Fig. 6.6. The one in Fig. 6.6a has been obtained by synthesizing the full LTS, whereas the one in Fig. 6.6b has been obtained by a slice in which states 1 and 4 have been removed. In the latter case, all conflicts for the pairs ( a,b ),( a,e )and ( b,e ) become free-choice, and so does the Petri net. 6.5.2 Satisfiability model An LTS slice is simply a subset of the original LTS. The goal of the approach presented in this chapter is to extract LTS slices with the FP, BP and FC properties. Let us call them Well-Behaved (WB) slices.
112 Chapter 6. Structured mining of Petri nets If each transition ti∈T of the LTS is represented by a Boolean variable, the set of WB-slices can be characterized by a Boolean formula WB( T ) in which every satisfying assignment corresponds to a WB-slice that contains only the transitions tifor which their variables are asserted. Fortunately, the function WB( T ) can be easily constructed by observing that the FP, BP and FC properties can be formulated locally, i.e., in terms of neighbor transitions. Once the WB formula is constructed, a SAT solver can be used to extract slices. Alternatively, the SAT model can be transformed into an Integer Programming model in which some specific cost function can be optimized. Let us now see how the FP, BP and FC properties can be characterized with Boolean constraints. Note that after the transformations applied to the LTS, all pairs of events have a unique relationship, i.e., they can only be concurrent or in conflict (but not both) in case their ESs intersect. Forward persistency (FP) This property is only applicable to pairs of concurrent events ( a,b ). For every state s1∈ES(a)∩ES(b), a diamond exists with the following transitions: t1= (s1,a,s2),t2= (s1,b,s3),t3= (s2,b,s4),t4= (s3,a,s4). Any selected subset of {t1,t2,t3,t4} must preserve the FP property, which means that the selection of t1 and t2 must imply the full diamond. The constraint can be formulated as follows: (t1∧t2) =⇒(t3∧t4). Backward persistency (BP) This property is analogous to the previous one, but reversing the direction of the transitions. A similar Boolean formulation can be constructed. Free-choiceness (FC) This property is applied to pairs of events in conflict. The constraints must ensure that both events have the same excitation sets in case both events are present in the LTS slice. The formalization of the constraints for each pair of events in conflict can be stated as follows: Once one of the events is enabled in one state, then the same enabling relation must be maintained in the successor states reachable by other events.
6.5. Extraction of LTS slices 113 s1s2 t1t3 t2t4 x a bb a x x Figure 6.8: Example to illustrate the FC constraint. Figure 6.8 depicts an scenario in which FC must be applied for two events, a and b , that are in conflict. Notice that the event x with transition s1 x −→ s2 must be concurrent with a and b , otherwise a,b would not be enabled in s2 , according to the c-saturation transformation applied to the LTS. Three options are possible with regard to the selection of transitions t1 and t2at state s1: 1. Both t1 and t2 are selected: in this case, the two events must be enforced to have the same ESs and, thus, both or none of t3 and t4 must be selected, i.e., t3⇔t4. 2. Only one of them is selected, say t1 . t3 would be present (because of the FP condition) and t4cannot be selected, otherwise ES(a)6=ES(b). 3. None of them is selected. In this case, no constraints are imposed on t3 and t4with regard to state s1. Formally, the Boolean constraint applicable to s1 with regard to events a and bis stated as follows: (t1∧t2) =⇒(t3⇔t4) (t1∧ ¬t2) =⇒ ¬t4 (¬t1∧t2) =⇒ ¬t3 The previous constraints can be simplified if a and b are in conflict but not all transitions of Fig. 6.8 are present in the original LTS. For example, if t1 is not present ( ¬t1 ), the previous constraints would be simplified and reduced to: t2=⇒ ¬t3. Generation of choice-free Petri nets. The previous constraints characterize LTS slices that derive Petri nets in which all choices are free. A simple modification of the model can characterize Petri nets without choices (only causality and concurrency relations). In particular, the FC conditions can be rewritten to disable the selection of two transitions that are in conflict. This would be equivalent to adding the constraint ¬t1∨¬t2 .
120 Chapter 6. Structured mining of Petri nets generated after our slicing procedure. Yet, the results show that even when compared to models where most noise has been removed, using our slicing algorithm still results in simpler models with comparable fitness (Fit.) and precision (Prec.). Table 6.3 shows these metrics on the first slice of each of the logs as well as using the naive algorithm. When using Petrify as miner, some of the models generated after the naive noise elimination still have tens of crossings or low precision. The models generated all have very few crossings despite maintaining similar levels of fitness and precision. When using the α -miner, low-fitting spaghetti models are discovered even after noise elimination. When applied to the first slices, the α -miner discovers models with a significantly reduced number of crossings, and increased fitness. 6.7.3 Publications As part of this research topic we have published the following conference article: • J. de San Pedro and J. Cortadella, Mining Structured Petri Nets for the Visualization of Process Behavior, in Proceedings of the 2016 ACM Symposium on Applied Computing (SAC), Pisa, Italy, April 2016. 6.8 Conclusions In this chapter, we have introduced a new method to mine visualization-friendly Petri nets from real-life process logs. We have shown our method to improve on the visualization quality of other similar slicing methods while being competitive in performance. This work is just an initial incursion into the study of properties of labeled transition systems with the goal of process model visualization. We envision this effort to be a starting point for further simplifications using other structural properties.
Chapter 7 Discovery of duplicate tasks In Chapters 5 and 6 we have presented a series of methods to improve the understandability of process models. The methods presented in Chapter 5 trade off quality metrics, such as fitness or precision. In Chapter 6, unstructured event logs are divided into several process models instead of constructing a single model. The methods proposed in this chapter, however, construct a single simplified model while preserving or even increasing fidelity metrics. The first problem addressed in this chapter is the discovery of duplicate tasks. A new method is proposed that avoids overfitting by working on the transition system generated by the log. The method is able to discover duplicate tasks even in the presence of concurrency and choice. The second problem is the structural simplification of the model by identifying optional and repetitive tasks. The tasks are substituted by annotated events that allow the removal of silent tasks and reduce the complexity of the model. An important feature of the methods proposed in this chapter is that they are independent from the actual miner used for process discovery. This chapter is structured as follows. Section 7.1 gives an overview of the topic. In Section 7.2, we discuss the related work. Section 7.3 introduces the concept of a local excitation set that will be used during duplicate task discovery. Section 7.4 describes the first proposed technique: a method to discover discover duplicate tasks. The second technique, a set of structural transformations to simplify a Petri net, is shown in Section 7.5. Both techniques are evaluated in Section 7.6. Finally, Section 7.7 presents the conclusions. 7.1 Motivation This chapter presents a set of techniques to explore the trade off between simplicity and precision. More specifically, by introducing a small number of
122 Chapter 7. Discovery of duplicate tasks new elements, the proposed techniques result in tangible improvements in precision. They can work in combination with any existing discovery (mining) algorithm. While some of the techniques can be applied to different formal models, this work will focus on Petri nets. The first technique enables the discovery of duplicate tasks in process models. Duplicate tasks allow several nodes to refer to the same activity in the event log, and are thus ideal to represent different behaviors for the same task in a single event log. While this is not a new concept in Process Mining [7,34,54,126,133], our proposal is novel in that the splitting criteria is based on properties of Labeled Transition Systems, thus allowing more precision than other existing techniques for duplicate tasks. The second technique performs structural simplifications that do not modify the semantics of the model, thus preserving the quality metrics. We introduce extensions to the formalism that allow single nodes to represent more complex control-flow structures, such as loops or optional tasks. 7.1.1 Example Figure 7.1 will be used to illustrate the main contributions of this chapter. We start from a simple log, a subset of which is shown in Fig. 7.1a. Figure 7.1b shows the model discovered by the Inductive Miner [101]for this log. This model is highly imprecise (50%): while it is not a pure flower model, almost all the words are recognized. The reason why many discovery algorithms generate such a low-precision model is because of the presence of duplicate tasks in the original process. Several reasons can lead to this scenario. For example, two different tasks may have been improperly tagged with the same label. Figure 7.1c shows the process model after the discovery of some duplicate tasks. The original process had two different tasks for each of the labels a , b , and e . This information is discovered automatically using the methods proposed in this work. Duplicate tasks also allow the discovery of more precise models. In this particular case, the new model has a precision of 90% and the workflow structure is clearer. However, the model has increased the total number of components, including silent transitions, which unnecessarily increases cognitive load in this example. Many of the silent transitions in Fig. 7.1c can be removed without affecting the semantics of the model, as shown in Fig. 7.1d. A method to remove silent transitions will also be presented in this work. By applying some structural transformations to Fig. 7.1d, further reductions on the structure of the Petri net can be achieved. In this work, the alphabet of labels is enhanced to incorporate meta-transitions, which represent control
7.1. Motivation 123 acdea acdba acbdbeba acbbdbbebba bbbecdea bbbecdba bbbecbdbeba bbbecbbdbbebba (a) Subset of the example log. a e c τ b d τ τ τ (b) Model discovered by the Inductive Miner. a1 τ τ b1 e1 cτ d e2 τ τ b2 τ τa2 (c) Model constructed after duplicate task discovery. a1 τ b1 e1 c d e2 τ b2 a2 (d) Removal of unneeded silent transitions from (c). a1 b∗ 1e1 c de2? b∗ 2 a2 (e) Using meta-transitions to simplify (d) Figure 7.1: Applying the method presented in this chapter to a sample model discovered by the Inductive Miner.
124 Chapter 7. Discovery of duplicate tasks flow patterns. For example, an e ? meta-transition can replace a choice between e and a silent transition, as in Fig. 7.1d. Similarly, a meta-transition b∗ can sometimes replace a self-loop transition with label b . We introduce Petri net transformations that, in this particular example, allow the removal of all silent transitions without altering its behavior. 7.2 Related work Several methods already exist for duplicate task detection, with the approaches being classifiable into several families. In [133], a set of heuristics creates a candidate set of duplicate tasks, which is then explored by a local search procedure working in tandem with an arbitrary mining algorithm. The method produces high-quality results in combination with advanced miners. However, since the miner influences the direction of the search, it is difficult to predict the runtime of the discovery process. In this work, the miner algorithm is only used to evaluate the set of candidate results. The number of results is exactly bounded by the maximum number of allowed duplicate tasks per event. The work in [126]proposes a clustering approach based on the context of events similar to the one described in this work. However, our work uses excitation sets to identify the context of events, which allows for more accurate detection that using the log directly. A different family of methods to perform duplicate task detection are tied to specific mining technologies. For example, Fodina [132], Genetic Miner [54], AGNEs [69], InWoLvE [74], region theory [34], α∗ -algorithm [103]. The proposal in this work works with any mining algorithm, and does not require e.g. workflow nets or other specific process models. For the second proposal in this work, structural simplifications, a potential comparable work is the use of other process modeling notations, such as BPMN [140]. However, the formalisms presented in this chapter still allow the full expressiveness of Petri nets, yet hide complexity in the presence of the common flow control operators. 7.3 Local Excitation Sets Figure 7.2b shows an LTS constructed from the process in Fig. 7.2a. Notice how ES ( a )contains the states in which the three duplicate tasks of a are enabled. We now define the concept of local excitation set which distinguishes each such instance of a, including the concurrent ones:
7.4. Discovering duplicate tasks 125 a a b c a d (a) Initial process. aa b c b a b c a a cd (b) ES(a)in the LTS. b c b b c cd (c) The three LES ( a ) after removal of a-transitions. Figure 7.2: Calculation of Local Excitation Sets. Definition 7.1 (Local Excitation Set) . Given LTS A = 〈S,Σ,T,s0〉 and event e∈Σ , the local excitation sets of e , LES ( e ) 1,...,LES ( e ) k are the maximally connected subsets of ES ( e )such that, ∀s1 e −→ s2∈A , if s1∈LES(e)i and s2∈LES(e)j , then i6=j. Notice that the definition does not allow both the source and target states of a transition with label e to be in the same LES ( e ) i . The set of LES of an event can be efficiently computed with a simple algorithm, illustrated in Fig. 7.2c for event a . The algorithm has the following steps: (1) calculate ES ( a ), (2) remove the transitions with label a from the LTS, (3) identify all LES ( a )as the maximally connected subsets of ES(a)after the removal of the a-transitions. The next two sections describe the two simplification techniques introduced in this work: discovery of duplicate tasks and structural simplifications to represent control-flow patterns. 7.4 Discovering duplicate tasks This section introduces a method that automatically discovers which events from an event log correspond most likely to duplicate tasks, i.e. should be represented by more than one task in order to enhance the quality of the model. The technique works with the LTS constructed from a log and can be combined with any discovery algorithm. By adding new tasks, the method slightly increases the element count of the model but results in tangible improvements in precision. Given a log L , the goal of this procedure is to generate, for every activity a∈L , a partition of all the events in L referring to a . When mining a process model, every different partition will be represented by a different task. We will generally refer to each task by a1,a2,...,an . A partition that, for every activity a , maps all events into a single task a1 results in a model with no duplicate tasks. Figure 7.3b shows an example partition for the log in Fig. 7.1a.
126 Chapter 7. Discovery of duplicate tasks Clustering Log ... Candidate splits Log preprocessor construction Miner ... Candidate models Select best Final model LTS LTS (a) Overview of the flow. a1cde2a2 a1cdb2a2 a1c b2d b2e2b2a2 a1c b2b2d b2b2e2b2b2a2 b1b1b1e1cde2a2 b1b1b1e1cdb2a2 b1b1b1e1c b2d b2e2b2a2 b1b1b1e1c b2b2d b2b2e2b2b2a2 (b) Split version of the log from Fig. 7.1a. Figure 7.3: Summary of the duplicate task discovery process. An overview of the proposed method is shown in Fig. 7.3a. At the core of the proposal lies a clustering process that generates a small set of candidate partitions. An existing mining algorithm is used to generate a process model for each of these partitions, and the best model is selected out of these discovered models. This way, the method adapts to the subtleties of the different mining algorithms. Even for miners that automatically discover duplicate tasks, the proposed method may help improving the results. The clustering method uses a bottom-up (agglomerative) approach: starting from the trivial partition which maps every event to a different task, the procedure iteratively selects pairs of similar events, grouping them into the same task. To find similar events, the algorithm uses causality relationships between events as discovered in a LTS, instead of using log information directly (e.g. direct predecessors or successors of an event). An LTS can be built from the log with a variety of methods [5]. Section 7.4.1 describes how similar events are found in the LTS, while Section 7.4.2 details the actual clustering algorithm. 7.4.1 Partitioning based on Excitation Sets A significant difference between this proposal and previous approaches to duplicate tasks is that the proposed method works at the Transition System level. The log is first converted into an LTS, and the clustering procedure generates a partition based on causality relationships between excitation sets in this LTS, rather than directly using the preceding and successor events in the log. Because of this, the approach is resilient to processes where duplicate tasks are combined with concurrency and choice. The use of clustering-based
7.4. Discovering duplicate tasks 127 LES(b) LES(b) LES(b)3 1 2 a b c e db c b ed bd a e b dbe a e ab a (a) Constructed LTS, highlighting all LES(b). a1b1 c1 a2 a3 e1 b2 b3 d1c2 d2 e2 e3 (b) Excitation set graph of the LTS in (a). LES Triggers Triggered by a1{c} ; a2; {b,d} a3; {b,d} b1{e} ; b2{a} {c} b3{a} {c} c1{b,d} {a} c2{b,d} {e} (c) Trigger relations between LES. Figure 7.4: Example excitation set graph of a subset of Fig. 7.1a (loops removed). methods [82]and similarity metrics rather than looking for exact matches also allows the proposed flow to gracefully handle noise and incompleteness in the log. Let us use an example to show the benefits of using ESs. Figure 7.4a shows the LTS constructed from the log in Fig. 7.1a, with no duplicate task detection performed. For simplicity, loops have been removed (allowing one iteration only). As per the definition of LES, there are 3 LESs for activity b , shown in Fig. 7.4a. Notice how the LESs of b provide an intuitive view of the correct partition for activity b (as shown in Fig. 7.3b): LES ( b ) 1 corresponds to the events of task b1 , while LES ( b ) 2∪LES ( b ) 3 would correspond to b2 . Our proposal classifies these LES by their relationships with other LES. The excitation set graph represents all the LES of a TS as well as the causality relationships between those: Definition 7.2 (Excitation Set Graph) . Given a LTS A=〈S,Σ,T,s0〉 , the excitation set graph of Ais a graph ESG(A)where: • The set of vertices V(ESG(A)) corresponds to the set of LES of A. • For every pair ( LES ( a ) i,LES ( b ) j )of A, with a,b∈Σ , there is an edge (LES(a)i,LES(b)j)∈E(ESG(A)) iff for any s1∈LES(a)i and s2∈LES(b)j , s1 a −→ s2triggers b.
128 Chapter 7. Discovery of duplicate tasks Figure 7.4b shows the corresponding excitation set graph of the example LTS, while 7.4c summarizes the immediate trigger relations. Notice how the information on 7.4c allows us to trivially distinguish between LES ( b ) 1 and {LES(b)2,LES(b)3}, since LES(b)1triggers a different set of events. Compare this to using predecessor and successor information from the log directly, without constructing an LTS first. It is difficult to distinguish events of b by looking at the immediately following event. For example, an event b followed by e may indicate an instance of task b1 as discovered in the previous section, but it may also be caused by an instance of b2 , since it is concurrent with e . Thus, using log information only, it would be difficult to construct an accurate partition for b. The use of excitation sets avoids this problem. Even when using excitation sets, the combination of choice, loops and/or incomplete logs may introduce LES that have related but slightly different sets of predecessors/successors, yet should be mapped to the same task. For this reason, the proposed flow includes a clustering method that combines similar LES. This method is described in the following section. 7.4.2 Hierarchical clustering algorithm This section describes the method used by our proposal to classify local excitation sets into groups with similar causality relationships. The described clustering method is agglomerative [82], discovering clusters using a bottom up approach: the algorithm starts by assuming every that, for every activity a , every LES ( a ) i belongs to its own cluster. In this initial solution, each LES maps to its own duplicate task. Then, the algorithm considers the pairwise similarity of all the LES, and combines the two closest ( LES ( a ) i,LES ( a ) j )(of the same activity a ) into the same task ai . The entire process iterates until no further clustering can be performed. On every iteration, the algorithm explores a solution with exactly one duplicate task less than the previous solution. The full discovery algorithm can be seen in Algorithm 10. The input is a log L . A is an LTS constructed from L (for example using the methods described in [5]), while G is the initial ESG, constructed using the rules seen in 7.2. The output Ris a process model with duplicate tasks. In every iteration, procedure FINDMOSTSIMILARNODES selects two vertices of G with the most similar context vectors, a numeric way to represent their causality relations which will be explained in the following section. The selected vertices are then merged into a single new vertex, representing the new cluster, which inherits the causality relationships of the merged vertices. Note that only vertices with the same activity label will be selected. The loop ends when there is only vertex in Gfor every activity, i.e. there are no duplicate tasks.
7.4. Discovering duplicate tasks 129 Algorithm 10 Discovery flow with duplicate tasks 1: function DUPLICATETASKDISCOVERY(L,M) .Lis the input log, Mis a miner algorithm. 2: A←CONSTRUCTLTS(L) 3: G←ESG(A) 4: R←M(L).Stores the best result (process model) discovered so far 5: while |V(G)|>|Activities(A)|do .While there is some duplicate task 6: vx,vy←FINDMOSTSIMILARNODES(G) 7: merge vx,vyinto single node in G 8: Li← TAGLOG( L,G ) . Tag events in the log according to current partition 9: Ni←M(Li).Discover a temporary model for evaluation 10: if Niis better than Rthen 11: R←Ni 12: return R a1a2a3b1b2b3c1c2d1d2e1e2e3 Dup. tasks Model size Precision 0 17 0.53 1 24 0.60 2 25 0.65 3 22 0.95 4 23 0.86 5 26 0.88 6 33 0.88 7 36 0.95 8 38 0.95 ← Figure 7.5: Dendogram showing clustering of LTS in Fig. 7.4a. To select which partition of tasks will be returned by our procedure, we construct a temporary process model Ni at every iteration. The provided miner is called using a log where events have been tagged according to the currently evaluated partition. The details of how models are compared will be described in a later section. Note that the total maximum number of models to evaluate (i.e. the number of iterations in the procedure) is limited by the number of excitation sets in the LTS. However, most processes contain only a few duplicate tasks. Limiting to 4 or 5 tasks per activity reduces the number of models that need to be evaluated to a few, depending on the number of different activities. Figure 7.5 visualizes the clustering procedure. The initial solution, where every LES is partitioned into its own duplicate task, is shown at the bottom
136 Chapter 7. Discovery of duplicate tasks Inductive Miner With duplicate tasks After simpl. |P| |T| |τ|Prec. Gen. |P| |T| |τ|Prec. Gen. |P| |T| |τ| alpha 11 17 6 68% 100% 11 16 4 70% 100% † 9 13 1 betaSimpl 14 21 8 62% 86% 14 16 1 94% 73% 14 15 0 Fig5p19 9 14 6 67% 89% 12 14 5 85% 76% 12 12 3 Fig5p1AND 9 8 3 83% 28% 10 8 2 100% 0% 9 7 1 Fig5p1OR 5 6 1 70% 33% 6 6 0 100% 0% 6 6 0 Fig6p10 15 24 13 63% 100% 19 25 10 77% 100% 18 19 4 Fig6p25 22 35 14 76% 100% 24 35 12 84% 100% 23 27 4 Fig6p31 6 10 1 63% 72% 9 11 0 100% 42% 9 11 0 Fig6p33 7 11 1 67% 70% 10 12 0 100% 38% 10 12 0 Fig6p34 17 24 12 58% 100% 19 20 4 93% 100% 17 18 2 Fig6p38 13 11 4 62% 84% 12 14 6 66% 87% 11 11 3 Fig6p39 12 12 5 90% 94% 12 12 5 90% 94% † 10 9 2 Fig6p42 7 18 4 23% 100% 26 32 12 75% 96% † 24 29 9 Fig6p9 10 15 8 67% 82% 9 12 3 83% 72% 9 9 0 flightCar 10 14 4 67% 64% 10 14 4 67% 64% † 11 9 1 RelProc 21 28 12 71% 100% 21 28 11 74% 100% † 19 21 4 Petrify With duplicate tasks After simpl. |P| |T|Cros. Prec. Gen. |P| |T|Cros. Prec. Gen. |P| |T|Cros. alpha 13 11 11 92% 100% 12 12 1 92% 100% † 12 12 1 betaSimpl 11 13 1 80% 77% 14 15 0 97% 39% 15 15 0 Fig5p19 8 8 2 100% 74% 9 9 1 100% 58% 9 9 1 Fig5p1AND 8 5 0 100% 0% 7 6 0 100% 0% 7 6 0 Fig5p1OR 5 5 3 100% 0% 5 6 0 100% 0% 5 6 0 Fig6p10 7 11 1 39% 100% 13 15 1 91% 100% 13 15 1 Fig6p25 14 21 6 80% 100% 14 23 0 80% 100% 18 23 0 Fig6p31 7 9 12 100% 42% 8 11 0 100% 42% 8 11 0 Fig6p33 8 10 7 100% 38% 9 12 0 100% 38% 9 12 0 Fig6p34 9 12 4 39% 100% 14 16 0 89% 100% 14 16 0 Fig6p38 8 7 0 71% 85% 10 8 0 100% 64% 10 8 0 Fig6p39 6 7 0 72% 98% 7 8 1 86% 86% † 8 8 0 Fig6p42 11 14 20 37% 98% 21 23 3 96% 94% † 21 23 3 Fig6p9 9 7 9 100% 54% 8 9 0 100% 54% 8 9 0 flightCar 6 8 0 58% 72% 6 8 0 58% 72% † 7 8 0 RelProc 16 16 11 87% 100% 15 17 2 87% 100% † 15 17 2 Table 7.2: Comparison using artificial benchmarks.
7.7. Conclusions 137 7.6.2 Logs with noise. An additional experiment shows the resilience of the proposed method to noise. We used Process Log Generator (PLG) [32]to generate a set of 3 random processes using a process depth of 3 and uniform probabilities for all control flow operators. Then, for each of these processes, we generated 10 logs containing 1000 traces each. In each log a different amount of random control-flow noise was injected using PLG, ranging from 0% to 10%. Figure 7.8 compares the precision of the models obtained using the Inductive Miner – infrequent [101](IMi) miner, configured with a 20% threshold, with the models obtained by the combination of our duplicate task discovery flow and the IMi. For the 3 evaluated processes, our flow can discover duplicate tasks and thus increase the precision even when confronted with noise. The differences in fitness were always smaller than 5% between both versions. On a Intel Core i5-2520m, our implementation of the clustering procedure is able to provide a set of candidate partitions in less than 4 seconds, even for the largest of these logs. The runtime of the miner, required to evaluate each candidate, is usually much larger than the clustering process. However, the number of candidates to be evaluated can be limited by setting an upper bound to the number of allowed duplicate tasks per label. 7.6.3 Publications The methods proposed in this chapter have been accepted in a conference: • J. de San Pedro and J. Cortadella, Discovering duplicate tasks in transition systems for the simplification of process models, in Business Process Management (BPM), Rio de Janeiro, Brazil, September 2016. 7.7 Conclusions This chapter has presented methods for simplification of process models that improve the quality of discovered models, in both simplicity and precision, while using different mining algorithms. As future work, we envision methods that work even in the presence of concurrent duplicate tasks, which are currently handled with unsatisfactory results. In addition, the language of structural tasks can be extended, for example, to allow simple regular expressions in nodes, e.g., (a|bc)∗.
138 Chapter 7. Discovery of duplicate tasks 0% 2% 4% 6% 8% 10% 0% 20% 40% 60% 80% 100% Inserted noise Precision Model 1 0% 2% 4% 6% 8% 10% 0% 20% 40% 60% 80% 100% Inserted noise Precision Model 2 0% 2% 4% 6% 8% 10% 0% 20% 40% 60% 80% 100% Inserted noise Precision Model 3 Inductive Miner - infrequent IMi with Duplicate Tasks Figure 7.8: Resilience of duplicate task discovery to different artificial noise levels.
Chapter 8 Specification mining of asynchronous controllers The chapter presents a first effort at exploring a novel area in the domain of asynchronous controllers: specification mining. Rather than synthesizing circuits from specifications, we aim at doing reverse engineering, i.e., discovering safe specifications from the circuits that preserve a set of pre-defined behavioral properties (e.g., hazard freeness). The specifications are discovered without any previous knowledge of the behavior of the circuit environment. This area may open new opportunities for re-synthesis and verification of asynchronous controllers. For example, the specifications obtained by the proposed flow may be used to decompose the behavior of a controller under test for more efficient verification using formal approaches. The effectiveness of the proposed approach is demonstrated by mining concurrent specifications (Signal Transition Graphs, STG) from multiple implementations of 4-phase handshake controllers, and a selection of controllers with choice. This chapter is structured as follows. Section 8.1 provides a brief overview of the topic and a visual example to motivate it. In Section 8.2, we perform a review of the related literature. Section 8.3 gives an initial foray into the behavioral properties that are preserved in the discovered specifications. The specification mining algorithm itself is detailed in Section 8.4. In Section 8.5, we introduce an extension that allows the mining flow to also consider properties specific to the specification language used, and detail the specific constraints for different structural subtypes of STGs. Finally, Section 8.6 shows the results of applying the proposed mining flow to a set of testcases, while in Section 8.7 we discuss future work and conclusions of this topic.
140 Chapter 8. Specification mining la lr rr ra (a) (b) RST lr+ la+ lr− la− rr− ra− rr+ ra+ Figure 8.1: Specification mining of a handshake controller. 8.1 Motivation The design automation efforts in the area of asynchronous circuits have been mostly focused on two problems: synthesis and formal verification. The synthesis problem consists of obtaining a circuit from a specification, e.g., a gate netlist from a Signal Transition Graph (STG). The verification problem consists of checking the conformance of a circuit with regard to a specification. In this chapter we study a new problem for asynchronous circuits: Specification Mining. The problem consists of discovering formal specifications from implementations [13], without any previous knowledge of their original specifications. The problem can be illustrated using the example in Fig. 8.1(a). The circuit implements a handshake controller in which only the initial state is known (all handshake signals at 0, RST=1). The reset signal (RST) is assumed to be silent during the normal operation of the circuit and the cross-coupled NOR gates are assumed to have an atomic behavior (negligible internal delay). We pose the following challenge: Can we discover a specification of the interface that guarantees a speed-independent behavior of the circuit? The answer to this question is not unique. Several interfaces could exercise the circuit without producing any hazard. In particular, an empty interface (no events) would guarantee such behavior. Our interest is to find maximally concurrent interfaces that honor the desired properties of the circuit. Fig. 8.1(b) shows one possible safe interface. This interface has been discovered automatically by the approach proposed in this work and coincides with the L440R2044 4-phase controller (according to the nomenclature in [25]).
8.1. Motivation 141 Specification mining can define not only properties that must be preserved in the circuit, but also properties of the interface. For example, it is possible to enforce that the interface is choice-free, i.e., no conflicts in the environment. Specification mining opens a new research direction in the area of asynchronous controllers that could potentially have applications in different domains, e.g., • Reverse engineering, to discover the behavior of some intricate controllers for which no specification is known. • Re-synthesis of asynchronous controllers, since the discovered interfaces can be used as specifications for synthesis tools that can produce higherquality solutions and substitute the existing ones [94]. • Compositional verification, by substituting some components of a large circuit by the mined specifications. In this way, an assume/guarantee scheme could be applied to verify the circuit by using the mined interfaces while hiding the internal signals of the components [40,118]. The main goal of this chapter is to demonstrate that specification mining is feasible for a variety of controllers. The application of this paradigm to specific problems in asynchronous design and verification is out of the scope of this work. 8.1.1 Example This section gives an informal overview of the approach proposed for specification mining, using the example shown in Fig 8.2. The goal is to obtain a specification for the environment of the circuit shown in the Fig. 8.2(a) in such a way that certain behavioral properties are guaranteed. In this particular case, we would like the circuit to be speed-independent (SI) and have a delay-insensitive (DI) interface. Speed-independence is guaranteed when the circuit is output persistent (only input signals can disable each other). A circuit has a DI interface if its behavior does not depend on the arrival order of the inputs. The labeled transition system (LTS) shown in Fig. 8.2(b) shows all possible behaviors of the circuit under a free environment, i.e., all input signals can switch at any time instant. Every state corresponds to a binary vector that represents the value of the signals at that state. We will identify each state by its binary vector 〈abx y〉. The labels x+ and x− represent rising and falling transitions of signal x . The double arcs a∗ ←→ represent alternating a+ and a− transitions between a
142 Chapter 8. Specification mining b x y a Environment ab=11 x+ x+ y+ y+ a* b* ab=01 b* y− a* b* b* ab=10 ab=00 y+ x− x+ x− xy=01 xy=00 xy=10 xy=11 y− x− a+ a− y+ b+ x+ y+ (a) (b) (c) (d) (e) a+ b+ y+ x+ y− a− b− x− x+ x+ y− b* b− y+ x− b+ a+ x+ a+ y+ y+ b+ x− y+ b* a+ y+ a− a− a− x− b− b− Figure 8.2: Simple circuit for specification mining.
8.1. Motivation 143 pair of states and are used to model the switching of input signals in a free environment. The transitions of x and y are depicted in the horizontal direction, whereas the transitions of a and b are depicted in the vertical and diagonal directions, respectively. For the sake of clarity, not all the labels are shown in the picture, although they can be easily deduced from the depicted information. We will assume that the initial (reset) state is also known. In the example, the initial state is 〈0000〉(unfilled circle). A free environment leads to many circuit malfunctions (hazards). For example, transition 〈 0010 〉x− −→ 〈 0000 〉 produces a violation of output persistence that may be manifested as a glitch in signal y , since y+ is enabled in 〈 0010 〉 and disabled in 〈0000〉. The goal of specification mining is to discover one or several specifications for the environment that: • have good properties, e.g., guarantee a hazard-free behavior of the circuit, and • are general enough to cover a large set of behaviors. As an example, the cyclic behavior ( b+y+b−y− ) ∗ is hazard free. However, we might be unsatisfied by the fact that signals aand xare not exercised. Fig. 8.2(c) depicts an LTS with output persistence, i.e., no output transition can be disabled by another transition. The largest LTS fulfilling this property can be uniquely obtained from the one in Fig. 8.2(b) by deleting the transitions that produce violations of output persistence. Still, Fig. 8.2(c) does not model a delay-insensitive (DI) interface (see Section 2.4.1 for a formal definition). For example, the transitions a− and b+ are enabled in state 〈 1011 〉 . The arrival of a− (leading to 〈 0011 〉 ) disables b+ , whereas the arrival of b+(leading to 〈1111〉) does not disable a−. Unfortunately, there is no unique solution when trying to find a subset of the LTS that fulfills the DI interfacing conditions. Given the fact that the circuit cannot be modified, the only chances are reduced to constraining the environment by deleting some input transitions. In the previous example, a DI interface can be obtained in different ways, e.g., by removing either transition a− or b+ from state 〈 1011 〉 . Other deletions are also required in other parts of the LTS to guarantee a complete DI interface. Fig. 8.2(d) depicts an LTS that models an SI circuit with a DI interface. An STG modeling the same behavior is shown in Fig. 8.2(e). Obtaining this specification is the most challenging problem tackled in this chapter. We will show how the problem can be modeled with a Boolean formula and solved using SAT or Integer Linear Programming.
144 Chapter 8. Specification mining In the rest of the chapter we propose the methodology used to obtain specifications from a circuit that fulfill a set of properties defined a priori. 8.2 Related work In this chapter we tackle a novel area, the specification mining [13]of asynchronous controllers. Specification mining is becoming popular in the software engineering community as a machine-learning approach to infer properties from the observable behavior of the systems [96]. One example is the work presented in [73]in which safe and permissive interfaces (sequences of library calls) are synthesized for software systems in such a way that the interfaces do not violate the internal invariants of the system. Another example is [98]where specifications represented as Message Sequence Graphs are synthesized from the traces observed from the execution of a concurrent system. In [104], a method is presented which automatically infers high-level descriptions from circuits, representing them as a combination of instances of abstract functional blocks from a predetermined library. 8.3 Circuits with constrained environment The main purpose of specification mining is to find a specification of the environment of the circuit that fulfills certain properties. In other words, finding a constrained environment that prevents the circuit from reaching states in which the desired properties are violated. This section formalizes the concepts of the LTS of a circuit under a free/constrained environment, and then introduces some examples of desirable behavioral properties in a LTS. For a formal definition of an LTS, we refer to Section 2.2.2. Definition 8.1 (LTS under free environment) . Given a circuit C=〈X,G,s0〉 , we define LTS(C) = 〈S,Σ,T,s0〉 as the LTS associated to C and generated by a free environment. Formally: •S = { 0 , 1 }n , with n = |X| , the set of binary vectors representing all possible states of the signals. •Σ = X× { + ,−} , where x+ and x− distinguishes the rising and falling transitions, respectively, of signal x∈X. •T = Tenv ∪Tg , where Tenv and Tg are the transitions produced by the environment and the circuit, respectively (defined later).
8.3. Circuits with constrained environment 145 The set of transitions Tenv in a free-environment circuit is defined as follows: Tenv ={sx −→ s¬x|s∈S∧x∈I}, representing the fact that any input signal can switch at any state. The set of transitions Tgproduced by the circuit is defined as follows: Tg={sx −→ s¬x|s∈S∧x∈(O∪Z)∧s(x)6=fx(s)}, representing all transitions of non-input signals produced by the logic gates when the value at the output of the gate is different from the function computed by the gate. The goal of specification mining, to discover a constrained environment E that satisfies all desired properties, is equivalent to finding a subset of transitions of Tenv that prevent the circuit from reaching states in which the desired properties are violated. Definition 8.2 (LTS under constrained environment) . Given a circuit C , its free-environment LTS(C) = (S,X,T,s0) and a subset of transitions E⊆Tenv representing a constrained environment, we denote by LTS ( C,E )the LTS obtained from LTS ( C )after deleting the transitions in Tenv \E . Formally, LTS ( C,E ) = (S0,X,T0,s0)is the maximal LTS such that: •S0⊆Sis the subset of reachable states from s0. •T0 is the maximal set of reachable transitions from s0 such that T0⊆(E∪Tg) . LTS ( C,E )can be computed from LTS ( C )by deleting the transitions in Tenv \E and iteratively deleting unreachable states and transitions until a greatest fixed point is reached. 8.3.1 Properties of an LTS Let LTS ( C,E ) = 〈S,Σ,T,s0〉 be the LTS associated to circuit C = 〈X,G,s0〉 with environment E . We say that x is enabled in state s if sx →s¬x∈T . We say that x disables y in state s if sx →s¬x∈T , y is enabled in s and not enabled in s¬x . Finally, we say that x triggers y in state s if s¬xx →s∈T , y is not enabled in s¬x and enabled in s . For more details on these definitions we refer to Section 2.2.2 and Section 2.4. Definition 8.3. In an LTS a signal x is persistent if no signal y6 = x disables it. If a signal x disables another signal y in any state s , then there is a conflict between xand y.