Unrecognized opcode in creating custom RISC-V instruction - riscv

I've downloaded the rocket-chip repo and the corresponding rocket-tools repo. Everything works just fine when I initially build everything.
I've created my own tightly coupled accelerator for the AES algorithm and want to test it using the custom-0 and custom-1 instructions. I've followed the instructions in the riscv-isa-sim repo (https://github.com/riscv/riscv-isa-sim) to simulate a new instruction and successfully rebuilt rocket-tools.
I want to make a really simple assembly test in rocket-tools/riscv-tests/isa/rv64ui/ to test my new instructions but when I run make in the isa folder, I get the Error: unrecognized opcode for all my instructions:
rv32ui/../rv64ui/aes.S: Assembler messages:
rv32ui/../rv64ui/aes.S:20: Error: unrecognized opcode `wkeyl x14,x1,x2'
rv32ui/../rv64ui/aes.S:21: Error: unrecognized opcode `wkeyh x14,x1,x2'
rv32ui/../rv64ui/aes.S:22: Error: unrecognized opcode `wstatel x14,x1,x2'
rv32ui/../rv64ui/aes.S:23: Error: unrecognized opcode `wstateh x14,x1,x2'
Makefile:74: recipe for target 'rv32ui-p-aes' failed
make: *** [rv32ui-p-aes] Error 1
make: *** Waiting for unfinished jobs....
What is the correct way to implement custom instructions in RISC-V? I tried to follow this tutorial but get a segmentation fault when I run spike: https://nitish2112.github.io/post/adding-instruction-riscv/

Related

UnrealBuildTool: ld.lld: error: unable to find library

OS:
Manjaro Linux 4.19.28-1-MANJARO
I have some problem about ld in UnrealBuildTool. and I'm everything new about all Unreal Stuff.
A week ago, I was found some Unreal-based Opensource project. released binary version is working perfectly. But it cannot build on my PC. I think It was gcc linker cannot find assimp library.
So I setup environment variable 'LIBRARY_PATH' and 'LD_LIBRARY_PATH' However, UnrealBuildTool seems not using my local machine's ld linker.
Anyone have idea for this?
Log
[440/442] Compile BuildSettings.cpp
[441/442] Compile pugixml.cpp
[442/442] Link (lld) CarlaEditor
/home/suho/Repository/UnrealEngine/Engine/Extras/ThirdPartyNotUE/SDKs/HostLinux/Linux_x64/v12_clang-6.0.1-centos7/x86_64-unknown-linux-gnu/bin/ld.lld: error: unable to find library -lassimp
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: UBT ERROR: Failed to produce item: /home/suho/Workspace/carla-map-editor/Unreal/CarlaEditor/Binaries/Linux/CarlaEditor
(see /home/suho/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-CarlaEditor-Linux-Development.txt for full exception trace)
Total build time: 646.23 seconds (Local executor: 0.00 seconds)
Took 646.750887s to run mono, ExitCode=5
ERROR: UnrealBuildTool failed. See log for more details. (/home/suho/Library/Logs/Unreal Engine/LocalBuildLogs/UBT-CarlaEditor-Linux-Development.txt)
(see /home/suho/Library/Logs/Unreal Engine/LocalBuildLogs/Log.txt for full exception trace)
AutomationTool exiting with ExitCode=5 (5)
RunUAT ERROR: AutomationTool was unable to run successfully.
make: *** [Util/BuildTools/Linux.mk:13: package] Error 5
full of log are here: https://pastebin.com/HmLphXTe

Compile error for custom0 custom instruction

I'm trying to design simple accelerator to be familiar with RoCC and its interface in spike, and access it through RoCC command(such as custom0, custom1, ...)
In fact, I follow some guides described in cs250 lab4 from Berkeley by using master branch of riscv tools.(Actually, guides are different from this, but I could understand basic ideas, so I go through it.)
However, it seems that it does not work well.
First of all, I just build riscv tools in repository, and then I tried to compile dummy_rocc_test.c which resides in riscv-isa-sim/dumy_rocc
but it produces following outputs when using command:
riscv64-unknown-elf-gcc -o d ./dummy_rocc_test.c
./dummy_rocc_test.c: Assembler messages:
./dummy_rocc_test.c:13: Error: unrecognized opcode `custom0 x0,a5,2,0'
./dummy_rocc_test.c:15: Error: unrecognized opcode `custom0 a5,x0,2,1'
./dummy_rocc_test.c:18: Error: unrecognized opcode `custom0 x0,a5,2,3'
./dummy_rocc_test.c:20: Error: unrecognized opcode `custom0 a5,x0,2,1'
./dummy_rocc_test.c:23: Error: unrecognized opcode `custom0 x0,a5,2,2'
./dummy_rocc_test.c:24: Error: unrecognized opcode `custom0 x0,a5,2,3'
./dummy_rocc_test.c:25: Error: unrecognized opcode `custom0 a5,x0,2,1'
Did I miss something before compiling this? or Should I have to modify some build option even though I want to use dummy extension?
By default recognition of custom0/custom1 is off.
Try to use -march option with custom suffix:
riscv64-unknown-elf-gcc -march=rv64imafdxcustom -o d ./dummy_rocc_test.c
Note: old toolchain use upper case ISA extensions symbols, i.e:
-march=RV64IMAFDXcustom

make oldconfig error 1

I built my kernel using fedpkg local (which took 6 hours and I hope I don't have to repeat the process)
Now when I try to use the command "make oldconfig" it returns with the following error
Makefile: 10: recipe for target 'oldconfig' failed
make: *** [oldconfig] Error 1
Can somebody tell me what this means and how to resolve it?

Can't compile QT 5.5.1 on Amazon Centos: Project ERROR: Unknown module(s) in QT: quick

I am trying to compile QT 5.5.1 on Amazon AMI 2015.09, which looks la lot like Centos 6.5.
I keep getting this error:
Project ERROR: Unknown module(s) in QT: quick
However, there is no quick module that I can find, and no obvious way to enable to disable it from looking at the ./configure script.
My procedure:
I downloaded qt-everywhere-opensource-src-5.5.1.tar.gz
I unpacked it.
I ran ./configure
Confirmed that I want the opensource license and agreed to the LGPL.
Ran gmake -j4 (but I get the same behavior with gmake.
Interestingly, make distclean gives me this error:
Project ERROR: Unknown module(s) in QT: quick-private
Here are all of the errors sent to STDERR:
Checking for openal... Checking for bluez... no
Checking for bluez_le... no
Checking for btapi10_2_1... no
/home/ec2-user/qt-everywhere-opensource-src-5.5.1/qtmultimedia/qtmultimedia.pro:28: Variable GST_VERSION is not defined.
Checking for resourcepolicy... no
Checking for gpu_vivante... no
Checking for libbb2... no
no
Project MESSAGE: Unsupported Bluetooth platform, will not build a working QtBluetooth library.
Project MESSAGE: Either no Qt D-Bus found or no BlueZ headers.
qbluetoothdevicediscoveryagent_p.h:0: Note: No relevant classes found. No output generated.
qbluetoothservicediscoveryagent_p.h:0: Note: No relevant classes found. No output generated.
qbluetoothserver_p.h:0: Note: No relevant classes found. No output generated.
qbluetoothlocaldevice_p.h:0: Note: No relevant classes found. No output generated.
Checking for assimp... no
Project ERROR: Unknown module(s) in QT: quick
gmake[4]: *** [sub-textureandlight-make_first] Error 3
gmake[3]: *** [sub-canvas3d-make_first] Error 2
gmake[2]: *** [sub-canvas3d-make_first] Error 2
gmake[1]: *** [sub-examples-make_first] Error 2
gmake: *** [module-qtcanvas3d-make_first] Error 2
gmake: *** Waiting for unfinished jobs....
At another poster's suggestion I tried ./configure -skip qtquick but that didn't work:
$ ./configure -skip qtquick
+ cd qtbase
+ /home/ec2-user/qt-everywhere-opensource-src-5.5.1/qtbase/configure -top-level -skip qtquick
Attempting to skip non-existent module qtquick.
$
this is what I think will solve your problems:
You have use `make confclean' instead of making distclean for deleting the previous configuration.
Configure in verbose mode — more information will be provided, sorry, I don't remember exact flag, if I'm not mistaken, it's -v.
If you don't need quick, add -skip qtquick to the configure.

using mupdf ndk-build error

I am trying to use mupdf in android application.I am using windows 7 and cygwin terminal.I used make but it gave error and
make NOX11=yes
execute successfully.
then i used ndk-build and it gives this error.
SharedLibrary : libmupdf.so
c:/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libmupdfcore.a(pdf_fontfile.o)(.text.pdf_lookup_builtin_font+0x18): unresolvable R_ARM_THM_CALL relocation against symbol `strcmp'
c:/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.6.x-google/../../../../arm-linux-androideabi/bin/ld.exe: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
/cygdrive/c/android-ndk-r8b/build/core/build-binary.mk:378: recipe for target `obj/local/armeabi/libmupdf.so' failed
make: *** [obj/local/armeabi/libmupdf.so] Error 1
please help me.I am new to android ndk.
Thank you.
This seems like a known issue. Try adding the line:
NDK_TOOLCHAIN_VERSION=4.4.3
to the file ..\android\jin\Application.mk. That will at least get rid of this particular error.
EDIT: Look here http://code.google.com/p/android/issues/detail?id=35393 for more information
UPDATE:
mupdf world is a murky one. Even the version of NDK vis-a-vis the version of mupdf (http://mupdf.com/download/archive/) you use will determine what sort of errors or warnings you get. From my experience, mupdf-0.9 (+mupdf-thirdparty-2011-02-24.zip) behaves well with android-ndk-r6b, while mupdf-1.1 (+mupdf-thirdparty-2012-08-14.zip) will behave just fine with android-ndk-r8b.

Resources