Attention
This documentation is a work in progress. Expect to see errors and unfinished things.
serialize Source File
1`timescale 1ns / 1ns
2
3// Encapsulation of the serialization step in LBNL's conveyor belt
4// Instantiated by e.g., serializer_multichannel.v
5module serialize #(
6 parameter dwi=28 // result width
7) (
8 input clk, // timespec 8.4 ns
9 input samp, // Snap signal for data_in
10 input signed [dwi-1:0] data_in,
11 input signed [dwi-1:0] stream_in,
12 output signed [dwi-1:0] stream_out,
13 input gate_in,
14 output gate_out,
15 output strobe_out
16);
17
18reg signed [dwi-1:0] stream_reg=0;
19reg gate_reg=0;
20always @(posedge clk) begin
21 stream_reg <= samp ? data_in : stream_in;
22 gate_reg <= samp ? samp : gate_in;
23end
24assign stream_out = stream_reg;
25assign gate_out = gate_reg;
26assign strobe_out=samp;
27endmodule