Line 25... |
Line 25... |
//// PURPOSE. See the GNU Lesser General Public License for more////
|
//// PURPOSE. See the GNU Lesser General Public License for more////
|
//// details. http://www.gnu.org/licenses/lgpl.html ////
|
//// details. http://www.gnu.org/licenses/lgpl.html ////
|
//// ////
|
//// ////
|
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
|
|
OUTFILE PREFIX.v
|
|
|
|
INCLUDE def_axi_master.txt
|
|
|
|
|
|
//////////////////////////////////////
|
//////////////////////////////////////
|
//
|
//
|
// General:
|
// General:
|
// The AXI master has an internal master per ID.
|
// The AXI master has an internal master per ID.
|
// These internal masters work simultaniously and an interconnect matrix connets them.
|
// These internal masters work simultaniously and an interconnect matrix connets them.
|
Line 63... |
Line 58... |
// Description: read a single AXI burst (1 data cycle)
|
// Description: read a single AXI burst (1 data cycle)
|
// Parameters: master_num - number of internal master
|
// Parameters: master_num - number of internal master
|
// addr - address
|
// addr - address
|
// rdata - return read data
|
// rdata - return read data
|
//
|
//
|
|
// check_single(input master_num, input addr, input expected)
|
|
// Description: read a single AXI burst and gives an error if the data read does not match expected
|
|
// Parameters: master_num - number of internal master
|
|
// addr - address
|
|
// expected - expected read data
|
|
//
|
|
// write_and_check_single(input master_num, input addr, input data)
|
|
// Description: write a single AXI burst read it back and compare the write and read data
|
|
// Parameters: master_num - number of internal master
|
|
// addr - address
|
|
// data - data to write and expect on read
|
|
//
|
// insert_wr_cmd(input master_num, input addr, input len, input size)
|
// insert_wr_cmd(input master_num, input addr, input len, input size)
|
// Description: add an AXI write burst to command FIFO
|
// Description: add an AXI write burst to command FIFO
|
// Parameters: master_num - number of internal master
|
// Parameters: master_num - number of internal master
|
// addr - address
|
// addr - address
|
// len - AXI LEN (data strobe number)
|
// len - AXI LEN (data strobe number)
|
Line 99... |
Line 106... |
|
|
//
|
//
|
// Parameters:
|
// Parameters:
|
//
|
//
|
// For random testing: (changing these values automatically update interanl masters)
|
// For random testing: (changing these values automatically update interanl masters)
|
// len_min - minimum burst LEN (length)
|
// len_min - minimum burst AXI LEN (length)
|
// len_max - maximum burst LEN (length)
|
// len_max - maximum burst AXI LEN (length)
|
// size_min - minimum burst SIZE (length)
|
// size_min - minimum burst AXI SIZE (width)
|
// size_max - maximum burst SIZE (length)
|
// size_max - maximum burst AXI SIZE (width)
|
// addr_min - minimum address (in bytes)
|
// addr_min - minimum address (in bytes)
|
// addr_max - maximum address (in bytes)
|
// addr_max - maximum address (in bytes)
|
//
|
//
|
//////////////////////////////////////
|
//////////////////////////////////////
|
|
|
|
OUTFILE PREFIX.v
|
|
|
|
INCLUDE def_axi_master.txt
|
|
|
|
|
ITER IX ID_NUM
|
ITER IX ID_NUM
|
module PREFIX(PORTS);
|
module PREFIX(PORTS);
|
|
|
input clk;
|
input clk;
|
Line 231... |
Line 242... |
IX : PREFIX_singleIX.read_single(addr, rdata);
|
IX : PREFIX_singleIX.read_single(addr, rdata);
|
endcase
|
endcase
|
end
|
end
|
endtask
|
endtask
|
|
|
|
task check_single;
|
|
input [31:0] master_num;
|
|
input [ADDR_BITS-1:0] addr;
|
|
input [DATA_BITS-1:0] expected;
|
|
begin
|
|
check_master_num("check_single", master_num);
|
|
case (master_num)
|
|
IX : PREFIX_singleIX.check_single(addr, expected);
|
|
endcase
|
|
end
|
|
endtask
|
|
|
|
task write_and_check_single;
|
|
input [31:0] master_num;
|
|
input [ADDR_BITS-1:0] addr;
|
|
input [DATA_BITS-1:0] data;
|
|
begin
|
|
check_master_num("write_and_check_single", master_num);
|
|
case (master_num)
|
|
IX : PREFIX_singleIX.write_and_check_single(addr, data);
|
|
endcase
|
|
end
|
|
endtask
|
|
|
task insert_wr_cmd;
|
task insert_wr_cmd;
|
input [31:0] master_num;
|
input [31:0] master_num;
|
input [ADDR_BITS-1:0] addr;
|
input [ADDR_BITS-1:0] addr;
|
input [LEN_BITS-1:0] len;
|
input [LEN_BITS-1:0] len;
|
input [SIZE_BITS-1:0] size;
|
input [SIZE_BITS-1:0] size;
|