Cocoon: An Open-Source Infrastructure for Integrated EDA with Interoperability and Interactivity

Jiaxi Zhang1,∗, Tuo Dai1, Zhengzheng Ma1,2, Yibo Lin1 and Guojie Luo1,2,† 1Center for Energy-Efficient Computing and Applications, Peking University 2Peng Cheng Laboratory Email: ∗[email protected], †[email protected]

Abstract—The increasing size and complexity of integrated the customized EDA flows to get higher quality of circuit (IC) design introduce huge design cost and put forward results (QoR). higher requirements for EDA tools. Improving the quality and efficiency of chip design requires the efforts of both EDA workers Due to a tool can not handle all to produce the best and IC . In this paper, we first put forward the concept QoR, IC designers can customize the design flow by choosing of Integrated EDA, a system composed of EDA points tools, different tools to get higher QoR for their design. Thus, IC designs and interfaces. And we point out the key features of designers need to be very familiar with every step in EDA integrated EDA and the possible solutions. Then we propose toolchain and detailed scripts of each tool before they want Cocoon, an open-source infrastructure for integrated EDA with interoperability and interactivity. It contains a set of cross-tool to replace one step with another point tools to customize a interfaces and plays the role of EDA agent that can help IC design flow. Poor interoperability and interactivity hinder the designers choose EDA point tools to assemble a legal design flow integration and customization of EDA tools. Interoperability is and to produce ICs with a higher quality of results (QoR). At the premise of CAD-IP reuse [4], and interactivity supports the last, we implement two demos using Cocoon to prove that such toolchain customization for IC designers without expertise in infrastructure is feasible and flexible for integrated EDA. EDA algorithms. Some EDA frameworks have been proposed to solve such problems. Edalize [5] provides a python library I.INTRODUCTION for interacting with EDA tools. It can create projects for sup- ported tools and run them in batch or GUI mode. Hammer [6] The increasing size and complexity of means to enable re-use and portability of EDA tools between (IC) design introduce huge design cost and increase time technologies. It provides a Python backend and exposes a set to market. Higher requirements have been put forward to of APIs that are typical of modern VLSI flows. electronic design automation (EDA) tools. EDA researchers and vendors have proposed many methods to improve the In this paper, we expand the concept of electronic CAD quality and reduce the running time of EDA tools, thereby framework to integrated EDA. The goal of integrated EDA further helping chips designers to decrease the design cost. is that users can easily call EDA point tools to assemble However, as the complexity of the chip increases, customized EDA flows as well as generate design layout it is not enough to rely solely on EDA tool developers. This without a deep understanding of all EDA tools. Interoperability requires the joint efforts of EDA tool developers, EDA system and interactivity are two key features to achieve the above integrators and the IC designers. objectives. The major technical contributions of our work are threefold: The concept of electronic CAD framework has been pro- posed to define all of the underlying facilities provided to • We review the concept of Electronic CAD framework the CAD tool developers, the CAD system integrators, and and expand it to integrated EDA. We point out the key the IC designers [1]. The primary goal of a CAD frame- features of integrated EDA and the possible solutions. work is to reduce the time and cost required to develop or (SectionII). modify a CAD system such that it meets the needs of its • We propose Cocoon1, an infrastructure enhancing the users. But it is not trivial to implement such a framework. interoperability and interactivity for integrated EDA. With In recent years, the open-source EDA community still have the help of interface definition, Cocoon can represent made attempts and great efforts to it. OpenRoad flow [2] customizable and tunable EDA flows. (Section III). developed an open-source toolchain covering from RTL to • We implement two demos using Cocoon to prove that GDSII phase of system-on-chip design. DATC Robust Design such infrastructure is feasible and flexible for integrated Flow [3] constructed a database for design benchmarks and EDA. (SectionIV). point tool libraries and provided an open-source design flow from to detailed routing. Such open-source toolchains provide IC designers with the possibility to modify 1https://github.com/pku-dasys/cocoon TABLE I: Interoperability and interactivity approaches in contains physical and technology information of standard cells. inter-connected cloud and their counterparts in integrated DEF format describes initial floorplan. SDC format includes EDA. design constraints such as clock period, driver information of Corresponding Available each input port and load capacitance of each output. Approaches in approaches in in existing Inter-Connected Cloud Cross-tool APIs are the interfaces to easily call different Integrated EDA flows? Open Standards/Protocols Open Standards YES point tools without knowing how to write the running scripts. Cross-platform APIs Cross-tool APIs NO The scripts of most EDA tools are based on Tcl. But Tcl Layers Abstraction Steps Abstraction YES does not support interoperability of different tools very well Cloud Brokers/Agents EDA Brokers/Agents NO because it is tightly coupled with the tool. We need a higher- Model-based Model-based NO abstraction to implement cross-tool APIs. Steps abstraction are the process steps in the EDA design II.INTEGRATED EDA flow. The abstractions now are stable and adopted by industry and academia. The main abstractions include logic synthesis, In this section, we first define integrated EDA and point out floorplan, power plan, global placement, detailed placement, the key features. Then we show some possible solutions bor- clock tree synthesis, globe routing, detail routing, design rule rowed from other fields that might enhance the interoperability check, LVS, and parasitic extraction, and interactivity of integrated EDA. et.al. But it’s not enough if we only have these point tools. For A. What is Integrated EDA? those who are not familiar with EDA stages like IC designers, Integrated EDA is a system composed of EDA point tools, we still need some mechanism to check whether the order in designs, and interfaces. It is more than a library of EDA point which the tools are used is legal. tools. The users of integrated EDA include three groups of EDA brokers are individuals or enterprises that act as in- people, EDA researchers, tool developers, and IC designers, termediaries between users and providers of EDA tools. They each of whom have their own needs and particular emphasis. recommend the most suitable EDA point tools for designers. For EDA researchers and tool developers, they can quickly And they provide users with a simple API and UI, allowing verify whether their algorithm or tool is useful in the end-to- users to work seamlessly with different point tools as if using end EDA flow. They can also create new design methodology a single tool. An EDA agent can be a software that helps and do cross-stage optimization. For IC designers, they can choose point tools from different EDA vendors and even the easily customize EDA flow without knowing details of EDA open-source EDA community. algorithms to get higher design QoRs. Model-based approaches request developers to model the Interoperability and interactivity are two key features of functionality of the system. A model is usually specific with integrated EDA. In EDA context, Interoperability can be some model notations or a domain-specific language. This kind defined as the ability of two or more toolchains to exchange of method has not been applied to EDA. point tool and to use the design file that has been exchanged. In this paper, we focus on the cross-tool APIs and EDA Interactivity can be defined as the flexibility that user can agents to enhance the interoperability and interactivity of inter- replace and deploy point tool and without knowing the imple- connected EDA. mentation details. The former one guarantees the interchange III.COCOON of point tools, while the latter feature enables cross-step optimization and flow tuning for users. In this section, we first give the architecture and abstraction layers of Cocoon. Then we show how Cocoon supports B. Possible Solutions customized flow definition and flow tuning. The problem of interoperability and interactivity will also appear in other fields. In the inter-connected cloud, the in- A. Overall Architecture teroperability and interactivity can be defined as the ability Fig.1 summarizes the Cocoon architecture. Cocoon has to seamlessly deploy, migrate, and manage application work- three layers of abstraction, applications (tools) layer, data layer loads across heterogeneous hardware and software resources and interfaces layer. provided by multiple datacenter cloud providers. Different re- Applications layer contains all EDA stages in the entire flow, searchers have suggested various approaches to implement in- including but not limited to high-level synthesis, logic synthe- teroperability in inter-connected cloud [7], and inter-connected sis, floorplan, power plan, placement, routing, et.al. With the EDA can draw on the experience of these approaches. TableI development of chip design and EDA, more applications may summarizes the interoperability approaches in inter-connected appear. But it does not affect the abstraction of the application cloud and corresponding approaches in integrated EDA. The layer; we can add or delete applications to this layer. For last column shows whether these approaches currently exist in example, placement application can be divided into global the EDA design flow. placement, legalization and detailed placement. We can add Open standards are design exchange formats in chip design, these three sub-stages to the application layer. Each application and there have been several open standards in EDA tools. is a set of EDA tools from the open-source community or EDA Liberty format defines a standard cell library. LEF format vendors. Tools in Cocoon will provide options and parameters, Customized Flow Input Design Output Design Netlist Logic Applications Layer High-level Logic Global Global Global Synthesis Floorplan Placement Routing … Synthesis Synthesis Placer 1 Placer 2 Placer 3 Floorplan .sdf Interface Layer Pull Push Legality Check Evaluate Evaluate Placement

Data Layer Legalizer Design Reports Scripts Checkpoint Source (a) Branching flow. (b) Iterating flow. Fig. 1: Cocoon Architecture. Fig. 2: Customized flow definition.

Propose and these options or parameters can drastically impact Options Tuner quality. Data layer contains all information about the design, includ- Feature Extraction ing design sources, reports, running scripts and checkpoints. Generate Checkpoint/ Design sources include hardware design languages, standard HDL Design Flow Reports cell library ∗.lib, physical and technology information of standard cells ∗.lef and design constraints ∗.sdc. Reports are Fig. 3: A typical tuning process. the output files of EDA tools, including report files such as timing, power and running logs. Scripts are the files to control the execution of EDA tools, including Tcl scripts, makefiles avoid the problem that a customized flow fails due to the or scripts with other formats. incorrect application calls. For example, if in a customized The checkpoint is critical in the data layer and is different flow, user calls a routing tool after logic synthesis and omits from other frameworks. In addition to the information included the placement, then this flow is illegal. Cocoon can save the in traditional checkpoints like netlists, physical data, timing applications that correctly executed, and give an alternative information, design constraints, etc., checkpoints in Cocoon application. also contains executed tools and tool parameters. Such check- point design makes it easier for applications to check whether C. Customized Flow Definition the current input checkpoint is legal. And it can memorize With the above layers and functionalities, Cocoon can the used tool for results reproduction without spending time flexibly support the definition of various forms of design flows, choosing tools. The checkpoint can also be easily migrated such as branching flow and iterating flow. These forms of to other design flow. For example, if a IC has tried design flows can help users choose better quality tools and tool A, B, C for global placement and he figures out that tool research on new design methodologies without writing too B produced layout with higher design quality for module X many tool scripts. after finishing the latter design stages, he can use tool B for 1) Branching flow: Suppose the user wants to use yosys global placement in the selection of subsequent EDA tools. with different parameters or yosys and genus for logic synthe- sis at the same time, and choose a better result to perform the B. Interface Layer subsequent steps. This flow has branches. Fig. 2a gives the Interface layer is a bridge connecting data layer and appli- schematic of the branching example. Assuming that we can cations layer. It is also a key point for supporting interoper- have 3 global placers to choose from, Cocoon can evaluate the ability and interactivity. Pull and push are basic methods for checkpoint after finishing the global placement, and choose a applications to read or write data. better design for subsequent legalization and detail placement. Evaluation operator pulls the checkpoints, compare the The evaluated function can be implemented by reading the results and can push the checkpoint with higher QoR to reports or developing learning-based method. other applications. Users can prune the bad design in early 2) Iterating flow: The most common scenario of iteration stage and choose the tools with better design quality via flow is that if the timing is not satisfied and users need to evaluation method. Evaluation operator can be implemented by rerun the entire flow with different tool or tool parameters. pulling the reports and estimating the design quality by reports. Back annotation is another example. Given another example, Users can define their own evaluation method to realize such if a user want to use physical-aware logic synthesis [9] to functionality. E.Ustun [8] use machine learning to accelerate improve the design quality, he needs to run the placement the design tuning phase by pruning the bad design in early and routing applications first, and the feed the result back to stage. the logic synthesis application. Fig. 2b gives the schematic of Legality check is defined to check whether the input check- back annotation. Logic synthesis tool read the .sdf generated point of the application is legal. This mechanism can help by placer to guide the re-synthesis to get higher QoR. D. Flow Tuning EDA tools provide numerous options and parameters that can drastically impact design quality. These parameters create an enormous and complex design , and it’s impossible to try all the design point to find the optimal solution. Several design space exploration methods like intelligent search strate- gies, parallel computing and learning-based method [10] can help solve such problem. Due to interactive layer abstraction, design space exploration methods can be easily imported to Cocoon. Cocoon can not only tune the tool parameters of flow, but also tune which tool to use in the customized flow. Figure3 shows how cocoon support the flow tuning. The tuner pulls the features extracted from the checkpoint or reports and propose tool options to the design flow. Design flow adopts Fig. 4: Demo code for branching flow. the tool options, executes and generates new design checkpoint and reports. Such process finishes until the design meets the performance requirements or reaches the maximum number of V. CONCLUSIONAND FUTURE EXTENSIONS iterations. In this paper, we first expand the concept of electronic CAD IV. IMPLEMENTATION AND EVALUATION framework to integrated EDA. Then we propose Cocoon, an This section presents a preliminary implementation of Co- infrastructure enhancing the interoperability and interactivity coon and gives two demos to show that Cocoon is feasible for integrated EDA. With the help of interface definition, and flexible for integrated EDA. Cocoon can represent customizable and tunable EDA flows. We implement two demos to demonstrate that Cocoon is A. Implementation feasible and flexible for integrated EDA. We use Python 3 to implement Cocoon. The application Cocoon is under-development now about legality check, em- layer in Cocoon is implemented as a class. Each class instance bedded flow implementation. In the future, Cocoon will con- will wrap the implementation of a tool, including the member sider about cloud deployment, including distributed checkpoint functions like parameters setting and scripts generation. The design and computation graph scheduling of applications. data layer in Cocoon is implemented as a database with a fixed REFERENCES directory. Interface layer are implemented as global functions. Users need to modify design class to specify the design source, [1] T. J. Barnes, D. Harrison, A. R. Newton, and R. L. Spickelmier, Electronic CAD frameworks. Springer Science & Business Media, and then write their customized flow class, with specifying the 2012, vol. 185. tool name and parameters as well as execution order. Cocoon [2] T. Ajayi, V. A. Chhabria, M. Fogac¸a, S. Hashemi, A. Hosny, A. B. will analyze the customized design flow automatically, and Kahng, M. Kim, J. Lee, U. Mallappa, M. Neseem et al., “Toward an open-source digital flow: First learnings from the OpenROAD project,” then assert legality check and run the flow. in Design Automation Conf. (DAC), 2019. [3] J. Jung, P.-Y. Lee, Y.-S. Wu, N. K. Darav, I. H.-R. Jiang, V. N. Kravets, B. Evaluation L. Behjat, Y.-L. Li, and G.-J. Nam, “DATC RDF: Robust design flow database,” in Int’l Conf. on Computer-Aided Design (ICCAD), 2017. We gives two demos to demonstrate that Cocoon can [4] A. B. Kahng and I. L. Markov, “Impact of interoperability on CAD- support customized flow definition and flow tuning. IP reuse: an academic viewpoint,” in Int’l Symp. on Quality Electronic 1) Branching flow: Figure4 shows the code of a branching Design (ISQED), 2003. [5] “Edalize,” https://github.com/olofk/edalize, accessed: 2020-10-15. flow. Cocoon first push the HDL to Genus and Yosys and [6] “Hammer,” https://github.com/ucb-bar/hammer, accessed: 2020-10-15. then pull the checkpoint after the synthesis. Then cocoon [7] K. Kaur, D. S. Sharma, and D. K. S. Kahlon, “Interoperability and porta- call evaluate method to compare the results and push the bility approaches in inter-connected clouds: A review,” ACM Computing Surveys (CSUR), vol. 50, no. 4, pp. 1–40, 2017. checkpoint with better estimated results to Innovus to do the [8] E. Ustun, S. Xiang, J. Gui, C. Yu, and Z. Zhang, “LAMDA: Learning- floorplan and placement. Also parameters in every application assisted multi-stage autotuning for FPGA design closure,” in Int’l Symp. step can be define in the flow in the same time as shown in on Field-Programmable Custom Computing Machines (FCCM), 2019. [9] S. Chatterjee and R. Brayton, “A new incremental placement algorithm line 10. The tag after application tool name is used to mark and its application to congestion-aware divisor extraction,” in Int’l Conf. checkpoint status for now. on Computer-Aided Design (ICCAD), 2004. 2) Flow tuning: The flow tuning problem can be classified [10] M. M. Ziegler, H.-Y. Liu, and L. P. Carloni, “Scalable auto-tuning of synthesis parameters for optimizing high-performance processors,” in as a black-box optimization problem. We treat the flow is a Int’l Symp. on Low Power Electronics and Design (ISLPED), 2016. black-box by supplying input design and parameter settings [11] J. Bergstra, D. Yamins, and D. Cox, “Making a science of model and measuring the output response in terms of design quality. search: Hyperparameter optimization in hundreds of dimensions for vision ,” in Int’l Conf. on Machine Learning (ICML), 2013. In this demo, we use hyperopt [11], an open source hyper- parameter optimization tool to solve the flow tuning problem. Demo is in our github repository.