5. Architecture Implementation User’s Guide#

5.1. Introduction#

Architecture Implementation is the part of the SpaceStudio environment that implements or synthesizes the system for your preferred Electronic Design Automation (EDA) implementation tool. The Architecture Implementation feature verifies the design according to the physical constraints of the targeted FPGA board, maps all components of the system to hardware IPs available in the library, connects them together, instantiates any additional required components, generates entity declarations for each module and device, cross-compiled software files to the appropriate processor, sets compiler options, links necessary libraries and adds and integrates the operating system if needed.

The Architecture Implementation feature currently supports the following list of EDA implementation tools:

  • Xilinx Vivado 2025.2

  • NanoXplore Impulse 24.3.0.0

Make sure the target EDA tool is correctly installed and configured on the machine before using the Architecture Implementation feature, as Architecture Implementation will call the EDA tool to properly generate files for it.

5.1.1. General considerations#

If no EDA tool supports the active architecture, the Architecture Implementation option (ToolsArchitecture Implementation…) will be grayed out.

Additionally, since the architecture of the last viewed diagram is the architecture that will be implemented, the Architecture Implementation option will also be grayed out if the SpaceStudio project has been opened but no diagram has been opened yet.

5.2. Design Preparation#

Before implementing the architecture, it is important to prepare it according to the physical constraints of the target FPGA board:

  • Make sure that the number of external memories, such as DDRs, does not exceed the number available on the target FPGA board.

  • The size of the external memories must not exceed the size of those available on the FPGA Board.

  • The internal memory instantiated in the design must not exceed the number of BRAMs available in the target FPGA device (for instance, see bram component in SpaceStudio).

  • The clock frequency of the system is in the range supported by the FPGA device.

Some of these verifications can be made in SpaceStudio’s Architecture Manager (see SpaceStudio User’s Guide) or with the FPGA Estimation (see section FPGA Estimation) while others need to be done using the technical specification of the target FPGA board.

5.2.1. FPGA Estimation#

FPGA Estimation is a feature of SpaceStudio that helps estimate the required FPGA hardware resources for a given architecture and set of implementation tools. Both the number of available and required FPGA hardware resources depends on several factors, such as the target EDA tool and the target FPGA device.

Note

FPGA estimation is currently only supported for the Xilinx Vivado EDA.

To obtain the FPGA Estimation report:

  1. Open the Tools menu in the menu bar.

  2. Click on the FPGA Resource Estimation… option. This will open the FPGA Estimation dialog as shown below.
    _images/impl_fpga_est.png

    Figure 5.1 FPGA Estimation dialog.#

  3. Select the EDA tool. If your preferred EDA tool is not shown, review the General considerations section.

  4. Select the target FPGA board.

  5. Check the hardware module and select the target HLS tool to extract FPGA resource estimation from the HLS tool.

  6. Select the number of concurrent estimations to perform (threads).

  7. Click OK.

Estimation of FPGA hardware resources will be performed according to a characterization of the hardware components within the architecture. The characterization process may take longer if this is the first time FPGA estimation is called for the current EDA and/or board target. Since this characterization process may call the target EDA tool, please pay attention to any error from the EDA tool to make sure that it is configured properly and that the architecture’s hardware components are supported by the target board.

As shown in Figure 5.2 , the results page estimates how many hardware resources are required by architecture and how many resources are available on the target board. This estimate is provided for each resource type available on the target board. Please refer to the board vendor’s documentation for more information on the different types and number of hardware resources (e.g., LUT Elements, Block RAMs, etc.) available on the target board.

Click the Details… button for a detailed resource utilization per component in the architecture. The resource utilization can also be edited manually here. Once done with the FPGA estimation results, click on the OK button to return to SpaceStudio.

_images/impl_fpga_est_res.png

Figure 5.2 Results page for the estimation of FPGA hardware resources#

5.3. Implementation#

SpaceStudio automates the whole architecture implementation flow. If required, SpaceStudio will invoke the HLS tool, integrate the result back in the generated system, cross-compile the application, generate the communication logic, launch the EDA synthesis, and use its own drivers to integrate the application with the operating system.

  1. Open the Architecture Implementation tool by going to ToolsArchitecture Implementation…. This will open the Architecture Implementation dialog as shown below.
    _images/impl_dialog.png

    Figure 5.3 Architecture Implementation export dialog.#

  2. Select the implementation directory (referred to as ${arch_impl_dir} throughout this document). Because operating systems have path length limitations and because a large subdirectory structure will be created into this directory, specify a directory that is not too far from the file system root (which is usually / for Linux and C:\ for Windows). SpaceStudio will display a warning window if the implementation directory is quite long (above 100 characters).

  3. Select the installed EDA and select the target board.

  4. Select the number of concurrent synthesis to perform (threads).

  5. If there are hardware modules in the architecture, select the installed HLS tool. Now check the checkbox for the hardware module(s) to be synthesized with the chosen HLS tool and uncheck the checkbox of those not to be synthesized. Section 5.4.2 below will explain how to provide or implement your own RTL code for the deselected modules.

  6. Click OK. If the chosen directory already exists, SpaceStudio will ask whether to delete it before running Architecture Implementation. It is recommended to let SpaceStudio delete it first.

The architecture implementation begins to render the system. This can be a long process, typically taking 10-45 minutes depending on the complexity of system, of its modules, on the number of instantiated modules and devices, etc. and the time elapse is bound to the EDA tool. The generation process is completed once the message Project Implementation [Completed successfully.] appears in the build console of SpaceStudio. Otherwise, an error message will appear. While SpaceStudio tries make error messages to be as descriptive as possible, if you need help in interpreting the error message, please contact your Space Codesign Systems representative.

5.4. Board bring-up#

5.4.1. EDA synthesis conditions#

During the Architecture Implementation workflow, SpaceStudio determines if the EDA synthesis (bitstream generation) can be executed by the EDA tool without needing user intervention. EDA synthesis (i.e., bitstream generation) is executed when the following conditions are met:

  • No user device is required for implementation (which means that all device instances have their “Only used for simulation” flag set to true ; see Figure 5.4).

  • All modules have been selected to be synthesized by the HLS tool.

_images/impl_simonly.png

Figure 5.4 “Only used for simulation” flag for device instances#

When SpaceStudio cannot automatically launch the EDA synthesis for these reasons, SpaceStudio stops after the EDA project creation to let the user add their RTL code into the design (as described in section Section 5.4.2). This also means the user needs to manually do some of the later steps that would have normally been performed automatically by SpaceStudio. A future version of SpaceStudio may dramatically automate this process.

5.4.2. User-provided module/device implementation#

Note

This feature is not supported for NanoXplore targets.

As described in Section 5.4.1 , it is possible to choose components that need to be provided an implementation during Architecture Implementation. In that case, Architecture Implementation will create an IP for those components, will connect them with the rest of the system, and will create a template VHDL file for them that will need to be manually completed. The rest of the system will be created normally, however.

To complete these components, open and complete that VHDL file. For Vivado, it is located at:

${arch_impl_dir}/application_repository/core/${component}/src/${component}.vhd

Where ${component} represents the name of the instance of a module or device to complete.

For more information on how to fill in the architecture of user components, refer to the “Implementing a hardware component” manual.

5.4.3. Spartan, Artix, Kintex and Virtex boards#

If the conditions for launching EDA synthesis described in Section 5.4.1 are met, skip to Section 5.4.3.2.

5.4.3.1. Synthesis#

  1. Open the generated Vivado project located in ${arch_impl_dir}

  2. Complete the system (VHDL), as explained in Section 5.4.2.

  3. Launch the synthesis by clicking Generate Bitstream from the left panel.

5.4.3.2. Download#

  1. Open the generated Vivado project located in ${arch_impl_dir}.

  2. From the left panel, click Open Hardware Manager, then Open Target.

  3. When the board is opened, program it by clicking Program Device

5.4.4. Zynq and Zynq UltraScale+ boards#

If the conditions for launching EDA synthesis described in Section 5.4.1 are met for the system, jump to Section 5.4.4.4.

5.4.4.1. Synthesis#

Running a full hardware/software co-designed system on a Zynq requires creating some Zynq and OS-specific files.

  1. Open the generated Vivado project located in ${arch_impl_dir}

  2. Complete the system (VHDL) as explained in Section 5.4.2.

  3. Launch the synthesis by clicking Generate Bitstream from the left panel and wait until completion

  4. Click File, then click Export, then Export Hardware…

  5. Check Include Bitstream then click OK

  6. Click File, then click Launch SDK

  7. Within SDK, to create a FSBL (First-Stage BootLoader), click FileNewApplication Project, and set FSBL as its the Project Name. Click Next.

  8. From the available templates, select Zynq FSBL, then click on Finish.

  9. Xilinx SDK will automatically build the FSBL. Wait until completion.

  10. Click on the Xilinx menu, then on Create Boot Image.

The next steps depend on whether the ARM processor is running a “bare-metal” operating system or Linux.

_images/impl_sdk_fsbl.png

Figure 5.5 Boot Image Creation Window for a Zynq Running Linux#

Note

Below, ${ss_install_dir} refers to the directory where SpaceStudio was installed (e.g. ~/SpaceCodesign/SpaceStudio-4.0.0).

5.4.4.2. Zynq running “bare-metal”#

#. In the Boot image partitions, click Add. Make sure the Partition type is set to bootloader then browse for ${arch_impl_dir}/${project}.sdk/FSBL/Debug/FSBL.elf. 2. Likewise, add the bitstream, making sure the Partition type is set to datafile this time. The bitstream is in the directory ${arch_impl_dir}/${project}.runs/impl1 and is the only file which ends with .bit (e.g. bd_wrapper.bit). 3. Likewise, add the application ELF executable, making sure the Partition type is set to datafile once again. The executable in question is in the directory ${arch_impl_dir}/processors/${processor_instance_name} and is the only file which ends with .elf (e.g., zynq_apu0.core0.arm_a9.elf). ${processor_instance_name} is the name of the ARM Cortex-A9 processor instance in the SpaceStudio architecture. 4. In the output folder, type in ${arch_impl_dir}/sd_card 5. The result should be about the same as :Figure 5.5 (except for the path). 6. Click Create Image to create the boot image (.bin file)

5.4.4.3. Zynq running Linux#

  1. In the Boot image partitions, click Add. Make sure the Partition type is set to bootloader then browse for ${arch_impl_dir}/${project}.sdk/FSBL/Debug/FSBL.elf.

  2. Likewise, add the bitstream, making sure the Partition type is set to datafile this time. The bitstream is in the directory ${arch_impl_dir}/${project}.runs/impl1 and is the only file which ends with .bit (e.g. bd_wrapper.bit).

  3. Likewise, add the SSBL (Second Stage Boot Loader), making sure the Partition type is set to datafile once again. The SSBL is ${ss_install_dir}/SpaceStudio/sw/OS/linux/boards/${relevant_board}/u-boot.elf. SpaceStudio uses U-Boot as the SSBL. Here, ${relevant_board} is the name directory name relevant to the target board (e.g., zed for a Zedboard, or zcu102 for a Zynq Ultrascale board with a ZCU102 device).

  4. In the output path, specify ${arch_impl_dir}/sd_card

  5. In the Output BIF file path, specify any valid location (for example ${arch_impl_dir}/${project}.sdk/boot.bif)

  6. Click Create Image to create the boot image (BOOT.bin file) in the sd_card directory.

5.4.4.4. Download#

5.4.4.4.1. Zynq running “bare-metal”#
  1. Copy the files from ${arch_impl_dir}/sd_card into an SD card.

  2. Insert the SD card into the board.

  3. Make sure the board is setup to boot from the SD card. This may for example involve placing jumpers in the proper position.

  4. Power on the board.

5.4.4.4.2. Zynq running Linux#
  1. Copy the files from ${arch_impl_dir}/sd_card into an SD card.

  2. Insert the SD card into the board.

  3. Make sure the board is setup to boot from the SD card. This may for example involve placing jumpers in the proper position.

  4. Connect a computer running a terminal emulator to the board’s UART port with an appropriate cable. Configure the terminal like so:
    • Baud rate: 115200

    • No parity

    • 1 stop bit

    • 8 data bits

  5. Power on the board.

  6. Connect the terminal to the appropriate serial port.

  7. The terminal should start to display messages from the boot process within a few seconds. When the boot process is completed, the SpaceStudio application starts running.