SUG918-1.9E - Gowin Software Quick Start Guide
SUG918-1.9E - Gowin Software Quick Start Guide
SUG918-1.9E,2024-08-09
Copyright © 2024 Guangdong Gowin Semiconductor Corporation. All Rights Reserved.
Contents
Contents ............................................................................................................... i
List of Figures .................................................................................................... iii
List of Tables ....................................................................................................... v
1 About This Guide ............................................................................................ 1
1.1 Purpose ............................................................................................................................... 1
1.2 Related Documents ............................................................................................................. 1
1.3 Terminology and Abbreviations ........................................................................................... 1
1.4 Support and Feedback ........................................................................................................ 2
2 Introduction ..................................................................................................... 3
2.1 Design Flow Introduction ..................................................................................................... 3
2.2 Quick Started Design Introduction ....................................................................................... 3
3 Quick Start ....................................................................................................... 5
3.1 Create a New Project .......................................................................................................... 5
3.1.1 Create a New Project ....................................................................................................... 5
3.1.2 Generate FIFO HS IP ....................................................................................................... 6
3.1.3 Load File ........................................................................................................................... 7
3.2 RTL Schematic .................................................................................................................... 8
3.3 GAO Configuration .............................................................................................................. 8
3.3.1 Create Standard Mode GAO Config File.......................................................................... 8
3.3.2 Configure Standard Mode GAO ....................................................................................... 9
3.4 GVIO Configuration ........................................................................................................... 11
3.4.1 Create GVIO Configuration File ..................................................................................... 11
3.4.2 Configuration Options .................................................................................................... 11
3.5 Use GowinSynthesis to Synthesize................................................................................... 12
3.5.1 Configuration .................................................................................................................. 12
3.5.2 Synthesize ...................................................................................................................... 13
3.6 View Schematic Diagram of the Netlist after Synthesis .................................................... 15
3.7 Physical Constraints .......................................................................................................... 15
3.7.1 Create New Physical Constraints ................................................................................... 15
3.7.2 Modify Physical Constraints ........................................................................................... 17
3.8 Timing Constraint............................................................................................................... 17
SUG918-1.9E i
Contents
SUG918-1.9E ii
List of Figures
List of Figures
SUG918-1.9E iii
List of Figures
SUG918-1.9E iv
List of Tables
List of Tables
SUG918-1.9E v
1 About This Guide 1.1 Purpose
1.1 Purpose
This manual uses FIFO HS as an example to introduce Gowin
Software and aims to help you get familiar with the usage and improve the
design efficiency.
SUG918-1.9E 1(34)
1 About This Guide 1.4 Support and Feedback
SUG918-1.9E 2(34)
2 Introduction 2.1 Design Flow Introduction
2 Introduction
SUG918-1.9E 3(34)
2 Introduction 2.2 Quick Started Design Introduction
SUG918-1.9E 4(34)
3 Quick Start 3.1 Create a New Project
3 Quick Start
After the project is created, the impl and src folders are generated
SUG918-1.9E 5(34)
3 Quick Start 3.1 Create a New Project
under the project creation path, as shown in Figure 3-2. impl contains
synthesis and PnR files and src contains the source files.
Figure 3-2 Project Directory
SUG918-1.9E 6(34)
3 Quick Start 3.1 Create a New Project
SUG918-1.9E 7(34)
3 Quick Start 3.2 RTL Schematic
SUG918-1.9E 8(34)
3 Quick Start 3.3 GAO Configuration
SUG918-1.9E 9(34)
3 Quick Start 3.3 GAO Configuration
SUG918-1.9E 10(34)
3 Quick Start 3.4 GVIO Configuration
SUG918-1.9E 11(34)
3 Quick Start 3.5 Use GowinSynthesis to Synthesize
SUG918-1.9E 12(34)
3 Quick Start 3.5 Use GowinSynthesis to Synthesize
In addition, you can add some attributes and instructions to the source
file to control synthesis. For the details, see SUG550, GowinSynthesis
User Guide. As shown in Figure 3-16, in this design, a specific net is
retained without optimization during the synthesis by using the/* synthesis
syn_keep=1 */ attribute.
Figure 3-16 Attributes and Instructions of GowinSynthesis
3.5.2 Synthesize
After synthesis configuration, you can start to synthesize.
Double-click "Synthesize" in Process window to synthesize, as shown
in Figure 3-17. When the icon changes to " ", you can double-click
Synthesis Report to view the report and double-click Netlist File to view the
netlist file.
SUG918-1.9E 13(34)
3 Quick Start 3.5 Use GowinSynthesis to Synthesize
If the project contains the GAO config file, after PnR, RTL_GAO folder
is generated under the project creation path \impl\gwsynthesis, as shown in
Figure 3-18, and this folder contains all the files generated by the RTL GAO
synthesis as shown in Figure 3-19.
ao_0 contains the parameter files of the AO core.
ao_control contains the parameter files of the control AO core.
gao.v is the netlist file GAO post-synthesis, encrypted.
gw_gao_top.v is the top file of GAO, connecting ao, ao_control and jtag
modules.
The other files are generated during GAO synthesis.
SUG918-1.9E 14(34)
3 Quick Start 3.6 View Schematic Diagram of the Netlist after
Synthesis
SUG918-1.9E 15(34)
3 Quick Start 3.7 Physical Constraints
SUG918-1.9E 16(34)
3 Quick Start 3.8 Timing Constraint
The design uses GAO, so the clock tck_pad_i is created in the same
way as clk. The relationship between clk and tck_pad_i is an asynchronous
SUG918-1.9E 17(34)
3 Quick Start 3.8 Timing Constraint
clock. If you do not want to use Gowin Software to analyze this relationship,
you can create a clock group constraint through the timing constraint editor.
Timing Report Constraint
Select "Timing Constraints > Report > Report Timing", right-click in the
blank space on the right and select "Create Report". In the popped-up
"Report Timing" dialog, configure the parameters; the setup paths for clk to
clk are reported, limiting the number of paths to 100, as shown in Figure
3-23.
Figure 3-23 Timing Report Constraint
SUG918-1.9E 18(34)
3 Quick Start 3.9 GPA Configuration
SUG918-1.9E 19(34)
3 Quick Start 3.9 GPA Configuration
Rate Setting
In this design, the transition rate of clk is 50% and the remaining
signals use the default value 12.5%, as shown in Figure 3-27.
SUG918-1.9E 20(34)
3 Quick Start 3.9 GPA Configuration
Clock Setting
In this design, the clock is created in the timing analysis, and the rest
are not set, as shown in Figure 3-28.
Figure 3-28 Clock Setting Configuration
SUG918-1.9E 21(34)
3 Quick Start 3.10 Place & Route
SUG918-1.9E 22(34)
3 Quick Start 3.10 Place & Route
After finishing PnR, the pnr folder is generated under the project
creation path \impl, as shown in Figure 3-32. The folder contains all the
SUG918-1.9E 23(34)
3 Quick Start 3.11 Download Bitstream
files generated in PnR, including the bitstream file, the netlist file after PnR,
and the output reports. For the details, refer to 3.13 Output Files.
Figure 3-32 PnR Directory
SUG918-1.9E 24(34)
3 Quick Start 3.12 Debugging with GVIO and Data Acquisition with
GAO
There are two "Start" buttons in the interface. The upper "Start" button
controls the operation of GAO, and the lower "Start" button controls the
operation of GVIO. GAO and GVIO can run simultaneously or
independently. Take the simultaneous operation of GAO and GVIO as an
example in the followings.
The gvio_test signal acts on the rst_n signal in the design, which is
active high and is stimulated through GVIO. When gvio_test is low, it does
not affect the FIFO HS design, as shown in Figure 3-35. When gvio_test is
high, the design remains in a reset state. Click on "GAO > Configuration" in
the Gowin Analyzer Oscilloscope interface, double-click "Match Units",
modify the "Value" to X, and the captured waveform is as shown in Figure
3-36.
SUG918-1.9E 25(34)
3 Quick Start 3.12 Debugging with GVIO and Data Acquisition with
GAO
Click the "Start" icon in the GAO interface to capture data. After
finishing capturing data, a window is generated to display the waveform.
The window supports cursor, zoom-out and so on so as to facilitate you to
analyze the data.
Figure 3-35 Jointly Debugging and Sampling with GAO and GVIO when
gvio_test=0
Figure 3-36 Jointly Debugging and Sampling with GAO and GVIO when
gvio_test=1
SUG918-1.9E 26(34)
3 Quick Start 3.13 Output Files
SUG918-1.9E 27(34)
3 Quick Start 3.13 Output Files
SUG918-1.9E 28(34)
3 Quick Start 3.14 File Encryption
SUG918-1.9E 29(34)
3 Quick Start 3.14 File Encryption
Select test_fifo as the top module. Click "Pack" to start encryption. The
relevant information will be printed in the Output window.
After the encryption, two files are generated under the destination path
(E:\FIFO_HS\src\test_fifo_pack): test_fifo_gowin.vp and test_fifo_sim.v.
test_fifo_gowin.vp: Encrypted files that can be used by others.
test_fifo_sim.v: Flattened synthesized plaintext netlist file that can be
used for simulation.
3.14.2 Simulation File Encryption
The simulation file provided by Gowin is plaintext. In order to protect
the simulation file, it can be encrypted by using a third-party simulation
software, such as Modelsim and VCS, and the license of the tool needs to
be obtained. Here it uses test_fifo_sim.v as an example to introduce the
encryption.
Encryption by Modelsim
When using Modelsim, the steps to encrypt the simulation file are as
follows:
1. Add macro `protect and `endprotect before and after the encrypted in
the simulation file test_fifo_sim.v.
SUG918-1.9E 30(34)
3 Quick Start 3.14 File Encryption
SUG918-1.9E 31(34)
4 Tcl 4.1 Tcl Execution
4 Tcl
SUG918-1.9E 32(34)
4 Tcl 4.2 Tcl Quick Start
The Second Way: use gw_sh.exe [script file] to execute the script file,
shown in Figure 4-3. Tcl script file can contain all the supported tcl
commands, such as, device, design file, option, and run information. Tcl
script file can be generated by handwriting or saveto command, but saveto
command The tcl script file can be generated by hand or by saveto
command, but the saveto command does not include the run command
when generating the tcl script, so you can add the run command if needed.
For tcl script details, see 4.2 Tcl Quick Start.
Figure 4-3 Tcl Script File Example
SUG918-1.9E 33(34)
4 Tcl 4.2 Tcl Quick Start
SUG918-1.9E 34(34)