Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,18 @@ build --host_per_file_copt=external/.*@-w

# Settings for --config=asan address sanitizer build
build:asan --strip=never
build:asan --copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER
build:asan --copt -O1
build:asan --copt -g
build:asan --copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address
build:asan --copt -fsanitize=address --host_copt -fsanitize=address
build:asan --copt -DADDRESS_SANITIZER --host_copt -DADDRESS_SANITIZER
build:asan --copt -O1 --host_copt -O1
build:asan --copt -g --host_copt -g
build:asan --copt -fno-omit-frame-pointer --host_copt -fno-omit-frame-pointer
build:asan --linkopt -fsanitize=address --host_linkopt -fsanitize=address

# Flags with enough debug symbols to get useful outputs with Linux `perf`
build:profile --strip=never
build:profile --copt -g
build:profile --copt -gmlt
build:profile --copt -fno-omit-frame-pointer
build:profile --copt -g --host_copt -g
build:profile --copt -gmlt --host_copt -gmlt
build:profile --copt -fno-omit-frame-pointer --host_copt -fno-omit-frame-pointer

# TODO: document
build --incompatible_strict_action_env
Expand Down
17 changes: 16 additions & 1 deletion docs/user/Bazel.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,27 @@ To list all tests:

Run specific test:

baselisk test //src/upf/test:levelshifter-tcl
baselisk test --test_output=errors //src/upf/test:levelshifter-tcl

To run or list tests below a folder:

bazelisk test src/gpl/...

## Run tests with [address sanetizers](https://github.com/google/sanitizers/wiki/addresssanitizer):

bazelisk test --config=asan src/...

Example output:

```
[deleted]
Direct leak of 18191 byte(s) in 2525 object(s) allocated from:
#0 0x5f8556654e04 (/home/oyvind/.cache/bazel/_bazel_oyvind/896cc02f64446168f604c13ad7b60f8b/execroot/_main/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/org_swig/swig+0x37de04) (BuildId: f982b51b51338154ba961612c62b330f)
[deleted]
SUMMARY: AddressSanitizer: 27236 byte(s) leaked in 3801 allocation(s).
[deleted]
```

## Testing an OpenROAD build with ORFS from within the OpenROAD folder

OPENROAD_EXE=$(pwd)/bazel-out/k8-opt-exec-ST-d57f47055a04/bin/openroad make --dir ~/OpenROAD-flow-scripts/flow/ DESIGN_CONFIG=designs/asap7/gcd/config.mk clean_floorplan floorplan
Expand Down