.. _banyan_mem_source: banyan_mem Source File ====================== .. code-block:: verilog :linenos: `timescale 1ns / 1ns // Single-buffered capture of raw ADC data // Hard-code number of ADCs at 8, at least for now module banyan_mem #( parameter aw=10, parameter dw=16 ) ( input clk, // timespec 6.1 ns input [8*dw-1:0] adc_data, input [7:0] banyan_mask, // must be valid in clk domain // API in clk domain for controlling acquisition // See additional comments below input reset, // resets pointer and full input run, // set to enable writes to memory; Modulate to take valid adc_data (See TB) output [aw+3-1:0] pointer, // write location output rollover, output full, // Note that writes are pipelined, and after clearing the run // bit, about four more clk cycles are required before the last // data actually shows up in RAM and can be read out. // The output status (full, pointer) are all immediately but // provisionally valid, pending completion of the pipelined writes. // Peek into the data stream between switch and memory. // Valid in clk domain. output [8*dw-1:0] permuted_data, // readout port, separate clock domain // recommend only using this when run is low input ro_clk, input [aw+3-1:0] ro_addr, output [dw-1:0] ro_data, output [dw-1:0] ro_data2 // ro_data2 is based on ro_addr xored with 1<