anchor.diff:      Reg#(Bit#(11)) lineMidpoint <- mkSyncReg((1080/2) + 41, axi_clock, axi_reset, defaultClock);
       Reg#(Bit#(11)) numberOfLines <- mkSyncReg(1080 + 45, axi_clock, axi_reset, defaultClock);
       Reg#(Bit#(12)) numberOfPixels <- mkSyncReg(1920 + 192 + 44 + 44, axi_clock, axi_reset, defaultClock);
  -    Reg#(Bit#(11)) lineCount <- mkReg(0);
  -    Reg#(Bit#(12)) pixelCount <- mkReg(0);
       Vector#(4, Reg#(Bit#(24))) patternRegs <- replicateM(mkSyncReg(24'h00FFFFFF, axi_clock, axi_reset, defaultClock));
  -    Reg#(Bit#(1)) patternIndex0 <- mkReg(0);
  -    Reg#(Bit#(1)) patternIndex1 <- mkReg(0);
       Reg#(Bit#(1)) shadowTestPatternEnabled <- mkSyncReg(1, axi_clock, axi_reset, defaultClock);
  -    Reg#(Bit#(1)) testPatternEnabled <- mkReg(1);
       Reg#(Bool) waitingForVsync <- mkSyncReg(False, axi_clock, axi_reset, defaultClock);
       SyncPulseIfc vsyncCountPulse <- mkSyncHandshake(defaultClock, defaultReset, axi_clock);
       SyncPulseIfc sendVsyncIndication <- mkSyncHandshake(defaultClock, defaultReset, axi_clock);
  +
  +    Reg#(Bit#(11)) lineCount <- mkReg(0);
  +    Reg#(Bit#(12)) pixelCount <- mkReg(0);
  +    Reg#(Bit#(1)) patternIndex0 <- mkReg(0);
  +    Reg#(Bit#(1)) patternIndex1 <- mkReg(0);
  +    Reg#(Bit#(1)) testPatternEnabled <- mkReg(1);
       Reg#(Bit#(24)) pixelData <- mkReg(24'hFF00FF);
  -    FIFOF#(Bit#(24)) pixelFifo <- mkLFIFOF();
   
       Reg#(VideoData#(Rgb888)) rgb888StageReg <- mkReg(unpack(0));
       Reg#(Bool) evenOddPixelReg <- mkReg(False);
  
positive.code:     Reg#(Bit#(32)) vsyncCounter <- mkReg(0, clocked_by axi_clock, reset_by axi_reset);
      Reg#(Bit#(32)) elapsed <- mkReg(0, clocked_by axi_clock, reset_by axi_reset);
      Reg#(Bit#(32)) elapsedVsync <- mkReg(0, clocked_by axi_clock, reset_by axi_reset);
      rule axicyclecount;
         counter <= counter + 1;
      endrule
  
negative.code:         end
      endrule
  
      let isActiveLine = (lineCount >= deLineCountMinimum && lineCount < deLineCountMaximum);
      let dataEnable = (pixelCount >= dePixelCountMinimum && pixelCount < dePixelCountMaximum && isActiveLine);
      rule output_data_rule;
          rgb888StageReg <= VideoData {de: pack(dataEnable),
  	     vsync: pack(lineCount < vsyncWidth), hsync: pack(pixelCount < hsyncWidth), pixel: unpack(pixelData) };
      endrule
  
      rule testpattern_rule if (testPatternEnabled != 0);
  