// Amazon FPGA Hardware Development Kit // // Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Amazon Software License (the "License"). You may not use // this file except in compliance with the License. A copy of the License is // located at // // http://aws.amazon.com/asl/ // // or in the "license" file accompanying this file. This file is distributed on // an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or // implied. See the License for the specific language governing permissions and // limitations under the License. //************************************************************************************* //------------------------------------------------------------------------------------- // 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