use bit_field::BitField;
use core::fmt::Debug;
impl_define_csr!(
Rvacfg,
"Reduced Virtual Address Configuration\n\
This register is used to control the length of the address being reduced in the virtual address reduction mode."
);
impl_read_csr!(0x1f, Rvacfg);
impl Rvacfg {
fn rbits(&self) -> usize {
self.bits
}
}
pub fn set_rbits(val: usize) {
debug_assert!(val <= 8);
set_csr_loong_bits!(0x1f, 0.., val);
}
impl Debug for Rvacfg {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
f.debug_struct("RVACfg")
.field("rbits", &self.rbits())
.finish()
}
}