Questions tagged [riscv32]
41 questions
4
votes
1 answer
s-files generated from riscv-gnu-toolchain does not run RISCV emulator
I must compile a set of C++ files into RISC-V code (RV32IM). I am using riscv-gnu-toolchain and compiles with the following CMakeLists.txt file
cmake_minimum_required(VERSION 3.10.2)
project(project-title)
set(CMAKE_CXX_FLAGS "-march=rv32im…
![](../../users/profiles/5609988.webp)
eirikvaa
- 801
- 12
- 20
4
votes
2 answers
RISCV: how the branch intstructions are calculated?
I am trying to understand how modern CPU works. I am focused on RISC-V. there are few types of branches:
BEQ
BNE
BLT
BGE
BLTU
BGEU
I use a venus simulator to test this and also i am trying to simulate it as well and so far so good it works, but i…
![](../../users/profiles/11832422.webp)
Kralik_011
- 333
- 2
- 9
2
votes
2 answers
riscv-gcc Fails to build [GCC_NO_EXECUTABLES]
I want to use riscv-gcc to implement an Ibex (RISCV core) example on an Arty-A7 but I haven't been able to build it properly.
It's been failing after the 'make' phase. It seems to have something to do with zlib however I'm not so sure since this…
![](../../users/profiles/12433467.webp)
ajabanto
- 23
- 3
1
vote
1 answer
Executing dynamically generated code on RISC-V
I am writing a Forth-like language for RISC-V and naturally that means I need to have a way to allow the users to define new words and execute them.
But I am struggling to find a way that will allow users to execute dynamically generated code…
![](../../users/profiles/937550.webp)
adrianmcmenamin
- 836
- 1
- 10
- 29
1
vote
2 answers
What does "not" mean in Assembly-RiscV?
What does not mean in RiscV? I got it after translating some code from C like this:
not a0, t1
![](../../users/profiles/14939321.webp)
daniel_smith
- 13
- 4
1
vote
1 answer
How do I store or load by byte unit into memory when using “riscv32-unknown-elf-gcc”?
I want to operate memory load or store in BYTE (8-bit) or HALF WORD (16-bit) unit.
So I made the C code as below and compiled it using "riscv32-unknown-elf-gcc".
void fun3 (void) {
char i,j;
i = (char)*(volatile unsigned int *) 0xf10007f8;
…
![](../../users/profiles/13810203.webp)
doldooly
- 23
- 5
1
vote
1 answer
Access rights in RISC-V linkerscripts
When programming ARM-based microcontrollers, I'm used to see a MEMORY{..} segment in the linkerscript like this:
MEMORY
{
FLASH (rx): ORIGIN = 0x08000000, LENGTH = 128K
RAM (xrw): ORIGIN = 0x20000000, LENGTH = 32K
}
The access rights are…
![](../../users/profiles/6178507.webp)
K.Mulier
- 6,430
- 9
- 58
- 110
1
vote
2 answers
What is intended/correct way to handle interrupts and use the WFI risc-v cpu instruction?
I am very new to bare metal programming and have never delt with interrupts before, but I've been learning on a RISC-V FE310-G002 SOC powered dev board.
I've been reading about the RISC-V WFI (Wait for interrupt) instruction and from the manuals, it…
![](../../users/profiles/13297961.webp)
Echelon X-Ray
- 77
- 6
1
vote
1 answer
How is the 34 bit physical address space accessed in a RISC-V 32 bit system when virtual memory is disabled?
In the RISC-V 32 bit ISA, the physical address space is 34 bit with a 32 bit virtual address space. When virtual memory is enabled in supervisor mode the 32 bit virtual address is translated by accessing the page table, yielding a 34 bit physical…
![](../../users/profiles/13936164.webp)
Joshua McKelvey
- 13
- 3
1
vote
0 answers
How do I reverse a 32 bit register in riscV (32 bit), is there a command for it?
I am using the venus simulator for writing code. I can't find a specific instruction for rotation or reversing a register.
![](../../users/profiles/12139192.webp)
fortune7
- 21
- 2
1
vote
0 answers
RISC-V: operation with a0 changes other register values
I'm currently doing a small project on risc-v.
The problem is that, in a function, when I do something like this,
foo:
...
lw a3, 4(sp)
srli a2, a2, 16
srli a4, a4, 16
add a0, a2, a4
ret
after executing add a0, a2, a4…
![](../../users/profiles/11276841.webp)
TAYTAY1313
- 11
- 1
0
votes
0 answers
Unrecognized opcode in creating custom RISC-V instruction
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…
![](../../users/profiles/13289702.webp)
ttle
- 3
- 1
0
votes
0 answers
RISC-V (RV32I) - SCALL/ECALL, SBREAK/EBREAK, FENCE, FENCE.I
I am trying to understand how does and what does the following instructions do for RISC-V (RV32I with only machine privilege specifically):
SCALL/ECALL
SBREAK/EBREAK,
FENCE
FENCE.I
0
votes
0 answers
Compiling rv32i Code includes compressed Instructions
Im trying to compile bland c code to an elf format executable by a RV32i processor.
However when I enable optimizations (-Os or -O2) the resulting assembly contains compressed Instructions which I can not execute.
All my selfmade code is being…
![](../../users/profiles/14769260.webp)
Sun.
- 3
- 3
0
votes
1 answer
RISC-V Assembly language. Only printing zero
The following code is supposed to take two lists and put them into one big list (C[10]) and being a beginner in assembly I am unsure as to how to check if my output is correct.
I tried implementing a print to check if the left half works but it only…
![](../../users/profiles/14519284.webp)
ZeinZebib
- 16
- 2