anchor.diff:  
         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;
  -endmodule: mkIteratorOut
  +   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;
  
positive.code:    Reg#(a) xlimit <- mkReg(0);
     Reg#(Bool) first <- mkReg(False);
     Reg#(Bool) last <- mkReg(False);
     Bool verbose = False;
     interface PipeOut pipe;
        method a first();
  	 return x;
        endmethod
        method Action deq if (x < xlimit);
  	 let next_x = x + xstep;
  	 x <= x + xstep;
  	 first <= False;
  	 last <= (next_x+xstep >= xlimit);
        endmethod
        method Bool notEmpty();
  	 return (x < xlimit);
        endmethod
     endinterface
     method Action start(IteratorConfig#(a) cfg) if (x >= xlimit);
        x <= cfg.xbase;
        xbase <= cfg.xbase;
        xstep <= cfg.xstep;
  
negative.code:    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();
  