// Amazon FPGA Hardware Development Kit // // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 //************************************************************************************* //------------------------------------------------------------------------------------- // Generic Buffer class. has data array, and methods to read/write to/from host memory, // and compare buffers. //------------------------------------------------------------------------------------- //************************************************************************************* `ifndef __DEFINED_GEN_BUF_T__ `define __DEFINED_GEN_BUF_T__ class gen_buf_t; logic[7:0] data[$]; bit print_ok_compare = 0; //Input size of buffer in bytes -- assume address of all f's is "null" function new (); endfunction //Initialization with incrementing data. Note this assumes empty array (queue), and adds entries to the array virtual function init_inc(input[31:0] first_data, input int length = 4); bit[31:0] tmp_data; tmp_data = first_data; for (int i=0; i= ((i*4)+j)) tmp_dw[j*8+:8] = this.data[i*4 + j]; end $display(" data[0x%4x] = 0x%8x", i*4, tmp_dw); end endfunction endclass `endif