`timescale 1ns / 1ns module feedforward(clk, start, data_out, host_clk, host_we, host_addr, host_data, host_dout, continuous_feedforward); input clk, start; output [7:0] data_out; input host_clk, host_we; input [8:0] host_addr; input [7:0] host_data; output [7:0] host_dout; input continuous_feedforward; reg [10:0] counter; reg run; `ifdef SIMULATE initial counter = 11'b11111110000; initial run=0; `endif RAMB4_S8_S8 feedforward_table( .ENA(1'b1), .DIA(8'b00000000), // not used .ADDRA({counter[10:3], counter[0]}), .WEA(1'b0), // read only port .RSTA(1'b0), .CLKA(clk), .DOA(data_out), // sent to 40 MS/s processing chain .ENB(1'b1), .DIB(host_data), .ADDRB(host_addr), .WEB(host_we), .RSTB(1'b0), .CLKB(host_clk), .DOB(host_dout)); // 11 bit counter that is used to generate the feedforward address. // ignore bits 1 and 2 to generate the address for the 512 element // feedforward table. Host needs to make sure the value at the // first address is zero, since we sit there when the system is idle. always @(posedge clk) begin run <= continuous_feedforward | start | (run & (counter != 11'b11111111111)); counter <= run ? (counter + 1'b1) : {11'b00000000000}; end endmodule