anchor.diff:      method Action displayQueue();
   endinterface
   
  -function Int#(2) compare (Node#(Bit#(size_t), Bit#(size_t)) x,
  +function Bit#(1) compare (Node#(Bit#(size_t), Bit#(size_t)) x,
                             Node#(Bit#(size_t), Bit#(size_t)) y);
       if (x.p > y.p)
           return 1;
  -    else if (x.p == y.p)
  +    else
           return 0;
  -    else
  -        return -1;
  +//    else if (x.p == y.p)
  +//        return 0;
  +//    else
  +//        return -1;
   endfunction
   
   module mkMinPriorityQueue (MinPriorityQueue#(Bit#(size_t), Bit#(size_t)));
  -    FIFO#(Node#(Bit#(size_t), Bit#(size_t)))
  -        insert_req_fifo <- mkSizedFIFO(valueof(SIZE));
       FIFO#(void) insert_res_fifo <- mkBypassFIFO;
   
       PE#(SIZE) priority_encoder <- mkPEncoder;
   
       Vector#(SIZE, Reg#(Node#(Bit#(size_t), Bit#(size_t))))
                      sorted_list <- replicateM(mkReg(defaultValue));
  -    Vector#(SIZE, Reg#(Bit#(1))) b_vector <- replicateM(mkReg(0));
       Reg#(Node#(Bit#(size_t), Bit#(size_t))) node_to_insert <- mkReg(defaultValue);
       Reg#(Bit#(TLog#(SIZE))) location_to_insert <- mkReg(0);
       Reg#(Bit#(TLog#(SIZE))) curr_size <- mkReg(0);
   
       Reg#(Bit#(1)) insert_in_progress <- mkReg(0);
   
  -    Vector#(SIZE, FIFO#(void)) create_bit_vector_fifo <- replicateM(mkFIFO);
  -    FIFO#(void) find_correct_location_fifo <- mkPipelineFIFO;
       Vector#(SIZE, FIFO#(void))
           insert_in_correct_location_fifo <- replicateM(mkBypassFIFO);
   
  
positive.code:             $display("(%d %d)", sorted_list[i].v, sorted_list[i].p);
      endmethod
  
      interface Put insert_req = toPut(insert_req_fifo);
      interface Get insert_res = toGet(insert_res_fifo);
  endmodule
  
  
negative.code:         count <= count + 1;
      endrule
  
      rule get_correct_location_rule (insert_in_progress == 1);
          let x <- toGet(priority_encoder.bin).get;
          $display("get from pe %h", x);
          case (x) matches
              tagged Valid .index : insert_in_correct_location_fifo[index].enq(?);
              tagged Invalid: $display("invalid output %h", x);
          endcase
      endrule
  
  