Skip to content

Commit

Permalink
examples/*.py: expose CCACHE
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippvK committed Sep 27, 2024
1 parent 4b78d95 commit 2cd3502
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 58 deletions.
13 changes: 7 additions & 6 deletions examples/corev_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
EXPORT = bool(int(os.environ.get("EXPORT", 1)))
CLEANUP = bool(int(os.environ.get("CLEANUP", 0)))
PROGRESS = bool(int(os.environ.get("PROGRESS", 1)))
CCACHE = bool(int(os.environ.get("CCACHE", 0)))
CLONE_DEPTH = bool(int(os.environ.get("CLONE_DEPTH", 1)))
DEST_DIR = os.environ.get("DEST_DIR", "/tmp")
DEST = os.environ.get("DEST", DEST_DIR + "/seal5_llvm_corev").rstrip("/")
Expand Down Expand Up @@ -118,7 +119,7 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_0])

# Build initial LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

# Transform inputs
# 1. Create M2-ISA-R metamodel
Expand All @@ -133,12 +134,12 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen", enable_ccache=CCACHE)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc", enable_ccache=CCACHE)

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])
Expand All @@ -147,15 +148,15 @@
seal5_flow.patch(verbose=VERBOSE, stages=list(range(PatchStage.PHASE_3, PatchStage.PHASE_5 + 1)))

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if TEST:
# Test patched LLVM
seal5_flow.test(verbose=VERBOSE, ignore_error=IGNORE_ERROR)

if INSTALL:
# Install final LLVM
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if DEPLOY:
# Deploy patched LLVM (export sources)
Expand Down
8 changes: 4 additions & 4 deletions examples/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,12 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen", enable_ccache=CCACHE)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc", enable_ccache=CCACHE)

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])
Expand All @@ -139,7 +139,7 @@
seal5_flow.patch(verbose=VERBOSE, stages=list(range(PatchStage.PHASE_3, PatchStage.PHASE_5 + 1)))

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if TEST:
# Test patched LLVM
Expand Down
13 changes: 7 additions & 6 deletions examples/gen_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
EXPORT = bool(int(os.environ.get("EXPORT", 1)))
CLEANUP = bool(int(os.environ.get("CLEANUP", 0)))
PROGRESS = bool(int(os.environ.get("PROGRESS", 1)))
CCACHE = bool(int(os.environ.get("CCACHE", 0)))
CLONE_DEPTH = bool(int(os.environ.get("CLONE_DEPTH", 1)))
DEST_DIR = os.environ.get("DEST_DIR", "/tmp")
DEST = os.environ.get("DEST", DEST_DIR + "/seal5_llvm_gen").rstrip("/")
Expand Down Expand Up @@ -110,7 +111,7 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_0])

# Build initial LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

# Transform inputs
# 1. Create M2-ISA-R metamodel
Expand All @@ -125,12 +126,12 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen", enable_ccache=CCACHE)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc", enable_ccache=CCACHE)

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])
Expand All @@ -139,15 +140,15 @@
seal5_flow.patch(verbose=VERBOSE, stages=list(range(PatchStage.PHASE_3, PatchStage.PHASE_5 + 1)))

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if TEST:
# Test patched LLVM
seal5_flow.test(verbose=VERBOSE, ignore_error=IGNORE_ERROR)

if INSTALL:
# Install final LLVM
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if DEPLOY:
# Deploy patched LLVM (export sources)
Expand Down
13 changes: 7 additions & 6 deletions examples/gpr32_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
EXPORT = bool(int(os.environ.get("EXPORT", 1)))
CLEANUP = bool(int(os.environ.get("CLEANUP", 0)))
PROGRESS = bool(int(os.environ.get("PROGRESS", 1)))
CCACHE = bool(int(os.environ.get("CCACHE", 0)))
CLONE_DEPTH = bool(int(os.environ.get("CLONE_DEPTH", 1)))
DEST_DIR = os.environ.get("DEST_DIR", "/tmp")
DEST = os.environ.get("DEST", DEST_DIR + "/seal5_llvm_gpr32").rstrip("/")
Expand Down Expand Up @@ -104,7 +105,7 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_0])

# Build initial LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

# Transform inputs
# 1. Create M2-ISA-R metamodel
Expand All @@ -119,12 +120,12 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen", enable_ccache=CCACHE)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc", enable_ccache=CCACHE)

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])
Expand All @@ -133,15 +134,15 @@
seal5_flow.patch(verbose=VERBOSE, stages=list(range(PatchStage.PHASE_3, PatchStage.PHASE_5 + 1)))

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if TEST:
# Test patched LLVM
seal5_flow.test(verbose=VERBOSE, ignore_error=IGNORE_ERROR)

if INSTALL:
# Install final LLVM
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if DEPLOY:
# Deploy patched LLVM (export sources)
Expand Down
13 changes: 7 additions & 6 deletions examples/openasip_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
EXPORT = bool(int(os.environ.get("EXPORT", 1)))
CLEANUP = bool(int(os.environ.get("CLEANUP", 0)))
PROGRESS = bool(int(os.environ.get("PROGRESS", 1)))
CCACHE = bool(int(os.environ.get("CCACHE", 0)))
CLONE_DEPTH = bool(int(os.environ.get("CLONE_DEPTH", 1)))
DEST_DIR = os.environ.get("DEST_DIR", "/tmp")
DEST = os.environ.get("DEST", DEST_DIR + "/seal5_llvm_openasip").rstrip("/")
Expand Down Expand Up @@ -104,7 +105,7 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_0])

# Build initial LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

# Transform inputs
# 1. Create M2-ISA-R metamodel
Expand All @@ -119,12 +120,12 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen", enable_ccache=CCACHE)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc", enable_ccache=CCACHE)

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])
Expand All @@ -133,15 +134,15 @@
seal5_flow.patch(verbose=VERBOSE, stages=list(range(PatchStage.PHASE_3, PatchStage.PHASE_5 + 1)))

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if TEST:
# Test patched LLVM
seal5_flow.test(verbose=VERBOSE, ignore_error=IGNORE_ERROR)

if INSTALL:
# Install final LLVM
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if DEPLOY:
# Deploy patched LLVM (export sources)
Expand Down
13 changes: 7 additions & 6 deletions examples/rv64_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
EXPORT = bool(int(os.environ.get("EXPORT", 1)))
CLEANUP = bool(int(os.environ.get("CLEANUP", 0)))
PROGRESS = bool(int(os.environ.get("PROGRESS", 1)))
CCACHE = bool(int(os.environ.get("CCACHE", 0)))
CLONE_DEPTH = bool(int(os.environ.get("CLONE_DEPTH", 1)))
DEST_DIR = os.environ.get("DEST_DIR", "/tmp")
DEST = os.environ.get("DEST", DEST_DIR + "/seal5_llvm_rv64").rstrip("/")
Expand Down Expand Up @@ -108,7 +109,7 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_0])

# Build initial LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

# Transform inputs
# 1. Create M2-ISA-R metamodel
Expand All @@ -123,12 +124,12 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen", enable_ccache=CCACHE)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc", enable_ccache=CCACHE)

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])
Expand All @@ -137,15 +138,15 @@
seal5_flow.patch(verbose=VERBOSE, stages=list(range(PatchStage.PHASE_3, PatchStage.PHASE_5 + 1)))

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if TEST:
# Test patched LLVM
seal5_flow.test(verbose=VERBOSE, ignore_error=IGNORE_ERROR)

if INSTALL:
# Install final LLVM
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if DEPLOY:
# Deploy patched LLVM (export sources)
Expand Down
13 changes: 7 additions & 6 deletions examples/rvc_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
EXPORT = bool(int(os.environ.get("EXPORT", 1)))
CLEANUP = bool(int(os.environ.get("CLEANUP", 0)))
PROGRESS = bool(int(os.environ.get("PROGRESS", 1)))
CCACHE = bool(int(os.environ.get("CCACHE", 0)))
CLONE_DEPTH = bool(int(os.environ.get("CLONE_DEPTH", 1)))
DEST_DIR = os.environ.get("DEST_DIR", "/tmp")
DEST = os.environ.get("DEST", DEST_DIR + "/seal5_llvm_rvc").rstrip("/")
Expand Down Expand Up @@ -110,7 +111,7 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_0])

# Build initial LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

# Transform inputs
# 1. Create M2-ISA-R metamodel
Expand All @@ -125,12 +126,12 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen", enable_ccache=CCACHE)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc", enable_ccache=CCACHE)

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])
Expand All @@ -139,11 +140,11 @@
seal5_flow.patch(verbose=VERBOSE, stages=list(range(PatchStage.PHASE_3, PatchStage.PHASE_5 + 1)))

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if INSTALL:
# Install final LLVM
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if DEPLOY:
# Deploy patched LLVM (export sources)
Expand Down
13 changes: 7 additions & 6 deletions examples/rvp_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
EXPORT = bool(int(os.environ.get("EXPORT", 1)))
CLEANUP = bool(int(os.environ.get("CLEANUP", 0)))
PROGRESS = bool(int(os.environ.get("PROGRESS", 1)))
CCACHE = bool(int(os.environ.get("CCACHE", 0)))
CLONE_DEPTH = bool(int(os.environ.get("CLONE_DEPTH", 1)))
DEST_DIR = os.environ.get("DEST_DIR", "/tmp")
DEST = os.environ.get("DEST", DEST_DIR + "/seal5_llvm_rvp")
Expand Down Expand Up @@ -105,7 +106,7 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_0])

# Build initial LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

# Transform inputs
# 1. Create M2-ISA-R metamodel
Expand All @@ -120,12 +121,12 @@
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc")
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="pattern-gen", enable_ccache=CCACHE)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, target="llc", enable_ccache=CCACHE)

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])
Expand All @@ -134,11 +135,11 @@
seal5_flow.patch(verbose=VERBOSE, stages=list(range(PatchStage.PHASE_3, PatchStage.PHASE_5 + 1)))

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.build(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if INSTALL:
# Install final LLVM
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG)
seal5_flow.install(verbose=VERBOSE, config=BUILD_CONFIG, enable_ccache=CCACHE)

if DEPLOY:
# Deploy patched LLVM (export sources)
Expand Down
Loading

0 comments on commit 2cd3502

Please sign in to comment.