Expand description
RISC-V system information library
Provides functions to detect and query RISC-V specific system information including ISA extensions, hardware IDs, vector capabilities, and more.
§Example
use riscfetch_core::*;
if is_riscv() {
println!("ISA: {}", get_isa_string());
println!("Extensions: {}", get_extensions_compact());
}Structs§
- Cache
Info - Cache information
- Hardware
Ids - Hardware IDs from RISC-V CSRs
- Riscv
Info - RISC-V specific information only (excludes generic system info)
- System
Info - Complete system information for JSON serialization
- Vector
Info - Vector extension information
Functions§
- collect_
all_ info - Collect all information into a single struct
- collect_
riscv_ info - Collect RISC-V specific information only (excludes generic system info)
- get_
board_ info - Get board/model information from device tree
- get_
cache_ info - Get cache information
- get_
extensions_ compact - Get compact extension list (e.g., “I M A F D C V”)
- get_
extensions_ explained - Get extensions with explanations
- get_
hardware_ ids - Get hardware IDs (mvendorid, marchid, mimpid)
- get_
hart_ count - Get hart count as formatted string
- get_
hart_ count_ num - Get hart count as number
- get_
isa_ string - Get raw ISA string (e.g., “rv64imafdcv_zicsr_…”)
- get_
kernel_ info - Get kernel version
- get_
memory_ bytes - Get memory information as bytes
- get_
memory_ info - Get memory usage as formatted string
- get_
os_ info - Get OS name from /etc/os-release
- get_
uptime - Get uptime as formatted string
- get_
uptime_ seconds - Get uptime in seconds
- get_
vector_ detail - Get vector extension details (VLEN, ELEN)
- get_
z_ extensions - Get Z-extensions as compact string
- get_
z_ extensions_ explained - Get Z-extensions with explanations
- is_
riscv - Check if the current system is RISC-V architecture
- parse_
extensions_ compact - Parse extensions from ISA string (pure function for testing)
- parse_
extensions_ explained - Parse extensions with explanations (pure function for testing)
- parse_
vector_ from_ isa - Parse vector details from ISA string (pure function for testing) Returns None if no vector extension, Some(details) otherwise
- parse_
z_ extensions - Parse Z-extensions from ISA string (pure function for testing)
- parse_
z_ extensions_ explained - Parse Z-extensions with explanations (pure function for testing)