43 input hclk,
// global clock to run axi_hp @ 150MHz, shared by all compressor channels 44 // Write dual port 4x27 channel length RAM (shadows 1/2 of the similar RAM for main pointers) 45 input [
26:
0]
length_di,
// data to write per-channle buffer length in chunks 46 input [
1:
0]
length_wa,
// channel address to write lengths 49 input en,
// 0 - resets, 0->1 resets all pointers. While reset allows write response 52 input [
2:
0]
chunk_ptr_ra,
// chunk pointer read address {eof, chn[1:0]} 53 output [
26:
0]
chunk_ptr_rd,
// chunk pointer read data (non-registered 55 output reg [
3:
0]
eof_written,
// per-channel end of frame confirmed written to system memory by write response 57 // AFI write response channels 60 input [
5:
0]
afi_bid // encodes channel, eof, and burst size minus 1 in chunks (0..3) 63 reg [
3:
0]
reset_rq;
// request to reset pointers when ready 67 reg [
1:
0]
resetting;
// resetting chunk_pointer and eof_pointer 68 wire [
2:
0]
ptr_wa;
// pointer memory write port address, msb - eof/current, 2 LSB - channel 69 reg ptr_we;
// pointer memory write enable 70 reg [
26:
0]
ptr_ram[
0:
7];
// pointer (current and eof) memory (in 32-byte chunks 72 reg [
26:
0]
len_ram[
0:
3];
// start chunk/num cunks in a buffer (write port @mclk) 74 reg [
27:
0]
chunk_ptr_rovr;
// incremented chunk pointer, decremented by length (MSB - sign) 75 reg [
4:
0]
busy;
// one-hot busy stages (usually end with [4] 77 reg [
4:
0]
id_r;
// registered ID data - MSB is unused 78 reg [
1:
0]
chn;
// selected channel valid @busy[2] 79 reg eof;
// eof register being written 86 reg en_d;
//enable delayed by 1 cycle 95 assign pre_we=
resetting[
0] ||
// a pair of cycles to reset chunk pointer and frame chunk pointer 96 busy[
3] ||
// always update chunk pointer 112 // if (afi_bready && afi_bvalid) id_r <= afi_bid[4:0]; // id_r[5] is never used - revoved 129 if (
busy[
1])
begin // first busy cycle 137 else if (
ptr_we)
eof <=
1;
// always second write cycle 142 // write to ptr_ram (1 or 2 locations - if eof) 145 // Watch write response channel, detect EOF IDs, generate eof_written* output signals 329last_burst_in_framereg
[0:7] 320ptr_ramreg[26:0]
reg [ 3:0] 309eof_written
323chunk_ptr_increg[26:0]
[0:3] 322len_ramreg[26:0]
324chunk_ptr_rovrreg[27:0]