Project setup: A UVM example
Edaphic Studio can parse through and analyze UVM. Supporting UVM is an early access feature and is still under development and as such has some limitations.
The main current limitation is that UVM needs to be imported as a module, which in IntelliJ jargon means having write-access to the UVM source directory. In practical terms, this means you will need to create a copy of the UVM source somewhere. This limitation will be removed in the future.
As a tool IntelliJ divides sources into modules and libraries. Modules contain the code you currently developing, while libraries link to external things you are dependent upon but will not be editing. UVM, Xilinx libraries, and many other itemss should be libraries but supporting SystemVerilog source code libraries requires work and the current focus is on finishing base editing features first.
So, for now, please follow the steps below especially step 5: "Adding UVM Source to Project" when setting up a UVM project
UVM project overview
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.