Topwrap, Antmicro’s open source tool for ASIC and FPGA design entry, allows for creating SoCs of varying complexity by providing the user with a way to connect individual HDL modules and turn them into complete designs. Users may choose to work in the YAML-based CLI or a drag-and-drop graphical interface based on our diagramming framework, Pipeline Manager. What’s more, Topwrap allows developers to utilize design blocks which can be reused in different projects, expediting the overall digital design process.

Since its release, we’ve been steadily working on extending Topwrap with more features. We’ve improved the handling of complex SystemVerilog designs, and, quite recently, we optimized its component-based YAML file syntax, as well as introduced numerous smaller changes and updates, which you can see in Topwrap’s changelog.

To provide a more convenient way for users to utilize reusable digital design components, Topwrap has received library support in its latest 0.8.0 release, giving an easy option to retrieve packages from either local or git repositories. Additionally, work is underway on a plugin system, which is already implemented in its initial form. This note describes library support and the plugin system, as well as other additions and improvements recently made to Topwrap such as the introduced support of IP-XACT files, improving user experience, and other small enhancements.

Topwrap's library support and initial plugin system

Sharing components across projects with Topwrap’s libraries

Topwrap’s new library support makes it easier to turn existing RTL into reusable components and share them across projects and teams. Custom IP can be packaged once, and then distributed through local directories or Git repositories, reducing setup work when bringing proven components into new designs. These libraries can be used alongside the cores and interface definitions provided with Topwrap, helping teams build on existing work and simplify SoC integration.

Packaging an existing RTL module takes a single command. For a peripheral defined in widget.sv, the following command creates a core package, and then registers the current directory as a library:

topwrap package widget.sv \
  --vlnv example.com:peripherals:widget:1.0 --lib

topwrap library add project_cores .

The peripheral can then be instantiated in a design using the peripheral’s name:

ips:
  peripheral:
    core: widget  # Add more VLNV fields if ambiguous: example.com:peripherals:widget:1.0

Once the library is published in a Git repository, other users can register it, optionally selecting a specific revision:

topwrap library add shared_cores \
  https://github.com/example/cores.git@v1.2.0

Under the hood, libraries use FuseSoC’s standard package format to describe their contents. Topwrap generates the package metadata alongside the IP description, then uses it to discover available cores and resolve references when loading a design. Packaging with topwrap package also supports filelists and includes directories and preprocessor defines, making it easier to incorporate existing RTL projects into the library workflow.

Topwrap library flow

Once a library is populated with IP cores, it can be used in projects locally or in shared repositories such as Antmicro’s topwrap-cores. The core descriptions are self-contained and the further design steps can utilize the FuseSoC infrastructure to get cores retrieved automatically.

To learn more about it, you can read the dedicated libraries chapter of the Topwrap documentation.

Another significant addition to Topwrap introduced together with the new library mechanism is the support for IP-XACT (IEEE 1685-2022). IP-XACT is a standard for design IP descriptions, used by various Electronic Design Automation (EDA) tools. The added support makes transferring design architectures into these tools possible, allowing developers to move quickly and effortlessly between various applications and exchange design components between teams and projects. With this addition, Topwrap can integrate into flows that utilize commercial EDAs or other design tools.

Developing a plugin system to integrate into larger toolchains

We are also actively developing new features, which we will discuss in more detail in future posts. Among those is a plugin system, which has already been implemented in an initial form. Its goal is to let external tools customize and extend Topwrap without modifying its codebase - for example, to add new output formats, apply custom transformations or checks to a design, or integrate Topwrap into larger toolchains.

To make the implemented changes possible, all of Topwrap’s flows now run through a common build pipeline - from parsing the inputs, through transformations and validations, to generating outputs. Plugins can hook into each of these stages, gaining access to the full internal representation of the design, so they can inspect it, modify it, or produce additional output files. Plugins are regular Python packages that Topwrap discovers automatically once installed, and they can be configured per design or IP core through a new extensions section in the description files.

While the plugin API is still experimental and may change between releases, it is already operational: we’ve developed a Renode plugin, which generates Renode platform description files directly from Topwrap designs, as well as a plugin for Omnibus, our recently released tool for generating interconnects.

Additional improvements and future plans

Alongside the presented features, the 0.8.0 release introduced a number of other improvements, aiming to better Topwrap’s user experience.

We’ve added several features to improve readability and provide convenient features to Topwrap’s Pipeline Manager-rendered GUI. Topwrap now has an option to save designs directly from its GUI, including complete hierarchical designs. When a design is saved, Topwrap keeps the positions of modules, externals, constants, and interconnects, maintaining them when the diagram is reopened. You can also choose which diagram layers are initially visible, including clock and reset domains, and automatically expose hierarchy interfaces, which have a clearer validation of incorrect exposure. We also made efforts to improve the overall readability of various elements: YAML and JSON output files have clearer formatting, error messages have been improved, and logs are colored to make the user experience easier.

Guineveer before hiding clock/reset ports

Pictured above is the Guineveer SoC in Topwrap, before hiding clock/and reset ports; you can see it after hiding the ports below.

Guineveer after hiding clock/reset ports

You can now use multidimensional ports in design and core descriptions, provide HDL filelists, and include directories in core descriptions. We also introduced the ability to check connections throughout nested designs, improving the handling of bidirectional interfaces. What’s more, you can now connect interconnects to external interfaces, and generate them inside nested designs instead of needing to create them manually. Additionally, you can export selected subdiagrams of a design as reusable modules or hierarchies, easily incorporating them into other designs.

Efficient FPGA and ASIC design with Antmicro’s open source tools

Topwrap provides users with an easy, efficient, and effective way of managing complex designs, aggregating the process of component design thanks to its modularity, configurability, and reusability of component blocks. As we approach the 1.0.0 release, Topwrap will only continue gaining new features and functionalities like the new libraries or extended IP-XACT support, further accelerating developer productivity. All of Topwrap’s features, including the new ones described in this article, can be used alongside Guineveer, the configurable VeeR EL2 RISC-V SoC reference design, both to experiment or design custom SoCs.

Antmicro is frequently involved in projects aiming to icrease developer productivity with our open source tools, which are easily customizable for different use cases. You can visualize and manage dataflows for various applications with Pipeline Manager, simulate designs in Renode, and so much more. To see the full scope of our services around ASIC and FPGA design, visit our dedicated subpage. And if you’d like to find out more about the tools we create and how they could be customized for your workflow, or you’re in need of a completely new tool, reach out to us at contact@antmicro.com