GOWIN EMPU M1 Provides Four Download Methods of Hardware Design and Software Instructions

June 4, 2024
GOWIN

GOWIN EMPU M1 Provides Four Download Methods of Hardware Design and

Software

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-PRODUCT

Copyright © 2021 Guangdong Gowin Semiconductor Corporation. All Rights Reserved. , , Gowin, GOWINSEMI, and GowinSynthesis are trademarks of Guangdong Gowin Semiconductor Corporation and are registered in China, the U.S. Patent and Trademark Office, and other countries. All other words and logos identified as trademarks or service marks are the property of their respective holders. No part of this document may be reproduced or transmitted in any form or by any denotes, electronic, mechanical, photocopying, recording or otherwise, without the prior written consent of GOWINSEMI. Disclaimer GOWINSEMI assumes no liability and provides no warranty (either expressed or implied) and is not responsible for any damage incurred to your hardware, software, data, or property resulting from usage of the materials or intellectual property except as outlined in the GOWINSEMI Terms and Conditions of Sale. All information in this document should be treated as preliminary. GOWINSEMI may make changes to this document at any time without prior notice. Anyone relying on this documentation should contact GOWINSEMI for the current documentation and errata.

Revision History

Date Versi Description
02/19/2019 1.0E Initial version published.

07/18/2019

|

1.1E

| l  Supports the automated merging tool used for MCU hardware design and software programming design.

l  MCU supports off-chip SPI-Flash downloading and startup.

08/18/2019

|

1.2E

| l  MCU hardware design and software programming design support extended peripheral: DD3 Memory.

l  Fixed known issues of ITCM, DTCM Size and IDE.

09/27/2019| 1.3E| The description of software configuration updated.

01/16/2020

|

1.4E

| l  MCU hardware design and software programming design supports PSRAM.

l  Updated MCU compiling software GMD V1.0.

l  RTOS reference design updated.

l  Hardware and software reference design of AHB2 and APB2 extension bus interface added.

03/03/2020

|

1.5E

| l  Known issues of ITCM, DTCM Size and IDE fixed.

l  The FPGA devices of GW2A-18C/GW2AR-18C/GW2A-55C supported.

06/12/2020

|

1.6E

| l  MCU supports External instruction memory.

l  MCU supports External data memory.

l  6 AHB bus interfaces extended.

l  16 APB bus interfaces extended.

l  GPIO supports multiple interface types.

l  I2C supports multiple interface types.

l  Merge_bit tool supports GowinSynthesis® to parse the rules of naming.

01/25/2021

|

1.7E

| l  The reference design of GW1N-9C, GW2A-18C, GW2A-55C (Version C) updated.

l  The download auxiliary tools called Merge_bit and make_hex updated.

l  The reference design and the version of Gowin Software updated.

07/21/2021

|

1.8E

| l  GW1N-9C/GW1NR-9C supports embedded UserFlash as instruction memory.

l  Merge_bit tool updated.

l  The SynplifyPro deleted.

l  The version of FPGA and MCU software updated.

10/12/2021| 1.9E| GW2AN-9X/GW2AN-18X merge_bit download deleted.

List of Figures

  • Figure 2-1 Configure External Tool ………………………………………………………………………………………. 4
  • Figure 2-2 Configure ITCM Initialization ……………………………………………………………………………….. 5
  • Figure 3-1 Configure Post-Place File ……………………………………………………………………………………. 7
  • Figure 3-2 Merge Software Programming Design and Hardware Design ………………………………….. 8
  • Figure 4-1 ROM Start Address and Size Configuration …………………………………………………………… 9
  • Figure 4-2 Configure ITCM Initialization Path ………………………………………………………………………… 10
  • Figure 4-3 Onfiure Dual-Purpose Pin …………………………………………………………………………………… 11
  • Figure 4-4 Device configuration for Hardware Download ………………………………………………………… 13
  • Figure 4-5 Device Configuration for Software Download ………………………………………………………… 14
  • Figure 5-1 ROM Start Address and Size Configuration …………………………………………………………… 15
  • Figure 5-2 ITCM Select Configuration ………………………………………………………………………………….. 16
  • Figure 5-3 GW1N(R)-9C Device Configuration ……………………………………………………………………… 17

List of Tables

  • Table 3-1 merge_bit Commands and Parameters ………………………………………………………………….. 6
  • Table 4-1 Bootload Corresponding to ITCM Size …………………………………………………………………… 10

Download Methods

Gowin_EMPU_M1 provides four download methods of hardware design and software programming design:

  1. Use the mapping files generated by software programming design as the ITCM initial value of hardware design.
    • Use Gowin_EMPU_M1 software programming design to generate BIN files in software design.
    • Use the make_hex tool to convert the BIN files in software design to four mapping files in a hexadecimal format: itcm0, itcm1, itcm2, and itcm3.
    • Use itcm0, itcm1, itcm2, and itcm3 as the ITCM initial value files in hardware design to read in.
    • Synthesis, place & route to generate the bitstream files in hardware design including software programming design and hardware design.
    • Use Programmer, the download tool, to download the bitstream files in hardware design.
  2. Merge the BIN files in software design generated by software programming design and the BIN files in hardware design generated by hardware design.
    • Use Gowin_EMPU_M1 hardware design to generate bitstream files in hardware design.
    • Use Gowin_EMPU_M1 software programming design to generate BIN files in software design.
    • Use the merge_bit tool to merge the BIN files in software design and bitstream files in hardware design.
    • Generate new bitstream files in hardware design after merging the software design and the hardware design.
    • Use Programmer, the download tool, to download the bitstream files in hardware design after merging.
  3. Use off-chip SPI-Flash to download the BIN files generated by software programming design.
    • In Gowin_EMPU_M1 hardware design, configure ITCM Size and select different bootload as the initial value of ITCM according to ITCM Size.
    • In Gowin_EMPU_M1 hardware design, generate bitstream files in hardware design with the off-chip SPI-Flash that provides download functions.
    • the Programmer, the download tool, to download the bitstream files in hardware design generated by hardware design.
    • Use Gowin_EMPU_M1 software programming design to generate BIN files in software design.
    • Use Programmer, the download tool, to download the BIN files generated by software programming design.
  4. Use embedded UserFlash to download the BIN files generated by software programming design.
    • In Gowin_EMPU_M1 hardware design, ITCM Select is configured as External Instruction Memory.
    • Instantiate UserFlash Controller (GW1N-9C/GW1NR-9C FLASH608K) with Memory Map as the instruction memory of Gowin_EMPU_M1.
    • Synthesize, place, and route Gowin_EMPU_M1 hardware design to generate bitstream files in hardware design.
    • Build and link Gowin_EMPU_M1 software programming design to generate BIN files in software design.
    • Use Programmer, the download tool, to download the bitstream files in hardware design and BIN files in software design.

Software Programming Output as ITCM Initialization Value

Tool

Gowin_EMPU_M1\tool\make_hex\bin\make_hex.Exe Access the above software tools via this link: http://cdn.gowinsemi.com.cn/Gowin_EMPU_M1.zip

Command Parameters

  • make_hex.exe bin-file

Software Configuration

Use software programming design to generate BIN files in software design. Use the make_hex tool to convert the BIN files in software design to four mapping files in a hexadecimal format: itcm0, itcm1, itcm2, and itcm3. In ARM Keil MDK (V5.26 and above), configure make_hex.exe as external tool, as shown in Figure 2-1.

  • Run #1:fromelf.exe –bin -o bin-file axf-file
  • Run #2:make_hex.exe bin-file Automatically call the make_hex.exe tool to generate the BIN files in software design to four mapping files in a hexadecimal format. +

Figure 2-1 Configure External Tool

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-1

Hardware Configuration

In IP Core Generator in Gowin Software:

  • Select “Cortex-M1 > Memory > ITCM > ITCM Select > Internal Instruction Memory”.
  • Select “Cortex-M1 > Memory > ITCM > Initialize ITCM”.
  • Select “Cortex-M1 > Memory > ITCM > ITCM Initialization Path” and import the path of the four mapping files in a hexadecimal format of itcm0, itcm1, itcm2, and itcm3 as the initial value of ITCM, as shown in Figure 2-2.
  • Import itcm0、itcm1、itcm2、itcm3 as the initial value of ITCM, as well as Gowin_EMPU_M1 hardware design generated after the external tool configuration of Cortex-M1 and AHB/APB in IP Core Generator. The hardware design includes software programming design.

Figure 2-2 Configure ITCM Initialization

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-2

Design Flow

  1. Use the software programming design of ARM Keil MDK (V5.26 and above) and GOWIN MCU Designer (V1.1 and above) to compile four mapping files in a hexadecimal format of itcm0, itcm1, itcm2, and itcm3.
  2. Use IP Core Generator in Gowin Software to generate Gowin_EMPU_M1 hardware design. and itcm0, itcm1, itcm2, and itcm3 generated by software programming design are used as the initial value of ITCM in hardware design.
  3. Instantiate Gowin_EMPU_M1 Top Module, and connect user design.
  4. Add physical and timing Constraints.
  5. Use GowinSynthesis® as the synthesis tool to synthesize.
  6. Use Place & Route tool to generate the bitstream files in hardware design including software programming design.
  7. Use Programmer, the download tool, to download the bitstream files in hardware design.

Devices Supported

  • GW1N-9/GW1NR-9/GW1N-9C/GW1NR-9C
  • W2AN-9X/GW2AN-18X
  • GW2A-18/GW2A-18C/GW2AR-18/GW2AR-18C/GW2ANR-18C
  • GW2A-55/ GW2A-55C/ GW2AN-55C

Reference Design

  • Access the reference design via this link:
  • Gowin_EMPU_M1\tool\make_hex\example

Merge Software Design and Hardware Design

Tool3

Gowin_EMPU_M1\tool\merge_bit\bin\merge_bit.bat Access the above software tools via this link: http://cdn.gowinsemi.com.cn/Gowin_EMPU_M1.zip

Command Parameters

Software commands and parameters: call make_loc.exe –i posp-file –s itcm_size [-d] –t synthesis_tool call merge_bit.exe bin-file itcm.loc fs-file For the description of commands and parameters, please refer to Table 3-1.

Table 3-1 merge_bit Commands and Parameters

Parameter Description
make_loc.exe Input posp-file and generate itcm.loc file, the ITCM layout

information.
-i| Post-Place File, generated by configure “Place & Route > General > Generate Post-Place File” in Gowin Software.
-s| ITCM Size, configured according to Gowin_EMPU_M1 hardware design
-d| Optional

If configure Enable Debug, then enable -d. If configure Disable Debug, then disable -d.

-t| Specify the synthesis tool: gowin_syn.
merge_bit.exe| Merge Gowin_EMPU_M1 software design and hardware design.
bin-file| Use Gowin_EMPU_M1 software programming design to generate BIN files in software design.
itcm.loc| Itcm.loc file, ITCM layout information generated by make_loc.exe.
fs-file| Bitstream files in hardware design generated by Gowin_EMPU_M1 hardware design.

Merge the BIN files in software design generated by software programming design and the bitstream files in hardware design generated by hardware design. During the use of merge_bit.bat, you can modify the parameters, such as -i posp-file, -s itcm_size, -d、bin-file, fs-file, according to your requirements.

Hardware Configuration

In Gowin Software configuration options, select “Place & Route > General > Generate Post-Place File”, and set “True” to generate Post-Place File as the posp input file of make_loc.exe -i parameter, as shown in Figure 3-1.

Figure 3-1 Configure Post-Place File

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-3

Design Flow
Merge

  1. Gowin_EMPU_M1 hardware design can generate bitstream files in hardware design and Post-Place File.
  2. Gowin_EMPU_M1 software programming design can generate BIN files in software design.
  3. Perform merge_bit.bat, merge the bitstream files in hardware design generated by hardware design and the BIN files in software design generated by software programming design to generate new bitstream files, as shown in Figure 3-2.

Figure 3-2 Merge Software Programming Design and Hardware Design

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-4

Download

After merging, use Programmer to download the new bitstream files in hardware design. For the usage of Gowin Programmer, please see SUG502, Gowin Programmer User Guide.

Devices Supported

  • GW2A-18/GW2A-18C/GW2AR-18/GW2AR-18C/GW2ANR-18C
  • GW2A-55/ GW2A-55C/ GW2AN-55C

Application Software

  • Gowin_V1.9.8.01 and above

Reference Design

Access the reference design via this link: Gowin_EMPU_M1\tool\merge_bit\example

Off-chip SPI-Flash Download

Software Configuration

In Gowin_EMPU_M1 Software Programming Design: If you use ARM Keil MDK (V5.26 and above) software development environment, set the IROM1 start address to 0x400 and set the IROM1 Size according to the actual ITCM Size hardware configuration. Taking DK-START-GW2A18 V2.0 reference design in SDK for an instance, set IROM1 to 0x7C00, as shown in Figure 4-1.

Figure 4-1 ROM Start Address and Size Configuration

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-5

If you use GOWIN MCU Designer (V1.1 and above) software development environment, change the Flash start address of the Flash linker GOWIN_M1_flash.ld to 0x00000400.

Hardware Configuration
ITCM Initialization Configuration

Use IP Core Generator tool in Gowin Software to configure and generate Gowin_EMPU_M1 hardware design:

  • Select Internal Instruction Memory as the instruction memory of Gowin_EMPU_M1.
  • Select ITCM Size.
  • Select Initialized ITCM.
  • Select different bootload as the initial value of ITCM according to ITCM Size. Import bootload path to ITCM Initialization Path. Configure ITCM Initialization as shown in Figure 4-2.

Figure 4-2 Configure ITCM Initialization PathGOWIN-EMPU-M1-Provides-Four-
Download-Methods-of-Hardware-Design-and-Software-FIG-6 The bootload corresponding to different ITCM Size are as show in Table 4-1.

Table 4-1 Bootload Corresponding to ITCM Size

ITCM Size (KByte) bootload
2 Gowin_EMPU_M1\bootload\boot\ITCM_Size_2KB
4 Gowin_EMPU_M1\bootload\boot\ITCM_Size_4KB
8 Gowin_EMPU_M1\bootload\boot\ITCM_Size_8KB
16 Gowin_EMPU_M1\bootload\boot\ITCM_Size_16KB
32 Gowin_EMPU_M1\bootload\boot\ITCM_Size_32KB
64 Gowin_EMPU_M1\bootload\boot\ITCM_Size_64KB
128 Gowin_EMPU_M1\bootload\boot\ITCM_Size_128KB

Dual-Purpose Pin Configuration

In Gowin Software configuration options, select “Place & Route > Dual-Purpose Pin” to configure MSPI as universal IO, as shown in Figure Figure 4-3.

Figure 4-3 Onfiure Dual-Purpose PinGOWIN-EMPU-M1-Provides-Four-Download-
Methods-of-Hardware-Design-and-Software-FIG-7

Design Flow

  1. Gowin_EMPU_M1 hardware design configuration:
    • Select Internal Instruction Memory.
    • Select ITCM Size.
    • Select Initialized ITCM.
    • Select different bootload as the initial value of ITCM according to ITCM Size.
  2. Generate Gowin_EMPU_M1 hardware design.
  3. Synthesize, place & route to generate bitstream files in hardware design with the off-chip SPI-Flash that provides download function.
  4. Configure Device configuration with Programmer to download the bitstream files in hardware design.
  5. Gowin_EMPU_M1 software programming design can generate BIN files in software design.
  6. Configure Device configuration in Programmer to download the BIN file in software design.

Download

For the usage of Gowin Programmer, please see SUG502, Gowin Programmer User Guide.

Download Bitstream Files in Hardware Design

Gowin_EMPU_M1 hardware design generates bootload as the initial value of ITCM and bitstream files with the off-chip SPI-Flash that provides download functions. Use Programmer, the download tool, to download the bitstream files in hardware design. Select “Tools > Programmer” in the menu bar or “Programmer” ( ) in the tool bar in Gowin Software to open Programmer, the download tool. Select “Edit > Configure Device” in the menu bar or “Configure Device” ( ) in the tool bar to open the “Device configuration”.

  • Select “External Flash Mode” in “Access Mode” drop-down list.
  • Select “exFlash Erase, Program thru GAO-Bridge” or “exFlash Erase, Program, Verify thru GAO-Bridge” in the “Operation” drop-down list.
  • Import the hardware design bitstream file required to download in the “Programming Options > File name” option.
  • Select “External Flash Options > Device” based on the onboard Flash chip types (such as on-board Winbond W25Q64BV of DK-START-GW2A18 V2.0).
  • Select “External Flash Options > Start Address” to set the start address as 0x000000.
  • Click “Save” to configure the download of bitstream files in hardware design, as shown in Figures 4-4.

Figure 4-4 Device configuration for Hardware Download

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-8

After device configuration, click “Program/Configure” in the Programmer toolbar to download bitstream files in hardware design.

Download BIN File in Binary Format in Software Design

After downloading the bitstream files in Gowin_EMPU_M1 hardware design, download the BIN files in binary format in software design with the Programmer, the download tool.
Open Programmer, the download tool, in Gowin Software or under the software installation path. Click “Edit > Configure Device” in the menu bar or “Configure Device”  in the toolbar to open the “Device configuration”.

  • Select “External Flash Mode” in the “Access Mode” drop-down list.

  • Select “exFlash C Bin Erase, Program thru GAO-Bridge” or “exFlash C Bin Erase, Program, Verify thru GAO-Bridge” in the “Operation” drop-down list.

  • Select “FW/MCU Input Options > Firmware/Binary File” to import the BIN files in the software design to download.

  • Select “External Flash Options > Device” based on the on-board Flash chip types (such as on-board Winbond W25Q64BV of
    DK-START-GW2A18 V2.0).

  • Select “External Flash Options > Start Address” to set the start address as 0x400000.

  • Click “Save” to configure the download of BIN files in software design, as shown in Figures 4-5.

Figure 4-5 Device Configuration for Software Download

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-9

After device configuration, click the “Program/Configure” Programmer toolbar to download BIN files in software design.

Devices Supported

  • GW2AN-9X/GW2AN-18X
  • GW2A-18/GW2A-18C/GW2AR-18/GW2AR-18C/GW2ANR-18C
  • GW2A-55/ GW2A-55C/ GW2AN-55C

Reference Design

Access the reference design via this link: Gowin_EMPU_M1\bootload\example

Embedded UserFlash Download

Software Configuration

Take DK-START-GW1N9 V1.1 reference design in SDK for an instance:If you use ARM Keil MDK (V5.26 and above) software development environment, set the IROM1 start address to 0x0 and set the IROM1 Size to 0x10000 (64KB), as shown in Figure 5-1.

Figure 5-1 ROM Start Address and Size Configuration

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-10

If you use GOWIN MCU Designer (V1.1 and above) software development environment, set “FLASH ORIGIN”, the Flash start address of the Flash linker GOWIN_M1_flash.ld to 0x00000000, and set Flash Size “LENGTH” to 64K.

Hardware Configuration

Use IP Core Generator tool of Gowin Software to configure and generate Gowin_EMPU_M1 hardware design. In this process, select External Instruction Memory as the instruction memory of Gowin_EMPU_M1 in ITCM Select options, as shown in

Figure 5-2. Figure 5-2 ITCM Select Configuration

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-11

Design Flow

  1. For Gowin_EMPU_M1 hardware design configuration, configure ITCM Select as External Instruction Memory.
  2. IP Core Generator generates Gowin_EMPU_M1 hardware design.
  3. Instantiate UserFlash Controller (GW1N-9C/GW1NR-9C FLASH608K) Memory Map as the instruction memory of Gowin_EMPU_M1.
  4. Synthesize, place & route to generate bitstream files in hardware design.
  5. Build and link to generate BIN files in software design.
  6. Use Programmer to download the bitstream files in Gowin_EMPU_M1 hardware design and BIN files in Gowin_EMPU_M1 software design.

Download

For the usage of Gowin Programmer, please see SUG502, Gowin Programmer User Guide. Select “Tools > Programmer” in the menu bar or “Programmer” in the tool bar in Gowin Software to open Programmer, the download tool.Select “Edit > Configure Device” in the Programmer menu bar or “Configure Device  in the tool bar to open the “Device configuration”, as shown in Figure 5-3.

  • Select “MCU Mode L” in “Access Mode” drop-down list.
  • Select “Firmware Erase, Program” or “Firmware Erase, Program, Verify” in the “Operation” drop-down list.
  • Import the hardware design bitstream file required to download in “Programming Options > File name” option.
  • Select “FW/MCU/Binary Input Options > Firmware/Binary File” to import the BIN files in software programming design required to download.
  • Click “Save” to complete the download configuration of the bitstream files in hardware design and BIN files in software design.

Figure 5-3 GW1N(R)-9C Device Configuration

GOWIN-EMPU-M1-Provides-Four-Download-Methods-of-Hardware-Design-and-
Software-FIG-12

After device configuration, click “Program/Configure” in the Programmer toolbar to download the bitstream files in hardware design and the BIN files in software programming design at the same time.

Devices Supported

  • GW1N-9C
  • GW1NR-9C

Reference Design

Access the reference design via this link: Gowin_EMPU_M1\solution\running_in_userflash\DK_START_GW1N9 _V1.1

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals