Skip to content

Commit

Permalink
ADD: add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
T-K-233 committed Sep 15, 2024
1 parent 5901794 commit 9c88cd5
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Chipyard Tests

To build the tests, we do the following procedure.

## Clean the previous build

First, we clean the previous build. This step is recommended when any changes are made to the CMake build flow. This is equivalent to running `make clean` to the CMake build system.

```bash
cd $chipyard/tests/
rm -rf ./build/
```


## Configure the CMake build system

Then, we configure the cmake to build with the following settings. This step only needs to be done once when the build directory is not created.

```bash
cmake -S ./ -B ./build/ -D CMAKE_BUILD_TYPE=Debug
```

`-S` specifies the source directory, which is the current directory.

`-B` specifies the build directory, which is `./build/`.

`-D CMAKE_BUILD_TYPE=Debug` specifies the build type, which is debug.


## Build the tests

Then, we build the tests with the following command.

By default, the target is `all`, which builds all the tests.

```bash
cmake --build ./build/ --target all
```

If only specific tests are needed, we can specify the tests by adding the test name after `--target`.

For example, to build the `hello` test, we can run the following command.

```bash
cmake --build ./build/ --target hello
```


## Generating disassembly of the tests

To dump the disassembly of the tests, we can run the following command.

```bash
cmake --build ./build/ --target dump
```

To dump the disassembly of the `hello` test, we can run the following command.

```bash
cmake --build ./build/ --target hello_dump
```

## Clean the previous build

To clean the previous build, we can run the following command.

```bash
cmake --build ./build/ --target clean
```

0 comments on commit 9c88cd5

Please sign in to comment.