Crate riscfetch_core

Crate riscfetch_core 

Source
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§

CacheInfo
Cache information
HardwareIds
Hardware IDs from RISC-V CSRs
SystemInfo
Complete system information for JSON serialization
VectorInfo
Vector extension information

Functions§

collect_all_info
Collect all information into a single struct
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)