anchor.diff:  interface ChannelSelect;
      interface PipeIn#(Vector#(2, Complex#(Signal))) rfreq;
      interface PipeOut#(Complex#(Signal)) ifreq;
  -   method Action setCoeff(Bit#(10) addr, Complex#(FixedPoint#(2, 23)) value);
  +   method Action setCoeff(Bit#(11) addr, Bit#(32) valre, Bit#(32) valim);
   endinterface
   
   
  -module mkChannelSelect#(UInt#(10) decimation)(ChannelSelect)
  +module mkChannelSelect#(Bit#(10) decimation, DDS dds)(ChannelSelect)
      provisos(Bits#(CoeffData, a__),
  -	    Bits#(ProductData, b__));
  +	    Bits#(ProductData, b__),
  +	    Bits#(MulData, c__));
      BRAM_Configure cfg = defaultValue;
      cfg.memorySize = 1024;
  -   BRAM2Port#(UInt#(8), Complex#(FixedPoint#(2,23))) coeffRam0 <- 
  +   BRAM2Port#(Bit#(10), Complex#(FixedPoint#(2,23))) coeffRam0 <- 
          mkBRAM2Server(cfg);
  -   BRAM2Port#(UInt#(8), Complex#(FixedPoint#(2,23))) coeffRam1 <- 
  +   BRAM2Port#(Bit#(10), Complex#(FixedPoint#(2,23))) coeffRam1 <- 
          mkBRAM2Server(cfg);
  -   Reg#(UInt#(10)) filterPhase <- mkReg(?);
  +   Reg#(Bit#(10)) filterPhase <- mkReg(?);
      FIFO#(Bit#(1)) delayFilterPhase <- mkSizedFIFO(3);  // length > bram read latency
  -
  -
  -   FIFOF#(Vector#(2, Signal)) infifo <- mkFIFOF();
  -   FIFOF#(Vector#(2, Signal)) outfifo <- mkFIFOF();
  +   FIFOF#(Vector#(2, Complex#(Signal))) infifo <- mkFIFOF();
  +   FIFOF#(Complex#(Signal)) outfifo <- mkFIFOF();
      Vector#(2, FPCMult) mul <- replicateM(mkFPCMult());
   
      Vector#(2, Reg#(Complex#(Product))) accum <- replicateM(mkReg(?));
  
positive.code: 	 end
        else
  	 begin
  	    filterPhase <= phase + 1;
  	    delayFilterPhase.enq(0);
  	 end
        coeffRam0.portB.request.put(BRamRequest{write: False, responseOnWrite: False, address: filterPhase, datain: ?});
        coeffRam1.portB.request.put(BRamRequest{write: False, responseOnWrite: False, address: filterPhase, datain: ?});
     endrule
     
     rule mulin;
        let c0 <- coeffRam0.portB.response.get();
        let c1 <- coeffRam1.portB.response.get();
        let phase <- delayFilterPhase.get();
        
        mul[0].a.enq(CoeffData{a: c0, filterPhase: phase});
        mul[1].a.enq(CoeffData{a: c1, filterPhase: phase});
  
negative.code:    endrule
     
     rule muloutaccumin0;
        let m = mul[0].y.first();
        mul[0].y.deq();
        if (m.filterPhase == 1)
  	 begin
  	    accum[0] <= m.y;
  	    accumout[0].enq(accum[0]);
  