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
ExtensionEntry
Extension entry with name and description
ExtensionInfo
Extension info with category and support status
HardwareIds
Hardware IDs from RISC-V CSRs
RiscvInfo
RISC-V specific information only (excludes generic system info)
SystemInfo
Complete system information for JSON serialization
VectorInfo
Vector extension information

Constants§

STANDARD_EXTENSIONS
Standard extension definitions Format: (char, name, description)
S_CATEGORY_NAMES
Category display names for S-extensions
S_EXTENSIONS
S-extension definitions (Privileged/Supervisor) Format: (pattern, name, description, category)
Z_CATEGORY_NAMES
Category display names for Z-extensions
Z_EXTENSIONS
Z-extension definitions (Unprivileged) Format: (pattern, name, description, category)

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_all_s_extensions_with_status
Get ALL S-extensions with support status based on ISA string
get_all_standard_extensions_with_status
Get ALL standard extensions with support status
get_all_z_extensions_with_status
Get ALL Z-extensions with support status based on ISA string
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_s_category_name
Get category display name for S-extensions
get_s_extensions
Get S-extensions as compact string
get_s_extensions_explained
Get S-extensions with explanations
get_s_extensions_with_category
Get S-extensions with category info
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_category_name
Get category display name for Z-extensions
get_z_extensions
Get Z-extensions as compact string
get_z_extensions_explained
Get Z-extensions with explanations
get_z_extensions_with_category
Get Z-extensions with category info
group_by_category
Group extensions by category
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_s_extensions
Parse S-extensions from ISA string (pure function for testing)
parse_s_extensions_explained
Parse S-extensions with explanations (pure function for testing)
parse_s_extensions_with_category
Parse S-extensions with category info
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)
parse_z_extensions_with_category
Parse Z-extensions with category info