diff --git a/Dockerfile b/Dockerfile index b9991bc..c3aebc2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM ubuntu:bionic -MAINTAINER Màrius Montón +LABEL maintainer="Màrius Montón" ENV SYSTEMC_VERSION 2.3.3 RUN apt-get update -q && apt-get install -qy gcc-riscv64-linux-gnu diff --git a/src/Instruction.cpp b/src/Instruction.cpp index c5faecc..c165288 100644 --- a/src/Instruction.cpp +++ b/src/Instruction.cpp @@ -177,9 +177,7 @@ extension_t Instruction::check_extension() { return C_EXTENSION; } else if (m_instr.range(1,0) == 0b10) { return C_EXTENSION; - } else if (m_instr.range(6,0) == 0b0101111) { - return A_EXTENSION; - } else { + } else { return UNKNOWN_EXTENSION; } } diff --git a/tests/C/func4/func4.c b/tests/C/func4/func4.c index 245a4d9..4b9b840 100644 --- a/tests/C/func4/func4.c +++ b/tests/C/func4/func4.c @@ -36,7 +36,7 @@ int main(void) { x2 = 7; x3 = func1(x1, &x2); - memcpy(aux, aux2, sizeof(int)*5); + memcpy(aux2, aux, sizeof(int)*5); for(int i = 0; i < 5; i++) { if (aux[i] != aux2[i]) { diff --git a/tests/C/func6/func6.c b/tests/C/func6/func6.c index a20b511..6d928d5 100644 --- a/tests/C/func6/func6.c +++ b/tests/C/func6/func6.c @@ -28,7 +28,7 @@ int main(void) { x2 = 7; x3 = func1(x1, &x2); - memcpy(aux, aux2, sizeof(int)*5); + memcpy(aux2, aux, sizeof(int)*5); for(int i = 0; i < 5; i++) { if (aux[i] != aux2[i]) { diff --git a/tests/C/timer/compile.sh b/tests/C/timer/compile.sh index 5a1cd5b..4104be2 100644 --- a/tests/C/timer/compile.sh +++ b/tests/C/timer/compile.sh @@ -1,3 +1,6 @@ + +#!/bin/bash + riscv32-unknown-elf-gcc -Wall -I. -O0 -static -march=rv32imac -mabi=ilp32 --specs=nosys.specs timer.c timerasm.S -o timer.elf objcopy -Oihex timer.elf timer.hex riscv32-unknown-elf-objdump timer.elf -d > dump diff --git a/tests/C/timer/timer.c b/tests/C/timer/timer.c index c4c9ab2..a9c1d80 100644 --- a/tests/C/timer/timer.c +++ b/tests/C/timer/timer.c @@ -47,14 +47,14 @@ int main(void) { start_time = TIMER; TIMER_CMP = start_time + 10000; - printf("set timer to %ld ns\n", start_time + 10000); + printf("set timer to %d ns\n", start_time + 10000); do { timer_value = TIMER; } while (timer_value < start_time + 2000000); - printf("Timer: %ld ns\n", timer_value); - printf("ticks: %ld\n", ticks); + printf("Timer: %d ns\n", timer_value); + printf("ticks: %d\n", ticks); if (ticks > 2100) { printf("Test OK!\n");