Beispiel #1
0
        private bool findBankIdx(mem_req req)
        {
            ulong s_row;
            int   mem_idx, ch_idx, rank_idx, bank_idx, row_idx;

            MemoryRequest.mapAddr(req.address >> Config.cache_block, out s_row, out mem_idx, out ch_idx, out rank_idx, out bank_idx, out row_idx);
            return(bank_idx == search_bank_idx);
        }
Beispiel #2
0
        public override bool getNext()
        {
            next_req = null;
            if (!is_chunk_base || (req_list.Count == 0))
            {
                while (req_list.Count < check_num)
                {
                    if (m_eof)
                    {
                        break;
                    }
                    try
                    {
                        ulong t_addr      = m_reader.ReadUInt64();
                        int   t_preceding = m_reader.ReadInt32();

                        Trace.Type t_type = (t_addr >> 63) != 0 ?
                                            Trace.Type.Rd : Trace.Type.Wr;
                        t_addr &= 0x7FFFFFFFFFFFFFFF;

                        t_addr |= ((ulong)m_group) << 48;

                        mem_req req = new mem_req(t_type, t_addr, 0);

                        //		    Console.WriteLine("push request: addr{0:x}", t_addr);
                        req_list.Add(req);
                    }
                    catch (EndOfStreamException)
                    {
                        m_eof = true;
                        break;
                    }
                }
            }
            if (req_list.Count > 0)
            {
                popList();
                address = next_req.address;
                from    = next_req.from;
                type    = next_req.type;
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #3
0
        private void popList()
        {
            for (int i = 0; i < Config.memory.numBanks; i++)
            {
                int idx;
                search_bank_idx = Simulator.QoSCtrl.getReqMinBank(i);
                //	Console.WriteLine("check bank:{0}", search_bank_idx);
                idx = req_list.FindIndex(findBankIdx);
                if (idx >= 0)
                {
                    next_req = req_list[idx];
                    req_list.RemoveAt(idx);
//		    Console.WriteLine("Pick up addr:{0:x} from bank{1}", next_req.address, search_bank_idx );

                    break;
                }
            }
            return;
        }
Beispiel #4
0
        public override bool getNext()
        {
	    next_req = null;
	    if( !is_chunk_base || ( req_list.Count == 0 ))
	    {
		while( req_list.Count < check_num )
		{
		    if( m_eof ) break;
		    try
		    {
			ulong t_addr = m_reader.ReadUInt64();
			int t_preceding = m_reader.ReadInt32();

			Trace.Type t_type = (t_addr >> 63) != 0 ?
			    Trace.Type.Rd : Trace.Type.Wr;
			t_addr &= 0x7FFFFFFFFFFFFFFF;

			t_addr |= ((ulong)m_group) << 48;

			mem_req req = new mem_req(t_type,t_addr,0);

			//		    Console.WriteLine("push request: addr{0:x}", t_addr);
			req_list.Add(req);
		    }
		    catch (EndOfStreamException)
		    {
			m_eof = true;
			break;
		    }
		}
	    }
	    if( req_list.Count > 0 )
	    {
		popList();
		address = next_req.address;
		from = next_req.from;
		type = next_req.type;
		return(true);
	    }
	    else
		return false;
        }
Beispiel #5
0
	private bool findBankIdx(mem_req req)
	{
	    ulong s_row;
	    int mem_idx, ch_idx, rank_idx, bank_idx, row_idx;

	    MemoryRequest.mapAddr(req.address>>Config.cache_block, out s_row, out mem_idx, out ch_idx, out rank_idx, out bank_idx, out row_idx );
	    return(bank_idx == search_bank_idx);
	}
Beispiel #6
0
	private void popList()
	{
	    for( int i = 0; i < Config.memory.numBanks; i++ )
	    {
		int idx;
		search_bank_idx = Simulator.QoSCtrl.getReqMinBank(i);
		//	Console.WriteLine("check bank:{0}", search_bank_idx);
		idx = req_list.FindIndex(findBankIdx);
		if( idx >= 0 )
		{
		    next_req = req_list[idx];
		    req_list.RemoveAt(idx);
//		    Console.WriteLine("Pick up addr:{0:x} from bank{1}", next_req.address, search_bank_idx );

		    break;
		}
	    }
	    return;
	}