Questions tagged [risc-v]

For questions related to RISC-V assembler, compiler specifics and HDL (hardware description language) implementation and use.

Summary

RISC-V (pronounced "risk-five") is an instruction set architecture (ISA) that was originally designed to support computer architecture research and education and is now a standard open architecture for industry implementations under the governance of the RISC-V Foundation. RISC-V was originally developed in the Computer Science Division of the EECS Department at the University of California, Berkeley.

Features

  • A completely open ISA that is freely available to academia and industry.

  • A real ISA suitable for direct native hardware implementation, not just simulation or binary translation.

  • An ISA that avoids "over-architecting" for a particular microarchitecture style (e.g., microcoded, in-order, decoupled, out-of-order) or implementation technology (e.g., full-custom, ASIC, FPGA), but which allows efficient implementation in any of these.

  • An ISA separated into a small base integer ISA, usable by itself as a base for customized accelerators or for educational purposes, and optional standard extensions, to support general-purpose software development.

  • Support for the revised 2008 IEEE-754 floating-point standard.

  • An ISA supporting extensive user-level ISA extensions and specialized variants.

  • 32-bit, 64-bit, and 128-bit address space variants for applications, operating system kernels, and hardware implementations.

  • An ISA with support for highly-parallel multicore or manycore implementations, including heterogeneous multiprocessors.

  • Optional variable-length instructions to both expand available instruction encoding space and to support an optional dense instruction encoding for improved performance, static code size, and energy efficiency.

  • A fully virtualizable ISA to ease hypervisor development.

  • An ISA that simplifies experiments with new supervisor-level and hypervisor-level ISA designs.

References

31 questions
10
votes
2 answers

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 when the RISC-V CPU gets an instruction as all…
David777
  • 1,548
  • 12
  • 29
4
votes
1 answer

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 instruction: SW x8, -6(x4) What I thought it meant: Take…
RhinoECE
  • 41
  • 1
  • 2
3
votes
2 answers

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 find any information on it.
user294957
  • 133
  • 5
3
votes
0 answers

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 "?". This function should return the length of the string. Example: before: stop…
3
votes
1 answer

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?
Anthony
  • 55
  • 5
3
votes
2 answers

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 Specification (PMP is Physical Memory Protection). I…
Shashank V M
  • 2,279
  • 13
  • 47
2
votes
1 answer

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 understand how and why it is used.
1
vote
1 answer

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 like it has something to do with the fact that LOAD…
Shinobi San
  • 111
  • 1
1
vote
0 answers

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 all 32-bit lines of a register, the reset signal…
David777
  • 1,548
  • 12
  • 29
1
vote
1 answer

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 what typically would be the most accurate way to…
1
vote
2 answers

How to choose the memory size to port a soft from 68HC11 8bit to RISC-V based MCU 32bits target

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 memory I should use on my new 32 bit…
Philippe
  • 11
  • 3
1
vote
1 answer

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 taken but it is given that it should not…
jhe4x
  • 13
  • 1
  • 4
1
vote
1 answer

Where is the RAM stored on a RISC-V CPU?

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 the CPU will have some levels of cache directly on…
1
vote
1 answer

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: lui s0,0x20 Can someone kindly explain what lui does?
daniel
  • 21
  • 2
  • 6
1
vote
1 answer

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-enable bits, MIE, SIE, and UIE, are provided for each …
tuskiomi
  • 585
  • 6
  • 23
1
2 3