Skip to content

Commit c71307e

Browse files
committed
Refactored code to reduce lines and remove redundant code
1 parent 83384a0 commit c71307e

File tree

14 files changed

+599
-2000
lines changed

14 files changed

+599
-2000
lines changed

traces/docker_stf_trace_gen/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ RUN git clone https://github.com/riscv-software-src/riscv-tests.git && \
8181
git clone -b spike-as-board https://github.com/widlarizer/embench-iot.git
8282

8383
# Copy and execute toolchain setup script
84-
COPY get-tool.sh $RISCV/get-tool.sh
84+
COPY utils/get-tool.sh $RISCV/get-tool.sh
8585
RUN chmod +x $RISCV/get-tool.sh && \
8686
$RISCV/get-tool.sh && \
8787
echo "Toolchain version:" && \

traces/docker_stf_trace_gen/build_and_run.sh

Lines changed: 0 additions & 13 deletions
This file was deleted.

traces/docker_stf_trace_gen/build_docker.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

traces/docker_stf_trace_gen/build_workload.py

Lines changed: 101 additions & 283 deletions
Large diffs are not rendered by default.

traces/docker_stf_trace_gen/config.py

Lines changed: 0 additions & 184 deletions
This file was deleted.

traces/docker_stf_trace_gen/doc/adding-workloads.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ DEFAULT_WORKLOADS = {
2222
}
2323

2424
# 2. Add build logic for your workload type
25+
# no the build logic is done in the yaml fil need to udpat ehat
2526
elif workload_type == "my-benchmark":
2627
# Your build logic here
2728
benchmarks = get_my_benchmark_list()
@@ -213,7 +214,7 @@ def build_my_benchmark(bench_name, workload_path, cc, base_cflags, platform, boa
213214
# Compile
214215
obj_file = f"/workloads/bin/{board}/{bench_name}.o"
215216
compile_cmd = [cc, "-c"] + cflags + ["-o", obj_file, str(bench_file)]
216-
run_cmd(compile_cmd, f"Failed to compile {bench_name}")
217+
run_cmd(compile_cmd)
217218

218219
# Link
219220
exe_path = f"/workloads/bin/{board}/{bench_name}"
@@ -225,7 +226,7 @@ def build_my_benchmark(bench_name, workload_path, cc, base_cflags, platform, boa
225226
else:
226227
link_cmd = [cc] + base_cflags.split() + ["-o", exe_path, obj_file] + ["-lm"]
227228

228-
run_cmd(link_cmd, f"Failed to link {bench_name}")
229+
run_cmd(link_cmd)
229230
return exe_path
230231
```
231232

@@ -446,11 +447,11 @@ def build_my_benchmark(bench_name, workload_path, cc, base_cflags, platform, boa
446447
# Use g++ for C++ files
447448
compiler = cc.replace("gcc", "g++") if source_file.suffix == ".cpp" else cc
448449
compile_cmd = [compiler, "-c"] + cflags + ["-o", obj_file, str(source_file)]
449-
run_cmd(compile_cmd, f"Failed to compile {source_file}")
450+
run_cmd(compile_cmd)
450451

451452
# Link all objects
452453
link_cmd = [cc] + base_cflags.split() + ["-o", exe_path] + obj_files + env_objs + ["-lc", "-lm"]
453-
run_cmd(link_cmd, f"Failed to link {bench_name}")
454+
run_cmd(link_cmd)
454455
```
455456

456457
## Example: Adding CoreMark

0 commit comments

Comments
 (0)