Skip to content

ibis-hdl/compiler

Repository files navigation

IBIS HDL project

This project aims to become a VHDL compiler.

Project structure

The project is divided into smaller sub project for maintenance. The idea is to developer parts independent and use them as library for 3rd party binaries in the future.

Some of these projects exist twice, not yet mature enough to replace the old approach (e.g. doc_ng using doxygen and sphinx), so both resist temporary here.

Required Tools to Build & Configuration

e.g., see Ubuntu 20.24 .devcontainer

  • C++20 compliant compiler; developed and tested with the big three:

  • CMake 3.28

  • ninja 1.10

  • python 3 for Conan2 and for handling dependencies

and

  • lot of memory, highly recommended more than 16GB

Required 3rd party Libraries

see conanfile.py

Build

On Windows, open Visual Studio 2022 Developer Command Prompt to get the tool chain correct initialized. On Linux mostly settings are appropriate.

The best to continue is to install Python's virtual environment (the option --system-site-packages allows usage of the site-packages from the global installation).

Note: You may prefer to name the virtual environment different on Windows (.win64-venv) and Linux (.venv) if you develop and compile on multi OS setup. Here, I'll use only .venv for sake of simplicity.
Also, always use on Windows the Python Launcher py instead python3 (on Linux).

> python3 -m venv .venv --system-site-packages
...

Note: If you run it from PowerShell, you may have to prepare the Execution Policies before, see SO virtualenv in PowerShell?:
> Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force

and activate Python's virtual environment depend on the OS using:

On Windows:

> .win64-venv\Scripts\activate

On Linux bash:

> source .venv/bin/activate

Check that you are running the right virtual environment by using pip (notice capital V here), on PowerShell you may also use (Get-Command python).path:

> pip -V
...

Install Conan as prerequisite into the previous configured virtual environment to build the project:

> pip install conan
...

Afterwards you may create a Conan profile to build project's dependencies (or even overwrite an existing one with --force). The following will create a default Conan profile:

> conan profile detect --force
...

Here are several Conan profiles used, created by e.g.

> CXX=clang++ conan profile detect --name clang --force
...

which reflects CMake's presets used here in the project.

Note: On Powershell on Windows you may use
> $env:CXX=cl conan profile detect --name msvc --force

Now, you have to install the dependencies provided by Conan. Since the parameter got more complexer over the time a Python script conan_install.py is provided:

> pip install multipledispatch
> python3 conan_install.py --profile msvc
...

Afterwards, you can disable Python's virtual environment by simply

> deactivate

Now you can start to build, i.e. on Windows:

> cmake --preset msvc
...
> cmake --build --preset msvc-release
...
> ctest.exe --preset msvc-release-test
...
> cmake --build --preset msvc-release-test --target help
...

The same procedure for Clang and GCC on Linux or macOS.

Miscellaneous

Also read