anchor.diff:              let cric = 2'b00;
               if (edge_init != edge_int)
                   begin
  -                let mc = maxcount;
                   retrycounter <= retrycounter - 1;
                   if (maxcount[10] == 1)
                       as = ADelay;
                   else
                       begin
                       cric = 2'b11;
  -                    mc = mc - 1;
                       gc = 14;
  -                    as = AEdge;
  +                    as = ACEdge;
                       end
  -                maxcount <= mc;
  +                maxcount <= maxcount - 1;
                   end
               else
                   gc = gc - 1;
  
positive.code:         serdes_end.deq();
          maxcount <= 31;
          gencounter <= 15;
          astate <= AEdge;
          serdes_start.enq(0);
      endrule
      rule afsmedge_rule if (bvi_resets_reg.read() != 0 && astate == AEdge);
          serdes_end.deq();
          astate <= ACEdge;
      endrule
      rule afsmcedge1_rule if (bvi_resets_reg.read() != 0 && astate == ACEdge
              && retrycounter < 'h8000);
          astate <= AIdle;
      endrule
      rule afsmcedge2_rule if (bvi_resets_reg.read() != 0 && astate == ACEdge
              && retrycounter >= 'h8000);
          let mc = maxcount;
          let cric = 2'b11;
          let as = AEdge;
          retrycounter <= retrycounter - 1;
          if (edge_int != 0)
              begin
  
negative.code:     rule afsmalign_rule if (bvi_resets_reg.read() != 0 && astate == AAlign);
          serdes_end.deq();
          let as = astate;
          if (ctrl_data == training || gencounter >= 'h8000)
              as = AIdle;
          else
              begin
  