設備: Raspberry pi 5
OS : $ uname -a
Linux pi 6.6.31+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux
參考資料
The Linux Kernel Module Programming Guide
事前作業
Raspberry Pi 5 Pinout
image
相關名詞:
Sample mean
Introduce
Our tool does not rely on static analysis but on statistical analysis of execution timing measurements on the target platform. In this way, we circumvent the problem of modeling the underlying hardware.
實做方法 : TIMING LEAKAGE DETECTION
對執行時間進行洩漏檢測。測量兩個輸入資料的執行時間 (execution time) ,然後檢查兩者時間分佈在統計上是否有不同 (statistically different)。
Step 1: Measure execution time
I added waveform analysis for J-type and S-type in Homework 3.
Extend Homework3 to 3-stage pipeline processor
contributed by < jeremy90307 >
The code for the Three-Stage processor is ca2023-lab3_3-Stage, and the reference source is YatCPU_Lab.
Interrupt
Introduction
Before constructing the Three-Stage CPU, it is essential to understand the concept of interrupts. Without interrupts, a program will only run according to the pre-defined instructions without the ability to interrupt midway. However, a practical CPU must always be ready to handle external events, allowing it to promptly process interrupts.
Jim Huang changed a year agoView mode Like Bookmark
contributed by < jeremy90307 >
Environment setup
OS:ubuntu 22.04
sbt versopn:1.9.4
JDK version:1.8.0
Follow the instructions in Lab3: Construct a single-cycle RISC-V CPU with Chisel to set up the environment.
GTKWave Installation
Install
Contributed by <jeremy90307>
Prepare GNU Toolchain for RISC-V
Lab2: RISC-V RV32I[MA] emulator with ELF support
Question Selection
Question
I chose the question by student KuanYuan053: "Implement quantization from bfloat16 to int8"
:::spoiler C code
Since student KuanYuan053 has already optimized the C code significantly, I won't waste time modifying it. I'll proceed directly to the RISC-V part.
Topic : Convert FP32 to BF16 and Count the Number of Ones in the Binary Representation
test data
Single-precision (FP32)
bloat16 as HEX literals
bfloat16 as binary literals
1.200000
0x3f99999a
00111111100110011001100110011010