-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
79 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
projects/ice-v/compile/icebreaker/swirl-cache/compile_asm.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
export PATH=$PATH:$DIR/../../tools/fpga-binutils/mingw32/bin/ | ||
|
||
source ../../tools/bash/find_riscv.sh | ||
|
||
echo "using $ARCH" | ||
|
||
BASE=./compile/icebreaker/swirl-cache | ||
DST=./compile/build | ||
|
||
$ARCH-as.exe -march=rv32im -mabi=ilp32 -o $DST/code.o $1 | ||
$ARCH-ld.exe -m elf32lriscv -b elf32-littleriscv -T$BASE/config_c.ld --no-relax -o $DST/code.elf $DST/code.o | ||
$ARCH-objcopy.exe -O verilog $DST/code.elf $DST/code.hex | ||
|
||
$ARCH-objcopy.exe -O binary $DST/code.elf $DST/code.bin | ||
$ARCH-objdump.exe -D -b binary -m riscv $DST/code.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.globl _start | ||
|
||
_start: | ||
|
||
addi t1, zero, 123 | ||
addi t2, zero,-10 | ||
div t3, t1, t2 | ||
rem t3, t1, t2 | ||
divu t3, t1, t2 | ||
remu t3, t1, t2 | ||
|
||
jal _start |