Simple RISC-V Assembly Instructions Verification
#1
Hello,

I am new to RISC-V and PULPissimo. So far, using the following Makefile, I have been able to generate C based test cases for verifying general C commands:

PULP_APP = test
PULP_APP_FC_SRCS = test.c
PULP_APP_HOST_SRCS = test.c

PULP_CFLAGS = -O3 -g
include $(PULP_SDK_HOME)/install/rules/pulp_rt.mk


When I am trying to add basic asm code as inline assembly in the C test, it provides error on those specific commands.

I added the following code in the test.c file:

asm( "mov r0, r0\n\t" 
     "mov r0, r0\n\t" 
     "mov r0, r0\n\t" 
     "mov r0, r0" );

I received the following errors:

test.c: Assembler messages:
test.c:15: Error: unrecognized opcode mov r0,r0'
test.c:16: Error: unrecognized opcodemov r0,r0'
test.c:17: Error: unrecognized opcode mov r0,r0'
test.c:18: Error: unrecognized opcodemov r0,r0'

Is there a simple way of adding inline assembly in C test cases, and verifying for example load and store instructions, or more instruction types? The compiler is able to run test.c file using the above Makefile method and I was hoping to keep that constant and work it around the inline assembly in a simple way.
Reply


Messages In This Thread
Simple RISC-V Assembly Instructions Verification - by ufsahu - 08-19-2020, 07:48 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)