pub fn read_line(&mut self, p_address: u64) -> Result<L1CacheLine, ()> {
		let tag: u64 = (p_address >> (L1_CACHE_OFFSET_BITS + L1_CACHE_INDEX_BITS))
			& ((1 << L1_CACHE_TAG_BITS) - 1);
		let index: u64 = (p_address >> L1_CACHE_OFFSET_BITS) & ((1 << L1_CACHE_INDEX_BITS) - 1);
		// println!(
		// 	"{:x}({:b}): [{:b}|{:b}|{:b}]",
		// 	p_address,
		// 	p_address,
		// 	tag,
		// 	index,
		// 	p_address & ((1 << L1_CACHE_OFFSET_BITS) - 1)
		// );

		match self.read_line_raw(tag, index) {
			// hit
			Ok(cache_line) => {
				#[cfg(feature = "debug-cache")]
				println!("Hit {:x}", p_address);
				Ok(cache_line)
			}
			// miss
			_ => {
				#[cfg(feature = "debug-cache")]
				println!("Miss {:x}", p_address);
				Err(())
			}
		}
	}
/// Public interface to read 1 line from cache
///
/// # Arguments
/// * `p_address`: physical address
Public interface to read 1 line from cache
Public interface to read 1 line from cache
pub fn read_line(&mut self, p_address: u64) -> Result<L1CacheLine, ()> {
		let tag: u64 = (p_address >> (L1_CACHE_OFFSET_BITS + L1_CACHE_INDEX_BITS))
			& ((1 << L1_CACHE_TAG_BITS) - 1);
		let index: u64 = (p_address >> L1_CACHE_OFFSET_BITS) & ((1 << L1_CACHE_INDEX_BITS) - 1);
		// println!(
		// 	"{:x}({:b}): [{:b}|{:b}|{:b}]",
		// 	p_address,
		// 	p_address,
		// 	tag,
		// 	index,
		// 	p_address & ((1 << L1_CACHE_OFFSET_BITS) - 1)
		// );
		match self.read_line_raw(tag, index) {
			// hit
			Ok(cache_line) => {
				#[cfg(feature = "debug-cache")]
				println!("Hit {:x}", p_address);
				Ok(cache_line)
			}
			// miss
			_ => {
				#[cfg(feature = "debug-cache")]
				println!("Miss {:x}", p_address);
				Err(())
			}
		}
	}
pub fn read_line ( & mut self , p_address : u64 ) -> Result < L1CacheLine , ( ) > { let tag : u64 = ( p_address >> ( L1_CACHE_OFFSET_BITS + L1_CACHE_INDEX_BITS ) ) & ( ( 1 << L1_CACHE_TAG_BITS ) - 1 ) ; let index : u64 = ( p_address >> L1_CACHE_OFFSET_BITS ) & ( ( 1 << L1_CACHE_INDEX_BITS ) - 1 ) ; // println!( // 	"{:x}({:b}): [{:b}|{:b}|{:b}]", // 	p_address, // 	p_address, // 	tag, // 	index, // 	p_address & ((1 << L1_CACHE_OFFSET_BITS) - 1) // ); match self . read_line_raw ( tag , index ) { // hit Ok ( cache_line ) => { # [ cfg ( feature " " ) ] println ! ( " " p_address ) ; Ok ( cache_line ) } // miss _ => { # [ cfg ( feature " " ) ] println ! ( " " p_address ) ; Err ( ( ) ) } } }
Public interface to read 1 line from cache
Public interface to read 1 line from cache
&mut self
p_address
u64