scieee AI-readable full text Open interactive document viewer

Fabricación de Core RISC-V por medio de Herramientas Open-Source

Lapshin Ivanov, Ilya

Abstract

Con el crecimiento del movimiento de código abierto, más temas informáticos son abiertos y accesibles, como el diseño de hardware. Aparecen más herramientas abiertas y más empresas están interesadas en desarrollar o nanciar estas herramientas. Un ejemplo podría ser el programa Efables Open MPW, que ya se ha lanzado varias veces. Permite a cualquier persona que quiera crear y fabricar su propio diseño opensource, sin tener que correr el riesgo asociado al coste de fabricación y de forma totalmente gratuita. La idea de este trabajo es tomar un diseño ya creado e iterar todos los pasos del ujo de diseño desde RTL (Register-Transfer Level) hasta GDSII (Graphic Design System II) utilizando herramientas de código abierto y resolviendo los errores encontrados durante la iteración. Para luego poder participar en el programa Efables Open MPW y poder fabricar nuestro diseño SoC (System on a Chip) utilizando el PDK de código abierto de 130 nm de SkyWater.

Full text

Fabricación de Core RISC-V por medio de Herramientas Open-Source Fabricating a RISC-V core by means of Open-Source Tools Trabajo de Fin de Grado Curso 20222023 Autor Ilya Lapshin Ivanov Directores Alberto Antonio del Barrio García David Mallasén Quintana Grado en Ingeniería Informática Facultad de Informática Universidad Complutense de Madrid Fabricación de Core RISC-V por medio de Herramientas Open-Source Fabricating a RISC-V core by means of Open-Source Tools Trabajo de Fin de Grado en Ingeniería Informática Autor Ilya Lapshin Ivanov Directores Alberto Antonio del Barrio García David Mallasén Quintana Convocatoria: Septiembre 2023 Grado en Ingeniería Informática Facultad de Informática Universidad Complutense de Madrid 10 de septiembre de 2023 Resumen Con el crecimiento del movimiento de código abierto, más temas informáticos son abiertos y accesibles, como el diseño de hardware. Aparecen más herramientas abiertas y más empresas están interesadas en desarrollar o nanciar estas herramientas. Un ejemplo podría ser el programa Efables Open MPW, que ya se ha lanzado varias veces. Permite a cualquier persona que quiera crear y fabricar su propio diseño opensource, sin tener que correr el riesgo asociado al coste de fabricación y de forma totalmente gratuita. La idea de este trabajo es tomar un diseño ya creado e iterar todos los pasos del ujo de diseño desde RTL ( Register-Transfer Level ) hasta GDSII ( Graphic Design System II ) utilizando herramientas de código abierto y resolviendo los errores encontrados durante la iteración. Para luego poder participar en el programa Efables Open MPW y poder fabricar nuestro diseño SoC ( System on a Chip ) utilizando el PDK de código abierto de 130 nm de SkyWater. Palabras clave percival, posit, quire, openlane, caravel, efabless, open source iv Abstract With the growth of the open source movement, more computing topics are open and accessible, such as hardware design. More open tools appear and more companies are interested in developing or nancing these tools. An example could be the Efables Open MPW program, which has already been launched several times. It allows anyone who wants to create and manufacture their own opensource design, without having to run the risk associated with the manufacturing cost and completely free of charge. The idea of this work is to take an already created design and iterate all the steps of the design ow from RTL to GDSII using open source tools and solving the errors found during the iteration. To then be able to participate in the Efables Open MPW program and be able to manufacture our SoC design using SkyWater's 130 nm open source PDK. Keywords percival, posit, quire, openlane, caravel, efabless, open source v Contents 1 Introduction 1 1.1 Motivation................................. 1 1.2 Quick Historical Overview . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2.1 Open-Source EDA tools . . . . . . . . . . . . . . . . . . . . . 1 1.3 Objectives................................. 3 2 Background 4 2.1 HardwareKnowledge........................... 4 2.2 Designsteps................................ 5 3 State of the Art 7 3.1 PERCIVAL ................................ 7 3.1.1 PAU................................ 7 3.2 OpenLane................................. 8 3.3 SV2V ................................... 8 3.4 GHDL................................... 8 3.5 IcarusVerilog............................... 9 3.6 GTKWave................................. 9 3.7 Efabless Caravel chip . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.7.1 ManagementArea ........................ 10 3.7.2 User Project Area . . . . . . . . . . . . . . . . . . . . . . . . . 11 4 Methodology 12 4.1 Methodology ............................... 12 4.2 ToyDesign ................................ 13 4.2.1 Adding the Toy Project . . . . . . . . . . . . . . . . . . . . . 13 4.2.2 Hardering ............................. 14 4.2.3 Integration in the Caravel . . . . . . . . . . . . . . . . . . . . 16 4.2.4 Hardering the Wrapped Project . . . . . . . . . . . . . . . . . 18 4.3 PAU.................................... 19 4.3.1 Translation of the PAU . . . . . . . . . . . . . . . . . . . . . . 19 4.3.2 Simulating the PAU . . . . . . . . . . . . . . . . . . . . . . . 22 vi 4.3.3 Hardering the Design . . . . . . . . . . . . . . . . . . . . . . . 24 4.4 PERCIVALCore ............................. 28 4.4.1 PERCIVAL Core Translation and Bug Fixes . . . . . . . . . . 28 5 Results and Future Work 32 5.1 Results................................... 32 5.2 Conclusions ................................ 33 5.3 Futurework................................ 33 Bibliography 35 A Caravel Installation and Launch 37 List of acronyms 39 List of gures 1.1 Raising of the level of abstraction over the years (Sangiovanni-Vincentelli, 2003).................................... 2 1.2 gEDAtoolset ............................... 2 2.1 Posit accuracy comparison with IEEE754 oat representation. (Mallasénetal.,2023b) ............................ 5 2.2 General posit format for nite and nonzero values. (Gustafson and Yonemoto,2017) ............................. 5 3.1 PAU ( Posit Arithmetic Unit ) structure. (Mallasén et al., 2022) . . . . 7 3.2 GTKWaveinterface. ........................... 9 3.3 Current SoC architecture. . . . . . . . . . . . . . . . . . . . . . . . . 10 3.4 Caravel. .................................. 11 3.5 OpenLaneFlow............................... 11 4.1 Wrapping the user project into the Efabless Caravel chip. . . . . . . . 12 4.2 Methodology followed through this BSc. Thesis. . . . . . . . . . . . . 13 4.3 Generatedcircuit.............................. 15 4.4 Testbenchoutput.............................. 18 4.5 Testbench simulation waveform. . . . . . . . . . . . . . . . . . . . . . 19 4.6 More detailed view of the testbench simulation. . . . . . . . . . . . . 19 4.7 Wrapped toy design successfully hardened. . . . . . . . . . . . . . . . 19 4.8 Toy design inside Caravel. . . . . . . . . . . . . . . . . . . . . . . . . 20 4.9 GTKWave simulation after selecting all signals and appending them into the viewer. All results are displayed in hexadecimal format. . . . 25 4.10Detailedview................................ 25 4.11PAUGDSIIle............................... 28 viii Chapter 1 Introduction 1.1 Motivation The chip manufacturing process was generally a private process, with only a handful of companies having the resources and expertise required to design and manufacture integrated circuits. This meant that access to the technology was limited, and the cost of developing and manufacturing custom chips was often prohibitively high for smaller companies, individual designers. However, in recent years there has been a growing trend towards open-source hardware and the democratization of the design and manufacturing process. This has led to the development of tools, platforms or programs, such as Yosys 1 2 , Open- Lane 3 (Ghazy and Shalan, 2020) (Shalan and Edwards, 2020) and Efabless Open MPW Program 4 , that make it easier and more aordable for designers to create custom ASIC ( Application-Specic Integrated Circuit ), SoC, etc. These tools together can provide a complete design ow, from synthesis to signo. Using open-source EDA ( Electronic Design Automation ) tools and automation to simplify and speed up the design process, allows even to unexperienced users to rapidly iterate and optimize their designs, resulting in faster design cycles. 1.2 Quick Historical Overview 1.2.1 Open-Source EDA tools The earliest open-source EDA tools were produced academically. One of the rst were the Magic 5 (Ousterhout et al., 1985), an interactive system for creating and modifying VLSI circuit layouts, and SPICE ( Simulation Program with Integrated Circuit Emphasis ) 6 (Nagel and Pederson, 1973), a general-purpose circuit simulation 1 https://github.com/YosysHQ/yosys/tree/master 2 https://yosyshq.net/yosys/ 3 https://github.com/The-OpenROAD-Project/OpenLane 4 https://efabless.com/open_shuttle_program 5 http://opencircuitdesign.com/magic/ 6 http://bwrcs.eecs.berkeley.edu/Classes/IcBook/SPICE/ 1 8 Chapter 3. State of the Art 3.2 OpenLane OpenLane 23 is an open-source digital ASIC design ow framework that automates the design process of creating custom ASIC. It was developed by Efabless, a company focused on democratizing the creation of custom chips, and is available for free on Github under Apache License 2.0. OpenLane uses a combination of open-source EDA tools, such as OpenROAD, Yosys, Magic, Netgen, CVC, SPEF-Extractor, KLayout and a number of custom scripts for design exploration and optimization to automate the process of designing and optimizing a custom ASIC from start to nish. It provides a complete design ow, including synthesis, placement and routing, timing analysis, and signo, all of which can be customized to meet specic design requirements. One of the key benets of OpenLane is that it enables designers to rapidly iterate and optimize their designs, resulting in faster design cycles and lower costs. The framework also includes a set of built-in quality assurance checks that help to ensure the design meets the required specications. The ow performs all ASIC implementation steps from RTL all the way down to GDSII. Currently, it supports the SkyWater SKY130 PDK ( Process Design Kit ), the GlobalFoundries GF180MCU PDK, and instructions to add support for other (including proprietary) PDKs are documented. 3.3 SV2V SV2V (SystemVerilog-to-Verilog) 4 is an open-source command-line project written in haskell, that translates SystemVerilog code into Verilog code. It supports most synthesizable SystemVerilog features, but not all. Some features like Assertions are also supported, but are simply dropped after theconversion. It is available for Ubuntu, macOS, and Windows. SV2V was used as the main tool to convert all SystemVerilog code into Verilog. 3.4 GHDL GHDL 5 is an open-source, command-line based simulator that allows the compilation, simulation and analysis of digital hardware designs written in VHDL. GHDL can perform both behavioral and RTL simulation, and supports a wide range of VHDL features, including user-dened types, subprograms, generics, and packages. GHDL was used to translate the posit arithmetics submodules code from VHDL to Verilog. 2 https://github.com/The-OpenROAD-Project/OpenLane 3 https://openlane.readthedocs.io/en/latest/ 4 https://github.com/zachjs/sv2v 5 http://ghdl.free.fr 3.5. Icarus Verilog 9 3.5 Icarus Verilog Icarus Verilog 6 is an open-source, command-line based Verilog simulation and synthesis tool. It is widely used by hardware designers and verication engineers to simulate and test digital hardware designs written in Verilog or SystemVerilog. Iverilog is available for free on various platforms such as Linux, macOS, and Windows. Iverilog was used to verify the code after translating it with SV2V and GHDL. 3.6 GTKWave GTKWave 78 is an waveform viewer for Unix, Win32, and Mac OSX which reads LXT, LXT2, VZT, FST, and GHW les as well as standard Verilog VCD/EVCD les and allows their viewing. See Figure 3.2. Is one of the applications aliated with the open-source gEDA Project. Like Iverilog, GTKWave was used to verify the code after translating it with SV2V and GHDL. Figure 3.2: GTKWave interface. Source: GTKWave Documentation 9 . 6 https://github.com/steveicarus/iverilog 7 https://gtkwave.sourceforge.net/ 8 https://wiki.tcl-lang.org/page/GTKWave/ 10 Chapter 3. State of the Art 3.7 Efabless Caravel chip The Efabless Caravel chip is a ready-to-use test harness for creating designs with the Google/Skywater 130nm Open PDK. The Caravel harness comprises of base functions supporting IO, power and conguration as well as drop-in modules for a management SoC core, and an approximately 3mm x 3.6mm open project area for the placement of user IP blocks. It is composed of the harness frame plus two wrappers for drop-in modules for the management area and user project area. See Figure 3.3. Figure 3.3: Current SoC architecture. Source: Caravel GitHub. 3.7.1 Management Area It typically includes a RISC-V based SoC that includes a number of peripherals like timers, UART, and GPIO. The management area runs rmware that can be used to: 1. Congure User Project I/O pads. 2. Observe and control User Project signals (through on-chip logic analyzer probes). 3. Control the User Project power supply. 3.7. Efabless Caravel chip 11 3.7.2 User Project Area The user space has a limited silicon area 2.92mm x 3.52mm as well as a xed number of I/O pads 38 and power pads 4. It has access to the following utilities provided by the management SoC: 1. 38 IO Ports. 2. 128 Logic analyzer probes. 3. Wishbone port connection to the management SoC wishbone bus. Figure 3.4: Caravel. Source: Efables website. Figure 3.5: OpenLane Flow. Source: Efables website. Chapter 4 Methodology This chapter describes all the work that has been done during this Bachelor's Final Project. 4.1 Methodology Since the core of PERCIVAL is written in System Verilog language and the tool OpenLane does not support natively System Verilog, it is necessary to use an conversion tool to convert it into Verilog. After that, it should be checked that it performs the same functionality, simulating it and passing through testbenches. Next is necessary to complete the desing ow using OpenLane and wrap it into the Efabless Caravel Project, where it will be hardened into the Efabless Caravel chip (see Figure 4.1). Further it is necessary to pass all prechecks to ensure the absence of errors related to netlist, DRC violations, oset violations, etc. And nally submit it to the Efabless Open MPW Shuttle Program. Figure 4.1: Wrapping the user project into the Efabless Caravel chip. Source: Caravel user project GitHub. To get used to the tools and meet the objectives, it is wiser to divide the task into three stages. During the rst stage a toy desing will be used to complete the design ow. In the second stage only the PAU will go through all the steps, and in 12 4.2. Toy Design 13 the third stage, the PERCIVAL core itself will go through all the steps (see Figure 4.2). The main steps are: 1. Translate SystemVerilog code into Verilog language. 2. Simulate it and pass through testbenchs to ensure the correct conversion and translation. 3. Use the OpenLane tool to complete the design ow. 4. Wrap it inside the Efabless Caravel Project. 5. Pass all prechecks and submit it. Figure 4.2: Methodology followed through this BSc. Thesis. 4.2 Toy Design First we create a test design that consists in a very simple 4-bit counter, that counts from 0 to 15. 4.2.1 Adding the Toy Project It will be assumed that Caravel is installed, to see the installation process see Appendix A. Inside the Caravel root folder there is " verilog/rtl " directory, in this folder we create our toy design named " counter ". counter.v module counter ( `ifdef USE_POWER_PINS inout vccd1, inout vssd1, `endif input clk, input rstn, output [3:0] out, output [3:0] io_oeb ); reg [3:0] out = 4'b0000; assign io_oeb = 4'b0000; 14 Chapter 4. Methodology always @ (posedge clk) begin if (rstn) out <= 4'b0000; else out <= out + 1'b1; end endmodule In the root there is another directory named " openlane ", in this folder all our congurations and variables will be stored in a separate folder named. To create the conguration folder we use the following command. mkdir openlane/counter The conguration les can be copied from the example " user_proj_example " project. Where the following variables should be changed to point to our counter.v le. In the same le we can adjust other variables like die area, clock period, clock port, dene the synth strategy, density, and so more. Dening them incorrectly can cause errors during the execution, we will see that with more detail in the next section (4.3). openlane/counter/config.json ... "DESIGN_NAME":"counter", "VERILOG_FILES": [ "dir::../../verilog/rtl/defines.v", "dir::../../verilog/rtl/counter.v" ], "CLOCK_PERIOD": 25, "CLOCK_PORT":"clk_i", ... In the " pin_order.cfg " le the orientation of the pins from counter.v can be dened. openlane/counter/pin_order.cfg #BUS_SORT #N out.* #S clk rstn io_oeb.* 4.2.2 Hardering After conguring the setup, we can proceed with the next steps. To harden our RTL design we use the following command. 4.2. Toy Design 15 make counter Caravel will start hardering the design using our conguration le. [INFO]: Using configuration in '../caravel_user_project/openlane/counter/config.json'... [INFO]: PDK Root: /pdk [INFO]: Process Design Kit: sky130A [INFO]: Standard Cell Library: sky130_fd_sc_hd [INFO]: Optimization Standard Cell Library: sky130_fd_sc_hd [INFO]: Run Directory: caravel_user_project/openlane/counter/runs/.. [INFO]: Preparing LEF files for the nom corner... [INFO]: Preparing LEF files for the min corner... [INFO]: Preparing LEF files for the max corner... [STEP 1] [INFO]: Running Synthesis [STEP 2] [INFO]: Running Single-Corner Static Timing Analysis ... The generated GDSII le of the 4-bit counter can be viewed using KLayout viewer. See Figure 4.3. klayout gds/counter.gds Figure 4.3: Generated circuit. As can be seen, the counter is a very small design that occupies few cells. 16 Chapter 4. Methodology 4.2.3 Integration in the Caravel To wrap this toy project into the Caravel Harness it is necessary to instantiate the project inside the wrapper project, include our RTL design and create testbenches for the toy project to check the correct behavior. To add the project into the wrapper project, it is necessary to instantiate it at the end of the " verilog/rtl/user_project_wrapper.v " le. verilog/rtl/user_project_wrapper.v ... /*--------------------------------------*/ /* User project is instantiated here */ /*--------------------------------------*/ counter counter ( `ifdef USE_POWER_PINS .vccd1(vccd1), // User area 1 1.8V power .vssd1(vssd1), // User area 1 digital ground `endif .clk(wb_clk_i), .rstn(wb_rst_i), // IO Pads. Skip 8 first pins as they are dual use. .out(io_out[11:8]), // counter output .io_oeb(io_oeb[11:8]) //drive low to enable output ); To include the counter RTL le it is necessary to modify the second and third line inside " includes.rtl.caravel_user_project " le. verilog/includes/includes.rtl.caravel_user_project # Caravel user project includes -v $(USER_PROJECT_VERILOG)/rtl/user_project_wrapper.v -v $(USER_PROJECT_VERILOG)/rtl/counter.v And modify the following environment variables in the conguration le to point to our module. openlane/user_project_wrapper/config.json 1. VERILOG_FILES_BLACKBOX 2. EXTRA_LEFS 3. EXTRA_GDS_FILES For the testbench it is possible to create it from zero or to copy the default " io_ports " testbench and modify it for our toy project. cp -r verilog/dv/io_ports/ verilog/dv/counter 4.2. Toy Design 17 The name of the test les should be equal to the name of our project name. So " io_ports_tb.v " and " io_ports.c " les should be renamed to " counter_tb.v " and " counter.c ". The testbench itself is inside " counter_tb.v " and the following parts of the le should be modied: 1. Module name. 2. Assign our output pins. 3. Modify the names of dumple, dumpvars and spiash les. 4. Create the test that compares the desired output with the real one. counter_tb.v module counter_tb; ... assign mprj_io_0 = mprj_io[11:8]; ... $dumpfile("counter.vcd"); $dumpvars(0, counter_tb); ... initial begin // Observe Output pins wait(mprj_io_0 == 4'b0000); wait(mprj_io_0 == 4'b0001); wait(mprj_io_0 == 4'b0010); wait(mprj_io_0 == 4'b0011); wait(mprj_io_0 == 4'b0100); wait(mprj_io_0 == 4'b0101); wait(mprj_io_0 == 4'b0110); wait(mprj_io_0 == 4'b0111); wait(mprj_io_0 == 4'b1000); wait(mprj_io_0 == 4'b1001); wait(mprj_io_0 == 4'b1010); wait(mprj_io_0 == 4'b1011); wait(mprj_io_0 == 4'b1100); wait(mprj_io_0 == 4'b1101); wait(mprj_io_0 == 4'b1110); wait(mprj_io_0 == 4'b1111); `ifdef GL $display("Monitor: Test 1 Mega-Project IO (GL) Passed"); `else $display("Monitor: Test 1 Mega-Project IO (RTL) Passed"); `endif $finish; end ... spiflash #( 24 Chapter 4. Methodology pau_valid_i = 0; #5 rst_ni = 0; #10 $finish; end // Clock generator always begin #1 clk_i = ~clk_i; // Toggle clock every 5 ticks end pau_top dut ( clk_i, rst_ni, fu_data_i, pau_valid_i, pau_ready_o, pau_trans_id_o, pau_valid_o, result_o ); endmodule In order to simulate the above testbench, Icarus Verilog and GTKWave were be used. To compile the source code and execute the compiled program, the next command has been executed. iverilog -o a.out pau_top_tb.v vvp a.out Opening and viewing the simulation using GTKWave. See Figure 4.9. gtkwave pau_top_tb.vcd In a more detailed view of the simulation, we can see the behavior of the design. See Figure 4.10. After introducing our input in fu_data_i we can see that the output from the PAU is the result of our operation codied in posit32. (hex) 50000000 (posit) 01010000000000000000000000000000 (decimal) 4 4.3.3 Hardering the Design In order to harden the design, the OpenLane tool need to be used. It can be used inside the Caravel or it can be used alone. It was decided to use OpenLane, because it is a little easier to manage les and sources. 4.3. PAU 25 Figure 4.9: GTKWave simulation after selecting all signals and appending them into the viewer. All results are displayed in hexadecimal format. Figure 4.10: Detailed view. In order to open OpenLane directory, the following command needs to be executed. cd dependencies/openlane_src/ The designs are stored inside the "design" directory. To harder the PAU it is necessary to create a directory inside and copy our translated code inside | /pau/src |. As in the case of the Caravel ow, the conguration le is necessary and the le that denes the orientation of pinouts is optional, they shoudl be stored at " /pau ". So our directory should be as follows: $ ls src/ config.json pin_order.cfg Content of " pin_order.cfg ": #BUS_SORT #N clk_i.* rst_ni.* pau_trans_id_o.* 26 Chapter 4. Methodology fu_data_i.* result_o.* pau_valid_i pau_ready_o pau_valid_o #W #E #S To execute the hardering, it is necessary to mount the OpenLane image and launch the ow. make mount ./flow.tcl -design pau -tag pau Compared to the previous toy design, this one is harder and after automated translation, the le structure and code became more confusing and unorganized. Due to all this and to the fact that most process in OpenLane use only one thread, it takes several hours to complete the design ow for the PAU. To nd an acceptable conguration, multiple combinations of variables, as die size, clock period, density, synth strategy were tried. The main diculty to nd a valid conguration is the long execution time and necessity to try dierent variables to nd the optimal die size, clock time without timing exceptions. Below are some errors that were found when searching for an acceptable conguration. Error due to timing violation. [ERROR]: There are setup violations in the design at the typical corner. Please refer to 'designs/pau_a/runs/RUN/reports/signoff/25-rcx_sta.max.rpt'. To solve this problem, the clock period was increased. Error due to area violation. [ERROR GPL-0301] Utilization exceeds 100%. Error: gpl.tcl, 69 GPL-0301 To solve this problem, the die area was increased. config.json {"DESIGN_NAME":"pau_top", "DESIGN_IS_CORE": 0, "KLAYOUT_XOR_THREADS": 24, "ROUTING_CORES": 24, "VERILOG_FILES": [ "dir::src/pau_top.v" 4.3. PAU 27 ], "CLOCK_PERIOD": 30, "CLOCK_PORT":"clk_i", "CLOCK_NET":"pau_top.clk", "IO_PCT": 0.2, "PL_RESIZER_HOLD_MAX_BUFFER_PERCENT": 100, "PL_RESIZER_SETUP_MAX_BUFFER_PERCENT": 100, "GLB_RESIZER_HOLD_MAX_BUFFER_PERCENT": 100, "GLB_RESIZER_SETUP_MAX_BUFFER_PERCENT": 100, "PL_RESIZER_HOLD_SLACK_MARGIN": 0.8, "GLB_RESIZER_HOLD_SLACK_MARGIN": 0.8, "PL_RESIZER_SETUP_SLACK_MARGIN": 0.4, "PL_RESIZER_MAX_SLEW_MARGIN": 50, "GLB_RESIZER_MAX_SLEW_MARGIN": 50, "GLB_RESIZER_SETUP_SLACK_MARGIN": 0.2, "GRT_MAX_DIODE_INS_ITERS": 20, "GRT_ANT_ITERS": 20, "MAGIC_DEF_LABELS": 0, "SYNTH_BUFFERING": 0, "FP_SIZING":"absolute", "FP_CORE_UTIL": 40, "DIE_AREA":"0 0 1000 1000", "PL_TARGET_DENSITY": 0.45, "IO_SYNC": 0, "SYNTH_STRATEGY":"AREA 3", "VDD_NETS": ["vccd1"], "GND_NETS": ["vssd1"], "DIODE_INSERTION_STRATEGY": 3, "RUN_CVC": 1, "pdk::sky130*": { "FP_CORE_UTIL": 40, "RT_MAX_LAYER":"met4", "scl::sky130_fd_sc_hd": { "CLOCK_PERIOD": 28 } } } The generated GDSII le is located inside the created "runs/" directory. See Figure 4.11. $ layout runs/pau/result/signoff/pau_top.gds 28 Chapter 4. Methodology Figure 4.11: PAU GDSII le. As can be seen (see Figure 4.11), The PAU occupies almost the entire design area, despite this, it is only a third of the space that Caravel Harness has available. During this hardening, an attempt was made to minimize the PAU area, using " 1000 1000 " ( µ m) as maximum die area, while the Caravel Harness has " 2920 3520 " ( µ m) available. Since there were no announcements of new releases of the Efables MPW Open Program, the PAU was not submitted. And it was not integrated in the Caravel either, because the PAU has more physical pinouts than the Caravel Harness. While the PAU has 151 pinouts, the Caravel Harness only has 38 available IO ports. 4.4 PERCIVAL Core This section is about the work done with the PERCIVAL core. Although at this point it was already known that the PERCIVAL core does not t to the constraints of the MPW program, due to the number of pinouts and its larger size than the design area, it was decided to advance as much as possible. 4.4.1 PERCIVAL Core Translation and Bug Fixes To proceed with the PERCIVAL core, a translation of the code to Verilog should be done. All unnecessary les that do not belong to source code should be removed, only les inside "/src" are necessary to perform the translation. As we want to convert only the code, all testbenches also should be removed from our working directory. -"axi/test" -"axi/src/axi_test.sv" 4.4. PERCIVAL Core 29 -"axi_riscv_atomics/test" -"common_cells/test" -"fpu/src/common_cells/test" -"fpu/tb" -"pmp/tb" -"fpga-support" Remove all unused or deprecated code that it is included inside submodules, and also remove PAU code since we already translated it into verilog. -"axi_mem_if/src/deprecated" -"common_cells/formal": - not used in other files -"pau_top" Using "les.sh" script we list all ".sv" les in specied directory into a text le, and later executing sv2v to redirect all these les as input. If the translating of the directory is nished without any problem we procced to another directory, in other case, the problem should be examined and solver. files.sh NAME="{replace_with_directory_name}" find "src/${NAME}" -type f -\( -name "*.sv" -or -name "*.svh" \) | sed 's/^\.\///g' | sort > listFiles.txt sed -e ':a;N;$!ba;s/\n/ /g' listFiles.txt > listFilesOneLine.txt ./sv2v/bin/sv2v $(cat listFilesOneLine.txt) -w "converted_src/${NAME}.v" -v Some les can be translated without errors, but others throw the following errors. sv2v: could not find package "axi_pkg" It means that we need to include the package " axi_pkg " from another directory. It can be solved adding the absence package to the sv2v input. Other problems that were found: fpu/ : sv2v: src/fpu/src/fpnew_cast_multi.sv:14:96: Lexical error: Could not find file "common_cells/registers.svh", included from "src/fpu/src/fpnew_cast_multi.sv" Solution: Copy src/common_cells/include/common_cells to src/fpu/src/common_cells . util/ : sv2v: src/util/ex_trace_item.svh:23:14: Parse error: unexpected token 'new' (KW_new) 30 Chapter 4. Methodology Solution: sv2v struggles converting some high level code, and as we are not interested in human readable form of exceptions, we can comment the whole le and places where is being used. sv2v: src/util/instr_trace_item.svh:34:35: Parse error: unexpected token '' (Sym_dollar) Solution: sv2v struggles converting high level code, and as we are not interested in human readable form of instruction tracer, we can comment the whole le and places where is being used. Another solution: Remove all les and code (ariane.sv) related to tracer, as we don not need them. common_cells/ : sv2v: src/common_cells/src/cdc_fifo_gray.sv:74:96: Lexical error: Could not find file "common_cells/registers.svh", included from "src/common_cells/src/cdc_fifo_gray.sv" Solution: Copy src/common_cells/include/common_cells to src/common_cells/src/common_cells sv2v: src/common_cells/src/rr_arb_tree.sv:62:3: Parse error: missing expected `endmodule` Solution: sv2v struggles converting some high level SystemVerilog code. sv2v: illegal access to bit j of linked_data_q[i].data, which has type logic, within scope id_queue.gen_lookup[i].gen_mask[j].<unnamed_block>.<unnamed_block>. <unnamed_block>, near src/common_cells/src/id_queue.sv:227:25 Solution: Fix bug in line 227 of common_cells/src/id_queue.sv le exists_match_bits[j] = (linked_data_q[i].data[j] == exists_data_i[j]); Fixed to: exists_match_bits[j] = (linked_data_q[i].data == exists_data_i[j]); After all folders are checked that they can be converted with sv2v. We can proceed to converting the whole core using sv2v. Include folder is moved into src folder so we dont need to add in the rute manually into the sv2v. 4.4. PERCIVAL Core 31 sv2v: too many bindings specified for port connections in instance "tag_sram" of "sram" Solution: After looking for the " sram " module, we found that there are 2 modules:  convertion_tb/src/common_cells/src/sram.sv  convertion_tb/src/util/sram.sv The second one with one more input " rst_ni ". After looking for usage of the " sram " module, we found that all of them use the version with " rst_ni " pin. So we just comment the other sram version. After the whole core is converted we procceed with the testbench convertion. To convert the test les we use the following command: ./sv2v/bin/sv2v src/include/ariane_axi_pkg.sv src/axi/src/axi_pkg.sv tb/ariane_axi_soc_pkg.sv src/include/riscv_pkg.sv src/include/ariane_pkg.sv tb/ariane_soc_pkg.sv src/riscv-dbg/src/dm_pkg.sv tb/ariane_testharness.sv -w converted_src/ariane_testharness.v -v As mentioned previously, the Caravel have limited pinouts and limited design area. Consequently is impossible to wrap the PERCIVAL inside the Caravel, and considering cost of time to nd the optimal conguration and the execution, it was decided to leave it here. Chapter 5 Results and Future Work Once all the content of the Bachelor's Final Project has been briey described, in this chapter The conclusions are discussed and future lines of work are proposed, based on the work done. 5.1 Results The main objective was, using open source tools, to complete the entire design ow to create the necessary les and be able to fabricate the PERCIVAL core by participating in the Eess MPW Open Program. Since the work was divided into three parts, we can summarize the results of each of those parts.  Toy design: A simple toy design was created to learn the tools and get used to the design process. It was hardened and wrapped inside the Caravel Harness, but being a toy design, it was not included in the project, but developing it helped in other stages.  PAU: To start the design ow with the PAU it was necessary to translate it from SystemVerilog and VHDL to Verilog in order to use the selected tools. Once completed, the design ow was initiated and hardening was performed using OpenLane. During this stage, it was understood that it was impossible to integrate the PAU as is within the Caravel due to the incompatibility in the number of pins, which is why it was not nally wrapped inside the Caravel Harness.  PERCIVAL: As with the PAU, it was necessary to translate it to Verilog, in order to continue. The translation steps were the most complicated due to lack of experience and multiple errors that had to be xed manually when using conversion tools. Despite this, it was translated but it was not hardened due to its expected high computational cost and impossibility of integrating it into the Caravel Harness. 32 5.2. Conclusions 33 5.2 Conclusions The possibility of getting this far shows that, nowadays, almost anyone has the possibility to create his own SoC hardware, and participate in programs, like Efables Open MPW, with the possibility to fabricate it for free. Thanks to open source tools like OpenLane, you will no longer have to struggle with all the design steps, using dierent applications and tools, or paying for proprietary tools to create something yourself. Despite not meeting all the objectives, it was possible to create all the necessary les for the manufacture of the PAU, as a separate design from the caravel. 5.3 Future work For future work there is the possibility of carrying out the entire process described again and nishing it using the new generation of OpenLane 1 that is still under development. It is also possible to translate the code manually without using automated tools that may cause errors or may not translate all high-level code. Try to further optimize the les created in terms of die area and timing, and try to participate in other free programs to fabricate the PERCIVAL core or the PAU on a physical chip. 1 https://github.com/efabless/openlane2