anchor.diff:          else
               begin
               gc = gc - 1;
  -            serdes_start.enq({autoalign, 1'b1});
  +            serdes_start.enq(autoalign);
               end
           gencounter <= gc;
       endrule
  
positive.code:     //*************************** serdes setting FSM *****************
      rule serdes_idle_rule if (bvi_reset_reg != 0 && serdes_running == 0);
          serdes_start.deq();
          sync_reset_inc_ce <= {serdes_start.first[1], (serdes_start.first[1] | astate_found.read())};
          sync_bitslip <= astate_bitslip.read();
          serdes_running <= 1;
          dcounter <= 3;
      endrule
  
      rule serdes_running1_rule if (bvi_reset_reg != 0 && serdes_running == 1
              && dcounter[2] != 1);
          dcounter <= dcounter - 1;
          sync_reset_inc_ce <= 0;
          sync_bitslip <= 0;
      endrule
      rule serdes_running2_rule if (bvi_reset_reg != 0 && serdes_running == 1
              && dcounter[2] == 1);
          ctrl_data <= ctrl_data_temp;
          Bit#(10) edgeo = 0;
          for (Integer i = 0; i < 9; i = i + 1)
              edgeo[i] = ctrl_data_temp[i] ^ ctrl_data_temp[i+1];
          edgeo[9] = ctrl_data_temp[0] ^ ctrl_data_temp[9];
          edge_int <= edgeo;
          serdes_end.enq(1);
          serdes_running <= 0;
  
negative.code: 
  typedef enum { QIdle, QTrain, QOff} QState deriving (Bits,Eq);
  typedef enum { AIdle, AReset, AEdge, AWait, AShift,
       ARotated, AFirst, ASecond, AFound, AAlign} AState deriving (Bits,Eq);
  
  module mkIserdesDatadeser#(Clock serdes_clock, Reset serdes_reset, Clock serdest, Bit#(1) align_start,
      Bit#(1) autoalign, Bit#(10) training, Bit#(10) manual_tap, TrainRotate trainrot)(IserdesDatadeser);
  