anchor.diff:     mkConnection(toGet(host.next), toPut(meta_in_ff));
   
      rule rl_freq_ctrl if (bstart && meta_in_ff.notEmpty);
  -      if (freq_cnt < rg_freq) begin
  +      if (freq_cnt < rg_gap) begin
            freq_cnt <= freq_cnt + 1;
         end
         else begin
  +         freq_cnt <= 0;
            w_send_meta.send();
         end
      endrule
  
positive.code: 
     // frequency N means send a metadata once every n cycles
     method Action start(Bit#(32) iter, Bit#(32) freq);
        $display("(%0d) metagen start %d", $time, iter);
        rg_iter <= iter;
        rg_freq <= freq;
        bstart <= True;
     endmethod
     method Action stop();
        $display("(%0d) metagen stop", $time);
        rg_iter <= 0;
        rg_freq <= 1;
        freq_cnt <= 0;
        bstart <= False;
     endmethod
  
negative.code: 
  module mkMetaGenChannel#(Integer id)(MetaGenChannel);
     `PRINT_DEBUG_MSG
     StreamInChannel host <- mkStreamInChannel(id);
     Reg#(Bit#(32)) rg_iter <- mkReg(0);
     Reg#(Bit#(32)) rg_gap <- mkReg(1);
     Reg#(Bit#(32)) freq_cnt <- mkReg(0);
     Reg#(Bool) bstart <- mkReg(False);
     PulseWire w_send_meta <- mkPulseWire;
  