Skip to content

Commit

Permalink
[toolchain] Optimize for speed rather than size (#8)
Browse files Browse the repository at this point in the history
None of our development setups have any size constraints on code as
they're currently all in DRAM.

A faster executable greatly reduces time spent in simulation however,
making this a worthwhile optimization for development.

This reduced verilator runtime by almost 3x on my local machine.
  • Loading branch information
zero9178 authored May 18, 2024
1 parent 3d0d047 commit 3d47e73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.21)

project(QuidditchRuntime LANGUAGES C ASM)

set(CMAKE_C_STANDARD 11)

set(IREE_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../iree" CACHE STRING "IREE source code path")
set(SNITCH_CLUSTER_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../snitch_cluster" CACHE STRING "snitch_cluster source code path")
set(QUIDDITCH_CODEGEN_BUILD_DIR "" CACHE STRING "CMake generation directory with a compiled 'iree-compile'")
Expand All @@ -14,6 +16,7 @@ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions> $<$<COMPILE_LANGU

# Configuration for our target that must be present in all code using IREE.
add_definitions(-DIREE_PLATFORM_GENERIC)
add_definitions(-D_ISOC11_SOURCE)
add_definitions(-DIREE_USER_CONFIG_H="${CMAKE_CURRENT_LIST_DIR}/iree-configuration/config.h")
add_subdirectory(iree-configuration)

Expand Down
2 changes: 2 additions & 0 deletions runtime/toolchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ RUN mkdir picolibc/build && cd picolibc/build && \
-Dincludedir=include \
-Dlibdir=lib \
--cross-file /cross.txt \
--buildtype=release \
-Dnewlib-nano-malloc=false \
-Dpicocrt=false \
-Dpicolib=false \
-Dposix-console=true \
Expand Down

0 comments on commit 3d47e73

Please sign in to comment.