Created
August 27, 2025 11:03
-
-
Save cyring/75eba6678a754a62c508bfa0fbd788b5 to your computer and use it in GitHub Desktop.
FPGA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Tang Nano 20K |
Author
Author
Gowin Analyzer Oscilloscope
TangNano-20K-example
- Clone the examples from the repository
git clone [email protected]:sipeed/TangNano-20K-example.gitFPGA Designer
- Start the Gowin FPGA Designer and load the project
TangNano-20K-example/led/blink_led/blink_led.gprj
Analyzer Oscilloscope
- Create a GAO Config File from menu
File > New > GAO Config File - Choose the default Setting:
[o] For RTL Design[o] Standard
- Keep the suggested GAO Name as
blink_led- and the sub-directory to
TangNano-20K-example/led/blink_led/src - button
[Next >]will addsrc/blink_led.raoto the current project
- and the sub-directory to
Signals
- Back to the Design tree, double click the GAO file
blink_led.rao
Trigger
- From the
Trigger Optionstab - Double click
Trigger Port 0 - Click
(+)to add a signal- Click
[Search]button to popup theNetswindow - Select
count_1s[23:0]and add it to the right panel with button[>] - Validate with
[OK] - You will get
count_1s[23:0]assigned to thePort 0
- Click
- In the middle column
Match Units, double click theM0- You are in the
Match Unit 0where you selectTrigger Port 0from the drop-down box - With
count_1s[23:0]selected, enter the decimal value13500000 - This matches condition in the Verilog code
blink_led.vwhere( count_1s < 27000000/2 ) - Validate with
[OK] - The match unit
[x] M0should be ticked
- You are in the
- In the right column, add an expression
- In the empty panel, right-click mouse button to choose menu
[Add] - In the Expression calculator, click button
M0 - Validate with
[OK] - Expression
M0should be listed
- In the empty panel, right-click mouse button to choose menu
Capture
- Choose the
Capture Optionstab - Click the 3-dots buttons to assign a sample clock
- In the
Netspopup window click[Search]to populate the left panel with signals - Select
clkand add it to the right panel with[>] button - In the
Capture Signalspanel add two signals[Search]forcount_1s[23:0]andcount_1s_flag- Click
[>]to add both to theCapture Signalspanel
Build
- The GAO is all set up, save it from menu
File > "Save blink_led.rao" - Back to the Process tree of the FPGA Designer, select
Place & Route - Right-click mouse button to choose
Clean&Rerun All - Accept to remove the previous results
Oscilloscope
- Plug the TN20K to the PC from its USB-C cable
- If
ftdi_siomodule present then unload it withsudo modprobe -r ftdi_sio - Choose menu
Tools > Gowin Analyzer Oscilloscope - You should see all settings made so far:
exp0: M0trigger expressionM0match unit condition
Program fs
- Tick option
[o] Enable Programmer - Select the row which targets the
GW2AR-18device - Click button to program the
TN20k - Once FPGA programmed, it will auto reset with the
blink_ledbitstream
...
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Run