Add test program for complex addressing image and basis

This commit is contained in:
GuillaumeDIDIER 2020-07-16 11:46:41 +02:00
parent bec16025ec
commit 6aa5784e22

View File

@ -1,5 +1,21 @@
use cache_utils::cache_info::get_cache_info;
use cache_utils::complex_addressing::cache_slicing;
use cpuid::MicroArchitecture;
pub fn main() {
println!("{:#?}", get_cache_info());
if let Some(uarch) = MicroArchitecture::get_micro_architecture() {
if let Some(vendor_family_model_stepping) = MicroArchitecture::get_family_model_stepping() {
let slicing = cache_slicing(
uarch,
8,
vendor_family_model_stepping.0,
vendor_family_model_stepping.1,
vendor_family_model_stepping.2,
);
println!("{:?}", slicing.image((1 << 12) - 1));
println!("{:?}", slicing.kernel_compl_basis((1 << 12) - 1));
}
}
}