SlideShare a Scribd company logo
CAMP-V
ULTIMATE RISC-V BOOTCAMP
and
presents
Welcome
CAMP-V
RISC-V Advocate
Research Associate @ MERL
CPU Design Engineer @ Intensivate
CAMP-V
AGENDA
Introductory Note
10:00 AM
MERL Projects Showcase
12:30 PM
Speed Programming
2:00 PM
RISC-V Assembly Seminar
10:30 AM
Lunch Break
1:00 PM
Closing Note
4:00 PM
CAMP-V
CAMP-V
Research assistant @ MERL
lfx mentee 2023
CAMP-V
Instruction Set Architecture
CAMP-V
Instruction Set Architecture (ISA)
Defines how software controls hardware.
Two types of ISAs.
Complex Instruction Set Computer (CISC)
Reduced Instruction Set Computer (RISC)
CAMP-V
CAMP-V: Ultimate RISC-V Bootcamp sponsored by MERL and RISC-V
https://www.linkedin.com/posts/sidhant-jha-330223277_instruction-set-architecture-complete-flow-activity-7117942562757255168-v320/
CAMP-V
Complex Instruction Set Computer (CISC)
Supports complex instructions taking multiple clock cycles.
Supports variable-length instructions.
Consists of a few registers.
Example: x86
CAMP-V
Reduced Instruction Set Computer (RISC)
Supports simple instructions taking a single clock cycle.
Supports only fixed-length instructions.
Register count is big.
Example: ARM and RISC-V
CAMP-V
CISC vs RISC
CISC
Reduced code size.
Complex design.
Slower execution.
Greater power
consumption.
RISC
Greater code size.
Simpler design.
Faster execution.
Lower power
consumption.
CAMP-V
Quizizz
Password: merl1234
CAMP-V
RISC-V
CAMP-V
Background
Pronounced “risk-five”.
Developed in 2010 at University of California, Berkeley.
Fifth iteration of the RISC architecture.
Two variants: RV32 and RV64.
Extension based ISA.
RV32I as base extension.
M extension for multiplication instructions.
A extension for atomic instructions.
F extension for single-precision floating-point instructions.
D extension for double-precision floating-point instructions.
These extensions are collectively known as RV32G.
CAMP-V
RV32I Characteristics
32-bit general purpose integer registers named x0 through x31.
ABI names are standardized names for registers.
A RISC-V hart has byte-addressable address space.
32-bit register called a Program Counter (PC).
CAMP-V
Register Conventions
ABI name: zero
Value of the register is always
zero.
x0
CAMP-V
Register Conventions
ABI name: ra
Stores the return address of a
function call.
x1
CAMP-V
Register Conventions
ABI name: sp
Stores the address pointing to the
top of the stack in memory.
x2
CAMP-V
Register Conventions
ABI name: gp
Stores the address pointing to the
segment of memory holding global
variables (aka the data section).
gp
x3
CAMP-V
Register Conventions
ABI name: tp
Stores the address pointing to the
thread-local storage area of
memory containing data unique to
each thread.
x4
CAMP-V
Register Conventions
ABI names: t0-t2, t3-t6
Stores temporary data or data not
to be preserved between function
calls.
x5-x7
x28-x31
CAMP-V
Register Conventions
ABI names: s0/fp
Stores the address pointing to the
bottom of the current stack frame.
x8
CAMP-V
Register Conventions
ABI names: s1, s2-s11
Stores data that is to be preserved
between function calls.
x9
x18-x27
CAMP-V
Register Conventions
ABI name: a0-a7
These store function argument
values.
a0-a1 registers also store the return
values of functions.
x10-x17
CAMP-V
Quizizz
CAMP-V
RISC-V Assembly
CAMP-V
Assembly
Low-level programming language.
Strong correspondence between assembly instructions and machine language.
Direct communication with hardware.
All compilers and interpreters compile or interpret to assembly.
CAMP-V
RISC-V Assembly
Types of instructions
Computational
register-register
register-immediate
Conditional Jumps
Unconditional Jumps
Memory operations
Supplementary
CAMP-V
Computational Instructions
Register-register instructions
Format: inst rd, rs1, rs2
Register-immediate instructions
Format: inst rd, rs1, imm
Arithmetic Comparison Logical Shifts
Register-register add, sub slt, sltu and, or, xor sll, srl, sra
Register-immediate addi slti, sltiu andi, ori, xori slli, srli, srai
CAMP-V
Register-register instruction encoding
Computational Instructions
Register-immediate instruction encoding
CAMP-V
Instruction beq bne blt bltu bge bgeu
Operation == != < < >= >=
Conditional Jumps or Branch Instructions
If the condition is true, jump to the label.
Format: inst rs1, rs2, label
CAMP-V
Conditional Jumps or Branch Instructions
Used in if and loop conditions.
CAMP-V
Branch instruction encoding
Conditional Jumps or Branch Instructions
CAMP-V
Unconditional Jumps
If this instruction is encountered, jump to the label or address.
The address of the instruction following the jump instruction is saved to the
destination register.
jal: Jump and Link
Jump target specified as label.
Format: jal rd, label
jalr: Jump and Link Register
Jump target specified as sum of register value and constant offset.
Format: jalr, rd, rs1, imm
CAMP-V
Unconditional Jumps
Used in function calls.
jal is used to jump to function definition.
jalr is used to return from the function call.
CAMP-V
Unconditional Jumps
jal instruction encoding
jalr instruction encoding
CAMP-V
Instructions for communicating with memory.
Load instruction.
Reads data from memory.
Format: lw rd, imm(rs1)
Store instruction.
Writes data to memory.
Format: sw rs2, imm(rs1)
Memory Operation Instructions
CAMP-V
Memory Operation Instructions
Load instruction encoding
Store instruction encoding
CAMP-V
Supplementary Instructions
To be used in conjunction with other instructions.
lui: Load Upper-Immediate
loads the 20-bit immediate into the upper 20 bits of rd.
Used to build 32-bit constants.
auipc: Add Upper-Immediate to PC
loads the 20-bit immediate into the upper 20-bits, adding this offset to the PC.
Used to build PC-relative addresses.
Format: inst rd, imm
CAMP-V
Supplementary Instructions
Supplementary instruction encoding
CAMP-V
Quizizz
CAMP-V

More Related Content

PDF
The Stack Frame
PDF
Reversing & malware analysis training part 4 assembly programming basics
PPT
PPTX
Embedded C programming session10
PPTX
07 140430-ipp-languages used in llvm during compilation
PPT
PDF
C programming session10
PDF
Code GPU with CUDA - SIMT
The Stack Frame
Reversing & malware analysis training part 4 assembly programming basics
Embedded C programming session10
07 140430-ipp-languages used in llvm during compilation
C programming session10
Code GPU with CUDA - SIMT

Similar to CAMP-V: Ultimate RISC-V Bootcamp sponsored by MERL and RISC-V (20)

PPT
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
PDF
ARM procedure calling conventions and recursion
PDF
Andes RISC-V processor solutions
PDF
AllBits presentation - Lower Level SW Security
PPTX
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
PPT
The ARM Architecture: ARM : ARM Architecture
PDF
Running Java on Arm - Is it worth it in 2025?
PDF
UVM-based RISC-V processor Verification Paltform ---.pdf
PPTX
CA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptx
PDF
Virtual Machine for Regular Expressions
PPT
ARM - Advance RISC Machine
PDF
PPTX
Computer Architecture Assignment Help
PPTX
Riscv 20160507-patterson
PDF
Lecture Presentation 9.pdf fpga soc using c
PDF
Assembly_80x86- Assembly languages programming and 80x861.pdf
PPTX
PPTX
Instruction Level Parallelism – Compiler Techniques
Lec15 Computer Architecture by Hsien-Hsin Sean Lee Georgia Tech -- EPIC VLIW
ARM procedure calling conventions and recursion
Andes RISC-V processor solutions
AllBits presentation - Lower Level SW Security
Reversing & Malware Analysis Training Part 4 - Assembly Programming Basics
The ARM Architecture: ARM : ARM Architecture
Running Java on Arm - Is it worth it in 2025?
UVM-based RISC-V processor Verification Paltform ---.pdf
CA-Lec4-RISCV-Instructions-1aaaaaaaaaa.pptx
Virtual Machine for Regular Expressions
ARM - Advance RISC Machine
Computer Architecture Assignment Help
Riscv 20160507-patterson
Lecture Presentation 9.pdf fpga soc using c
Assembly_80x86- Assembly languages programming and 80x861.pdf
Instruction Level Parallelism – Compiler Techniques
Ad

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Mushroom cultivation and it's methods.pdf
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Getting Started with Data Integration: FME Form 101
PPTX
TLE Review Electricity (Electricity).pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
OMC Textile Division Presentation 2021.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Accuracy of neural networks in brain wave diagnosis of schizophrenia
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
A Presentation on Artificial Intelligence
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Unlocking AI with Model Context Protocol (MCP)
Programs and apps: productivity, graphics, security and other tools
Mushroom cultivation and it's methods.pdf
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Empathic Computing: Creating Shared Understanding
Getting Started with Data Integration: FME Form 101
TLE Review Electricity (Electricity).pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
OMC Textile Division Presentation 2021.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Accuracy of neural networks in brain wave diagnosis of schizophrenia
Network Security Unit 5.pdf for BCA BBA.
A Presentation on Artificial Intelligence
Machine Learning_overview_presentation.pptx
Group 1 Presentation -Planning and Decision Making .pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Weekly Chronicles - August'25-Week II
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Unlocking AI with Model Context Protocol (MCP)
Ad

CAMP-V: Ultimate RISC-V Bootcamp sponsored by MERL and RISC-V