Project Setup: Truss example

This second example shows how to create a project file that excludes specific files and directories inside a top-level directory. In this project, every testbench configuration has the same file name which leads to conflicts when trying to resolve modules and classes.

Note! This example skips a few click-through steps as it assumes you are familiar with the first UVM project example that in more detail shows how to define a project and include the UVM package. This example uses Linux if you use Windows or Mac some shortcuts are different.

This example creates a project file for the quad UART configuration. The quad UART testbench is a top-level environment that combines the block UART and ALU block level configurations for chip level tests.

The projects compile script requires that specific files, like, exists for each configuration. For IntelliJ navigation to work well, we need to exclude the files that do not belong to the current configuration.

Excluding files is easy to do! Let's get started.

Get access to example code.

This project uses example code from an open-source verification library called Truss available on GitHub. In a terminal, from an appropriate directory, clone the example directory to an with the following command. In IntelliJ, you can open a terminal with [Alt][F12] or use search for any command, [Ctrl][Shift][A] and search for "terminal."

git clone edaphic_demo

Step 1



Import the main configuration directory.

1: Start IntelliJ and choose "File->New->Project from existing sources" or better use the find any command keymap, [Ctrl][Shift][A], to bring up the action search window. The search for any command pane uses fuzzy matching, so you type something like "new proj exis" to find the "Project from existing sources..." command

Use [CTRL][Shift][A] to fuzzy search for "Project from Existing Sources..."

2: From the open file manager choose to import the edaphic_demo/examples/quad_uart directory. The import wizard presents four import screen with default choices. The default choices work for this example so keep hitting the [Next] and then [Finish] buttons to get to the main screen.

3: IntelliJ presents an "Unregistered VCS root detected" pop-up. Click on the pop-up to expand it and choose "Add root" which connects the built-in graphical revision system with your project.

Step 3

Add Teal and Truss external libraries

To add external libraries, you need to modify the project structure. Open the project structure settings window by using the search for any command window, [Ctrl][Shift][A], command and fuzzy search for "project structure" or use keymap [Ctrl][Shift][Alt][S]

1: Click "Modules" and then the marked plus sign and finally choose "Import Module". 

2: The file browser open. Select the edaphic_demo/truss directory. Accept all the default import questions as in Step 2. 

3: Click the plus sign again and import the edaphic_demo/teal directory.

When complete the Modules window should include three modules like this:

Step 5

Exluding specific directories

After the import we still have the same file names and module names in a couple of locations. In this step we remove the files that are not compiled by the build script.

Open the project window [Alt][1] and expand the "quad_uart->verification->testbench" directory. There are two directories, block_uart, and top, here both containing a "" file. In this example, we are working with the quad UART example, so we want to exclude the block_uart directory.

To remove a directory from the project analysis path right-click it and choose `Mark Directory as->Excluded`. 

Right-click the "block_uart" directory and choose "Mark Directory As"->"Excluded".

You have now excluded this directory from the analysis path and removed the conflicting modules. You can exclude any directory or file by right-clicking it and marking it as excluded. Excluding files allow you to ensure each module and class is only defined once for a specific project configuration.