Skip to content

Commit

Permalink
Try reducing memory used by bazel.
Browse files Browse the repository at this point in the history
According to
https://bazel.build/reference/be/common-definitions#common-attributes-tests
bazel assume that a test will only use `20mb` of memory.

Might fix;
```
Step hdl#1: Server terminated abruptly (error code: 14, error message: 'Socket closed', log file: '/builder/home/.cache/bazel/_bazel_root/eab0d61a99b6696edb3d2aff87b585e8/server/jvm.out')
```

Signed-off-by: Tim Ansell <[email protected]>
  • Loading branch information
mithro committed Dec 21, 2023
1 parent b8b2a5d commit 155a621
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ build:ciremotebuild --remote_download_outputs=all
build:ciremotebuild --tls_client_certificate=/root/.ssh/buildbuddy-cert.pem
build:ciremotebuild --tls_client_key=/root/.ssh/buildbuddy-key.pem
build:ciremotebuild --build_metadata=VISIBILITY=PUBLIC
build:ciremotebuild --local_ram_resources=HOST_RAM*.5

test:ciremotebuild --crosstool_top=@llvm_toolchain//:toolchain
test:ciremotebuild --bes_backend=grpcs://cloud.buildbuddy.io
Expand All @@ -35,3 +36,4 @@ test:ciremotebuild --tls_client_certificate=/root/.ssh/buildbuddy-cert.pem
test:ciremotebuild --tls_client_key=/root/.ssh/buildbuddy-key.pem
test:ciremotebuild --build_metadata=VISIBILITY=PUBLIC
test:ciremotebuild --remote_timeout=3600
test:ciremotebuild --local_ram_resources=HOST_RAM*.5
15 changes: 15 additions & 0 deletions flows/basic_asic.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ def basic_asic_flow(name, target, cells, top = None, extra_args = {}, gds = True
top = name
extra_args = dict(**extra_args)

build_test_common = dict(
# According to
# https://bazel.build/reference/be/common-definitions#common-attributes-tests
# - setting size to "enormous" means that bazel will assume the task
# takes 800mb of memory.
size="enormous",
# But setting size="enormous" causes timeout to become "external" (IE
# 60 minutes), so we force it back to 15m.
timeout="long",
)

# Synthesis
synthesize_rtl(
name = name + "-step1-synth",
Expand All @@ -62,6 +73,7 @@ def basic_asic_flow(name, target, cells, top = None, extra_args = {}, gds = True
build_test(
name = "build-" + name + "-step1-synth",
targets = [":" + name + "-step1-synth"],
**build_test_common,
)

# Static timing analysis of synthesis result
Expand All @@ -79,6 +91,7 @@ def basic_asic_flow(name, target, cells, top = None, extra_args = {}, gds = True
build_test(
name = "build-" + name + "-step1-synth_sta",
targets = [":" + name + "-step1-synth_sta"],
**build_test_common,
)

# Place and Route
Expand All @@ -101,6 +114,7 @@ def basic_asic_flow(name, target, cells, top = None, extra_args = {}, gds = True
targets = [
":" + name + "-step2-place_and_route",
],
**build_test_common,
)

# FIXME: Should add a post place and route run_opensta?
Expand All @@ -123,6 +137,7 @@ def basic_asic_flow(name, target, cells, top = None, extra_args = {}, gds = True
targets = [
":" + name + "-step3-gds",
],
**build_test_common,
)

# Make sure everything in the extra_args dictionary has been used.
Expand Down

0 comments on commit 155a621

Please sign in to comment.