コード例 #1
0
ファイル: LRU.cs プロジェクト: marktdeng/emu-live
 public static void Cache(ulong key_in, ulong value_in)
 {
   // FIXME could delete node (move it to front of queue)
   //       if it already exists in the queue.
   //       That would avoid "bubbles" of unnecessary
   //       nodes forming in the queue.
   ulong idx = NaughtyQ.Enlist(value_in);
   HashCAM.Write(key_in, idx);
   // FIXME relay "is_full"
 }
コード例 #2
0
    static void Main()
    {
        for (ulong i = 0; i < 20; i++)
        {
            Kiwi.Pause();
            NaughtyQ.Enlist(i);
            Kiwi.Pause();
        }

        NaughtyQ.BackOfQ(5);

        NaughtyQ.BackOfQ(10);

        NaughtyQ.BackOfQ(5);
        NaughtyQ.BackOfQ(5);

        for (ulong i = 0; i < 20; i++)
        {
            NaughtyQ.Read(i);
            Kiwi.Pause();
        }
    }