anchor.diff:      endrule
   
       rule update_debug;
  +        //let startframe_wire     = pack(raw_data_delay_reg[9:0] == host.decoder.code_fs() && raw_data_reg[9:0] == 10'h0);
           let dval = diff;
  -        //dval = {diff[29:0], framestart_reg, fs2};
  +        dval = {dcount, diff[21:0], sframe_wire, sframe_new_wire};
  +        if (sframe_wire != sframe_new_wire)
  +            begin
  +            dcount <= dcount + 1;
  +            end
           if (diff[17] == 1)
               begin
               debugind_value <= diff;
  
positive.code:                 end
          imgdatavalid_reg <= idv;
          dataout_reg <= dor;
      endrule
  
      interface ImageonSensorControl in;
  
negative.code:     Reset defaultReset <- exposeCurrentReset();
  
      Reg#(TState)   tstate <- mkReg(TIdle);
      Reg#(Bit#(1)) sframe_wire <- mkReg(0);
      Reg#(Bit#(1)) sframe_new_wire <- mkReg(0);
      Reg#(Bit#(1))  fs2 <- mkReg(0);
      Reg#(Bit#(16)) frame_delay <- mkReg(0);
      Reg#(Bit#(1))  frame_run <- mkReg(0);
  