DVT Eclipse IDE Code Factory

Description

This video explains how to use the DVT Code Factory to generate code starting from a module or entity. For example you can create instances, list all of its ports as signals or even create a small testbench stub.

Explore the design and verification tools: https://www.dvteclipse.com
Or request a license: https://www.dvteclipse.com/request-license

Transcript

Overview

The Code Factory allows you to easily generate code starting from a module or entity. For example, you can:

  • create a module instance
  • list all of its ports as signals
  • create a small test bench stub

Setting the Factory Input

The Code Factory works with one module or entity as input. To set it, right-click on its name and go to Code Factory > Set Factory Input. Information and error messages are shown in the status bar. The current input persists until a new one is set, or until a full build is invoked.

Instantiating a Module

To instantiate the module, right-click in the file where you want to create a new instance, and choose Code Factory > Create Instance.

Creating Signals

Let's suppose you also want to declare the signals needed to connect this instance elsewhere in the file. Right-click, choose Code Factory > Create Signals.

Creating a TestBench Stub

To create an entire TestBench stub, choose Code Factory > Create TestBench. This will instantiate the module inside a TB wrapper, declare all signals required to connect the new instance, reset them and also insert a simple clock generator.

Customizing Output with FreeMarker Templates

You can entirely customize the output of the Code Factory by using FreeMarker templates. For example, you can iterate through all the ports and parameters of the factory's input module, use their name, direction, or type, and choose exactly how to print them.

To use a template, right-click in the editor where you want to generate code, and go to Code Factory > Create from Template. Note that most recently used templates are directly available in the context menu.