public static Data Lookup(ulong key_in) { Data res = new Data(); ulong idx = 0; idx = HashCAM.Read(key_in); res.matched = HashCAM.matched; res.result = 0; if (HashCAM.matched) { NaughtyQ.BackOfQ(idx); res.result = NaughtyQ.Read(idx); } return res; }
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(); } }