// File: /workspace/github_cpp_makefile_star2_O3/gvaumour[P]cache-simulator/src/Predictor.cc
// Function: Predictor::reportMiss(unsigned long, int)
bool
Predictor::reportMiss(uint64_t block_addr , int id_set)
{

	stats_total_miss++;
	
	/* Miss classification between cold/conflict/capacity */
	if(simu_parameters.simulate_conflicts)
	{
		//DPRINTF(DebugFUcache , "Predictor::reportMiss block %#lx \n" , block_addr);
		if(m_accessedBlocks.count(block_addr) == 0)
		{
			stats_cold_miss++;
			//DPRINTF(DebugFUcache , "Predictor::reportMiss block not been accessed \n" );
		}
		else
		{
			bool find = false;
			for(unsigned i = 0; i < m_NVM_FU.size() && !find; i++)
			{
				if(m_NVM_FU[i]->addr == block_addr)
				{
					stats_nvm_conflict_miss++;
					find = true;
					break;
				}
			}
			for(unsigned i = 0; i < m_SRAM_FU.size() && !find; i++)
			{
				if(m_SRAM_FU[i]->addr == block_addr)
				{
					stats_sram_conflict_miss++;
					find = true;
					break;
				}
			}
			if(!find)
				stats_capacity_miss++;
		}
	 }
	 
	/************************************************************/
	bool sram_error = hitInSRAMMissingTags(block_addr, id_set);
	if(sram_error)
	{
		stats_SRAM_errors[stats_SRAM_errors.size()-1]++;	
		
		if(simu_parameters.enableDatasetSpilling)
		{
			int starting_set = (id_set/m_nb_MTcouters_sampling) * m_nb_MTcouters_sampling; 
			for(int i = starting_set ; i < starting_set + m_nb_MTcouters_sampling ; i++)
				m_SRAM_MT_counters[id_set]++;
		
		}
	}
	/*
	if(simu_parameters.enableDatasetSpilling)
	{	
		bool nvm_error = hitInNVMMissingTags(block_addr , id_set);
		if(nvm_error)
			m_NVM_MT_counters[id_set]++;
	}*/
	
	bool bypass_error = checkBypassTag(block_addr , id_set);
	if( bypass_error )
		stats_BP_errors[stats_BP_errors.size()-1]++;
	
	
	return sram_error;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
incq 0x1d8(%rdi)
movq %rsi, %r14
leaq 0x1efc9(%rip), %r15     # 0x45f50
cmpb $0x1, 0x88(%r15)
jne 0x2704e
movq 0x198(%rbx), %rcx
movl $0x1d0, %eax            # imm = 0x1D0
testq %rcx, %rcx
je 0x2704a
leaq 0x190(%rbx), %rsi
movq %rsi, %rdx
xorl %edi, %edi
cmpq %r14, 0x20(%rcx)
setb %dil
cmovaeq %rcx, %rdx
movq 0x10(%rcx,%rdi,8), %rcx
testq %rcx, %rcx
jne 0x26fb4
cmpq %rsi, %rdx
je 0x2704a
cmpq %r14, 0x20(%rdx)
ja 0x2704a
movq 0x158(%rbx), %rax
movq 0x160(%rbx), %rcx
subq %rax, %rcx
je 0x27007
sarq $0x3, %rcx
movl $0x1, %edx
xorl %esi, %esi
movq (%rax,%rsi,8), %rsi
cmpq %r14, (%rsi)
je 0x2703e
movl %edx, %esi
incl %edx
cmpq %rsi, %rcx
ja 0x26ff5
movq 0x170(%rbx), %rcx
movq 0x178(%rbx), %rdx
movl $0x1b8, %eax            # imm = 0x1B8
subq %rcx, %rdx
je 0x2704a
sarq $0x3, %rdx
movl $0x1, %esi
xorl %edi, %edi
movq (%rcx,%rdi,8), %rdi
cmpq %r14, (%rdi)
je 0x27045
movl %esi, %edi
incl %esi
cmpq %rdi, %rdx
ja 0x2702a
jmp 0x2704a
movl $0x1c0, %eax            # imm = 0x1C0
jmp 0x2704a
movl $0x1c8, %eax            # imm = 0x1C8
incq (%rbx,%rax)
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x27102
movl %eax, %ecx
movslq %ebp, %rsi
testb %al, %al
je 0x270b2
movq 0x200(%rbx), %rax
incl -0x4(%rax)
cmpb $0x1, 0x158(%r15)
jne 0x270b2
movl 0x138(%rbx), %edi
testl %edi, %edi
jle 0x270b2
movl %esi, %eax
cltd
idivl %edi
movl %esi, %eax
subl %edx, %eax
addl %eax, %edi
movq 0xb8(%rbx), %r8
movq (%r8,%rsi,8), %r9
incl %eax
cmpl %eax, %edi
cmovgl %edi, %eax
movl %esi, %edi
notl %edi
addl %edx, %edi
addl %eax, %edi
leaq (%r9,%rdi), %rax
incq %rax
movq %rax, (%r8,%rsi,8)
movq 0x140(%rbx), %rdx
leaq (%rsi,%rsi,2), %rsi
movq (%rdx,%rsi,8), %rax
movq 0x8(%rdx,%rsi,8), %rdx
subq %rax, %rdx
je 0x270f4
sarq $0x3, %rdx
movl $0x1, %esi
xorl %edi, %edi
movq (%rax,%rdi,8), %rdi
cmpq %r14, (%rdi)
je 0x270ea
movl %esi, %edi
incl %esi
cmpq %rdi, %rdx
ja 0x270d6
jmp 0x270f4
movq 0x218(%rbx), %rax
incl -0x4(%rax)
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop