pub fn read_line_info(&mut self, p_address: u64) -> Result<u64, ()> {
		let tag: u64 = (p_address >> (L2_CACHE_OFFSET_BITS + L2_CACHE_INDEX_BITS))
			& ((1 << L2_CACHE_TAG_BITS) - 1);
		let index: u64 = (p_address >> L2_CACHE_OFFSET_BITS) & ((1 << L2_CACHE_INDEX_BITS) - 1);

		match self.read_line_info_raw(tag, index) {
			// hit
			Ok(_way) => {
				#[cfg(feature = "debug-cache")]
				println!("Hit {:x}", p_address);
				Ok(_way)
			}
			// miss
			_ => {
				#[cfg(feature = "debug-cache")]
				println!("Miss {:x}", p_address);
				Err(())
			}
		}
	}
/// Public interface to read way index of 1 line from cache
///
/// # Arguments
/// * `p_address`: physical address
Public interface to read way index of 1 line from cache
Public interface to read way index of 1 line from cache
pub fn read_line_info(&mut self, p_address: u64) -> Result<u64, ()> {
		let tag: u64 = (p_address >> (L2_CACHE_OFFSET_BITS + L2_CACHE_INDEX_BITS))
			& ((1 << L2_CACHE_TAG_BITS) - 1);
		let index: u64 = (p_address >> L2_CACHE_OFFSET_BITS) & ((1 << L2_CACHE_INDEX_BITS) - 1);
		match self.read_line_info_raw(tag, index) {
			// hit
			Ok(_way) => {
				#[cfg(feature = "debug-cache")]
				println!("Hit {:x}", p_address);
				Ok(_way)
			}
			// miss
			_ => {
				#[cfg(feature = "debug-cache")]
				println!("Miss {:x}", p_address);
				Err(())
			}
		}
	}
pub fn read_line_info ( & mut self , p_address : u64 ) -> Result < u64 , ( ) > { let tag : u64 = ( p_address >> ( L2_CACHE_OFFSET_BITS + L2_CACHE_INDEX_BITS ) ) & ( ( 1 << L2_CACHE_TAG_BITS ) - 1 ) ; let index : u64 = ( p_address >> L2_CACHE_OFFSET_BITS ) & ( ( 1 << L2_CACHE_INDEX_BITS ) - 1 ) ; match self . read_line_info_raw ( tag , index ) { // hit Ok ( _way ) => { # [ cfg ( feature " " ) ] println ! ( " " p_address ) ; Ok ( _way ) } // miss _ => { # [ cfg ( feature " " ) ] println ! ( " " p_address ) ; Err ( ( ) ) } } }
Public interface to read way index of 1 line from cache
Public interface to read way index of 1 line from cache
&mut self
p_address
u64