Project setup: A UVM example
The easiest way to create a project is to import existing files. It might be as simple as importing a top-level project directory but can get a little more involved, depending on the project structure and if the project uses external libraries (like UVM).
In this first example, we create a project file for the UBUS UVM example from the UVM open-source code. This example shows how to create a project for a top-level directory then add an external (in this case UVM) libarary to the project.
In this example, there are no conflicting file names. If your project structure repeats the same file names in different directories, then please take a look at the Truss example for how to exclude unwanted directories and files.
In this example, we are using Linux. If you are using Windows or Mac, then some commands are slightly different.
Let's go through the steps!
Getting the source
To get started clone the UVM source code to a local directory from a terminal:
git clone https://github.com/rekendahl/uvm
Make sure to remember where the UVM root directory location as we use it when we import the project into IntelliJ
Import UBUS example
Start IntelliJ. If this is the first time you launch IntelliJ, then you see a window like the one above.
If you have used IntelliJ before it might launch directly into you last used project, if so then choose
File->New->Project from existing sources... from the menu.
In the following steps, IntelliJ asks for what files to import.
Selecting the source directory
Enabling IntelliJ's revision control
Adding UVM source to project
We have imported the UBUS example source files (i.e., our project configuration). This project uses the UVM package, so we need to add the UVM source files to the configuration. Importing this source allows Edaphic Studio to navigate and use code-completion for the UVM package correctly.
To import UVM, we need to update the UBus project structure. Importing UVM can be done several ways. From the menu choose
File->Project Structure or, preferred, type
[Ctrl][Shift][A] to find any IDE action and type "project str" in the search bar. Then select "Project Structure" as in the following image.
Note! The default keymap
[Ctrl][Alt][Shift][S] is shown in the window and you can use that key combination as well.
The project structure window opens.
- Click on
Moduleson the left-hand side
- Click on the highlighted plus sign
Import Module from the pop-up window which opens a file browser. Select to import the
/uvm/src directory. IntelliJ goes through the same import process as in Step 3 above. Just leave everything default and click next until you are back at the main project structure window which looks like:
The project setup is complete. Click OK to go back to the project and start coding and navigating.