Skip to content

Commit

Permalink
Merge pull request #73 from Xeratec/fix/make
Browse files Browse the repository at this point in the history
Fix problems with GCC optimization and cMake
  • Loading branch information
SamuelRiedel authored Jan 9, 2023
2 parents 4afcf55 + a9ada7e commit 3f00262
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
- Measure the `wfi` stalls and stalls caused by `opc` properly
- Fix the allocator initialization
- After building GCC, copy `riscv.ld` required for cMake to install folder
- Disable GCC tree-loop-distribute-patterns optimizations causing stack overflows
- Disable problematic GCC `memset` and `memcpy` built-in functions

### Changed
- Increase the default AXI width to 512 for MemPool and TeraPool
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ Thanks to all.
* Luca Rufer
* Marc Gantenbein
* Marco Bertuletti
* Philip Wiese
* Sergio Mazzola
* Yichao Zhang
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ tc-riscv-gcc:
mkdir -p $(GCC_INSTALL_DIR)
cd $(CURDIR)/toolchain/riscv-gnu-toolchain && rm -rf build && mkdir -p build && cd build && \
../configure --prefix=$(GCC_INSTALL_DIR) --with-arch=rv32im --with-cmodel=medlow --enable-multilib && \
$(MAKE) MAKEINFO=true -j4
$(MAKE) MAKEINFO=true -j4 && \
cp ../riscv.ld $(GCC_INSTALL_DIR)/riscv32-unknown-elf/lib

tc-llvm:
mkdir -p $(LLVM_INSTALL_DIR)
Expand Down
4 changes: 2 additions & 2 deletions software/runtime/runtime.mk
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ RISCV_LLVM_TARGET ?= --target=$(RISCV_TARGET) --sysroot=$(GCC_INSTALL_DIR)/$(RI

RISCV_WARNINGS += -Wunused-variable -Wconversion -Wall -Wextra # -Werror
RISCV_FLAGS_COMMON_TESTS ?= -march=$(RISCV_ARCH) -mabi=$(RISCV_ABI) -I$(ROOT_DIR) -I$(HALIDE_INCLUDE) -static
RISCV_FLAGS_COMMON ?= $(RISCV_FLAGS_COMMON_TESTS) -g -std=gnu99 -O3 -ffast-math -fno-common -fno-builtin-printf $(DEFINES) $(RISCV_WARNINGS)
RISCV_FLAGS_GCC ?= -mcmodel=medany -Wa,-march=$(RISCV_ARCH_AS) -mtune=mempool # -falign-loops=32 -falign-jumps=32
RISCV_FLAGS_COMMON ?= $(RISCV_FLAGS_COMMON_TESTS) -g -std=gnu99 -O3 -fno-builtin-memcpy -fno-builtin-memset -ffast-math -fno-common -fno-builtin-printf $(DEFINES) $(RISCV_WARNINGS)
RISCV_FLAGS_GCC ?= -mcmodel=medany -Wa,-march=$(RISCV_ARCH_AS) -mtune=mempool -fno-tree-loop-distribute-patterns # -falign-loops=32 -falign-jumps=32
RISCV_FLAGS_LLVM ?= -mcmodel=small -mcpu=mempool-rv32 -mllvm -misched-topdown

ifeq ($(COMPILER),gcc)
Expand Down

0 comments on commit 3f00262

Please sign in to comment.