Questions tagged [risc-v]
For questions related to RISC-V assembler, compiler specifics and HDL (hardware description language) implementation and use.
31
questions
3
votes
2
answers
95
views
Memcopy Instruction in Risc V
I designed a Risc V 32-bit single cycle processor without pipelining for a project. We are given to implement a new instruction called "Memcopy". It copies an array of size N from one ...
0
votes
1
answer
489
views
RISC-V byte load and store
I have the confusion in the following RISC V programming statements. Can someone explain that why does the contents of s0 in the last comment shown. shouldn't it be 0x00000180 the same as we are not ...
3
votes
2
answers
128
views
What is a PCS accumulator?
I'm currently doing my bachelor's thesis in electronics. While reading an article, I stumbled upon the sentence "The FPU is based on a PCS accumulator...".
What does PCS stand for? I can't ...
2
votes
1
answer
112
views
What is a chip generator?
I've been trying to learn more about the RISC-V environment. I've encountered a chip generator called Rocket Chip.
What is a chip generator, and how does it differ from a core? I'm trying to ...
1
vote
1
answer
121
views
Why do we shift by three in RISC-V loops?
In this youtube video, the instructor explained some basic code in RISC-V assembly, but i didn't understand why in the first line, he is shifting i by 3. Why do we have to multiply it by 8??
I feel ...
1
vote
0
answers
54
views
Signal not Showing State Changes on Intergrated Logic Analyser (Vivado)
I have been using the Integrated Logic Analyser (ILA) on Vivado 2021.2 to log some signals from a RISC-V processor running on an FPGA (BASYS 3 FPGA development board).
The signals I am monitoring are ...
0
votes
1
answer
98
views
Why using RISC-V over off-the-shelf chips is more energy efficient?
I am not an expert on the world of chips, but as a developer, I understand quite well how they work and what problem each chip solves.
I have been increasingly curious about RISC-V and, among other ...
10
votes
2
answers
2k
views
RISC-V Zero Instruction Question
I have seen a table of opcodes for RISC-V instructions (for base I 32 bit ISA). I am working with a RISC-V core on FPGA and had BRAM for instructions set to all zeros.
Does anybody know what happens ...
0
votes
0
answers
34
views
How different layers of cache connect in hardware?
I had a RISC-V CPU with L1 Instruction Cache and L1 Data Cache, and I want to connect these two L1 Caches to unified L2 Cache. I have the following questions:
Does the unified L2 Cache have dual port ...
0
votes
1
answer
78
views
Generating Control Signals via Case statement vs Boolean function
I'm building a RISC-V processor recently, and I've encountered a question when constructing the control unit. That is, what's the difference between generating control signals through:
Case statement,...
3
votes
0
answers
173
views
How to using JAL in RISCV in this example?
Write a "replace" function that replaces every character in the source string between the first occurrence of character "(" and the first following ")" with character &...
1
vote
1
answer
89
views
What is preferred way to have an interrupt every second - setting timecmp to timecmp+1000 or time+1000
me and friend were discussing what the most accurate way have an timer interrupt happen every second in RISC-V. We understand that the internal clock is generally inaccurate, but were still wondering ...
0
votes
1
answer
221
views
How we are giving values to source registers in instruction set architecture?
This figure represents RISC-V R-type instruction. Let assume this instruction is for add operation. When this instruction is given to the processor it adds rs to rt.
My question is how rs and rt ...
0
votes
1
answer
436
views
classic RISC pipeline: Why does memory access stage comes before register file write back?
Here are two confusions:
Instruction fetch step provides info on what's the op and in which register the data lies, but how does that data comes into those registers?
It seems that once the execution ...
0
votes
3
answers
173
views
Is AXI a good interface for outside communications?
Suppose if we want to get some data from some ADCs, which are placed in a separate chip, and process that data in RISC-V processor. I was looking for an interface to define/use inside the RISC-V chip ...
3
votes
1
answer
1k
views
RISC-V: How do you store specific values in large addresses in Venus (RISC-V sim)?
I'm new to RISC-V and I'm having trouble understanding how one would store specific values in large addresses. For example, if I wanted to store the value 5 in 0x12312312, how would you go about that?
1
vote
2
answers
110
views
How to choose the memory size to port a soft from 68HC11 8bit to RISC-V based MCU 32bits target [closed]
I have to build a new hardware with a new 32bit microcontroller. I have a working project on an 8bit microconttroller.
When compiling the C program for my new target what will be the needed size of ...
3
votes
2
answers
4k
views
What is a hardware thread in RISC-V?
RISC-V PMP limits the physical addresses accessible by software running on a hart (hardware thread).
Source: edX course on Introduction to RISC-V, Chapter 4. Developing RISC-V, The Privileged ...
1
vote
1
answer
4k
views
Store byte instruction in RISC-V assembly
I have a short snippet of RISC-V assembly that I'm having trouble understanding. I'm not sure if I'm interpreting the instructions wrong, from my interpretation it seems as if the branch (BNE) will be ...
1
vote
1
answer
475
views
Where is the RAM stored on a RISC-V CPU? [closed]
Does RISC-V have any opinion on whether the RAM is stored on the same chip as the CPU (like on ARM devices) or on a separate chip somewhere on the motherboard (like on an x86 desktop)? I assume that ...
0
votes
0
answers
420
views
Offset of bnez in RISC-V program
I came across a question about assembly that I was confused on.
We are given the following table for addresses and instructions:
The question says: replace the labels of PC-relative targets with ...
4
votes
1
answer
8k
views
Help in understanding Store Word (SW) instruction in Risc-V
So this is what I understood from what my professor said, but I don't think it's the right answer. What am I doing wrong? I'm sure It's just some small thing that I'm getting mixed up.
Given ...
0
votes
0
answers
490
views
Forwarding in RiscV multi cycle Pipeline
Any idea could be helpful
I have been trying for days to understand forwarding mechanism in RiscV but unfountly I keep failing, so I though about asking basic question to make sure I am building on ...
1
vote
1
answer
7k
views
RISC-V assembly lui?
In RISC-V assembly I wrote:
addi s0,x0,0x20000
Is this legal such that the assembler will prove the command and make it work right or I'm forced to change it to:
<...
0
votes
0
answers
91
views
Why we can't do forward in RiscV?
While studying forwarding in RiscV cpu I saw the following claim:
But I can't understand why we can't do forward in this case, why in different conditions we were able to do this and now we can't?
It ...
-2
votes
1
answer
1k
views
RiscV assembly, function arguments
I learnt that in RiscV assembly we save function arguments in registers s0,...,s7 but what if I had more that 8 arguments?
Plus what about the case where I have more than 32 arguments (let's say 40) ...
-1
votes
1
answer
139
views
RiscV CPU, why is it so complicated? (for companies to build)
I saw an online code for RiscV32 bit processor which consists of nearly 1000 lines of code and supports all know commands like sw, lw, j, etc...
My question is, why companies like Apple need so much ...
0
votes
2
answers
3k
views
Assembly code, what does it do?
I'm interested to know what this assembly code do knowing that X1 is full of zeroes.
...
0
votes
1
answer
522
views
Best way to optimize verilog cpu?
I wrote a riscv core in verilog which works fine, but is slow. It can't go faster than 50mhz when synthesizing in Xilinx ise for spartan 6. I have however seen similar cores be able to go to 100mhz or ...
0
votes
2
answers
200
views
What are common ways that modern processors handle data hazards with asynchronous registers
I'm trying to design a processor in VHDL. While the base instruction set is done, I'm having trouble building on top of it.
Specifically, I'm implementing control and status registers (CSRs), which ...
1
vote
1
answer
138
views
Is this the correct truth table to determine whether or not to execute an interrupt in a RISC V system?
I'm working on implementing the privileged RISC V ISA, which can be found here.
I'm looking at the bottom of page 20, and the interrupt conditions are stated very confusingly:
Global interrupt-...