anchor.diff:     a xstep;
   } IteratorConfig#(type a) deriving (Bits, FShow);
   
  +interface IteratorWithContext#(type a, type c);
  +   interface PipeOut#(a) pipe;
  +   method Bool isFirst();
  +   method Bool isLast();
  +   method Action start(IteratorConfig#(a) cfg, c ctxt);
  +   method c ctxt();
  +endinterface
  +
   interface IteratorIfc#(type a);
      interface PipeOut#(a) pipe;
      method Bool isFirst();
  
positive.code:    method Action start(IteratorConfig#(a) cfg);
  endinterface
  
  module mkIteratorOut(IteratorIfc#(a)) provisos (Arith#(a), Bits#(a,awidth), Eq#(a), Ord#(a));
     Reg#(a) x <- mkReg(0);
     Reg#(a) xbase <- mkReg(0);
     Reg#(a) xstep <- mkReg(0);
  
negative.code: 
        first <= True;
        last <= (cfg.xbase+cfg.xstep >= cfg.xlimit);
        idle <= False;
        ctxtReg <= ctxt;
        if (True || verbose) $display("mkIteratorOut xbase=%d xstep=%d xlimit=%d last=%d notEmpty=%d", cfg.xbase, cfg.xstep, cfg.xlimit, (cfg.xbase+cfg.xstep >= cfg.xlimit),
  	 (cfg.xbase < cfg.xlimit));
     endmethod
     method Bool isFirst() = first;
     method Bool isLast() = last;
     method c ctxt() = ctxtReg;
  endmodule: mkIteratorWithContext
  
  module mkIteratorOut(IteratorIfc#(a)) provisos (Arith#(a), Bits#(a,awidth), Eq#(a), Ord#(a));
     IteratorWithContext#(a,void) iter <- mkIteratorWithContext();
     interface PipeOut pipe = iter.pipe;
     method Action start(IteratorConfig#(a) cfg);
        iter.start(cfg, ?);
     endmethod
     method isFirst = iter.isFirst;
     method isLast = iter.isLast;
  endmodule
  
  typedef struct {
     a xbase;
  