blob: 359dabc405eae5fad3ccd97f06e720f7e9b1f717 [file] [log] [blame] [view]
Miguel Young de la Sotad258b332019-10-29 14:05:23 -05001# OpenTitan Software
2
3This subtree contains all software intended to run on the OpenTitan chip, as well as some tools.
4
5## Building
6
Tobias Wölfel03d1cf32020-02-26 12:47:07 +01007OpenTitan software is built using [Meson](https://mesonbuild.com), although OpenTitan's project structure is sufficiently idiosyncratic that we use a custom workflow.
Miguel Young de la Sota8ff30b82019-11-25 12:58:34 -06008
9For example, to build the OpenTitan executable located at `sw/device/examples/hello_world` for FPGA, run the following commands:
10```console
11$ cd "$REPO_TOP"
12$ ./meson_init.sh
Miguel Young de la Sota76526c32020-01-28 10:24:41 -050013$ ninja -C build-out sw/device/examples/hello_world/hello_world_export_fpga_nexysvideo
Miguel Young de la Sotad258b332019-10-29 14:05:23 -050014```
Miguel Young de la Sota8ff30b82019-11-25 12:58:34 -060015
Miguel Young de la Sota76526c32020-01-28 10:24:41 -050016The resulting binaries will be located at `build-bin/sw/device/examples/hello_world`. For more information, check out [the relevant User Guide](../doc/ug/getting_started_sw.md).
Miguel Young de la Sota8ff30b82019-11-25 12:58:34 -060017
Greg Chadwickc96ccaf2020-02-04 13:37:37 +000018The location of the RISC-V toolchain is /tools/riscv by default.
19If your toolchain is located elsewhere set the `TOOLCHAIN_PATH` to that path before running `meson_init.sh`
20
21```console
22$ cd "$REPO_TOP"
23$ export TOOLCHAIN_PATH=/path/to/toolchain
24$ ./meson_init.sh
25```