1 |
103 |
mihad |
// definition of maximum test application command length
|
2 |
|
|
#define MAX_COMMAND_LEN 100
|
3 |
|
|
#define MAX_DESCRIPTION_LEN 1000
|
4 |
|
|
#define NUM_OF_COMMANDS 15
|
5 |
|
|
|
6 |
|
|
char GSA_COMMANDS [NUM_OF_COMMANDS][MAX_COMMAND_LEN] = {
|
7 |
|
|
"help",
|
8 |
|
|
"quit",
|
9 |
|
|
"set_pci_region",
|
10 |
|
|
"write",
|
11 |
|
|
"read",
|
12 |
|
|
"target_write",
|
13 |
|
|
"dump",
|
14 |
|
|
"master_read",
|
15 |
|
|
"master_buf_fill",
|
16 |
|
|
"master_write",
|
17 |
|
|
"master_chk_write",
|
18 |
|
|
"target_chk_write",
|
19 |
|
|
"target_programmed_tests",
|
20 |
|
|
"set_wb_region",
|
21 |
|
|
"master_programmed_tests"
|
22 |
|
|
} ;
|
23 |
|
|
|
24 |
|
|
char GSA_COMMAND_DESCRIPTIONS [NUM_OF_COMMANDS][MAX_DESCRIPTION_LEN] = {
|
25 |
|
|
"Displays basic command and parameter reference.",
|
26 |
|
|
"Exits the program.",
|
27 |
|
|
"Selects one of 6 bridge pci address regions <region> for subsequent accesses.",
|
28 |
|
|
"Writes 32 bit word <value> to specified offset <offset> and performs read-back.",
|
29 |
|
|
"Reads data from the specified offset <offset>.",
|
30 |
|
|
"Initiates <number of transactions> write transactions with <transaction size> size. It starts from specified offset<offset>. <pattern> selects the pattern to write to on-board buffer.",
|
31 |
|
|
"Reads 32 words from specified offset<offset>.",
|
32 |
|
|
"Configures master to read data from the system memory buffer. Reads start at specified offset <offset>, using <number of transactions> read operations of size <transaction size>.",
|
33 |
|
|
"Fills system buffer with the specified pattern <pattern>.",
|
34 |
|
|
"Writes contents of device's RAM on specified offset to system memory. Writes start at specified offset <offset>, using <number of transactions> write operations of size <transaction size>.",
|
35 |
|
|
"Checks <size> words of data in system memory from offset <offset> against a specified pattern <pattern>.",
|
36 |
|
|
"Checks data in onboard buffer from offset <offset> against a specified pattern. Buffer is read with <number of transactions> transactions of size <transaction size>.",
|
37 |
|
|
"Performs arround 2M read/write transactions through target. Writes write pseudo random data, reads check the data.",
|
38 |
|
|
"Enables WISHBONE image <image[1:5]> for subsequent PCI Master accesses. The command doesn't check for implemented WB images!",
|
39 |
|
|
"Executes the master test program code written in the function in the pci_bridge32_test.c file!"
|
40 |
|
|
} ;
|
41 |
|
|
|
42 |
|
|
char GSA_PARAMETERS [NUM_OF_COMMANDS][MAX_COMMAND_LEN] = {
|
43 |
|
|
"",
|
44 |
|
|
"",
|
45 |
|
|
"<region[0:5]>",
|
46 |
|
|
"<offset> <value>",
|
47 |
|
|
"<offset>",
|
48 |
|
|
"<starting offset> <number of transactions> <transaction size> <pattern>",
|
49 |
|
|
"<offset>",
|
50 |
|
|
"<offset> <number of transactions> <transaction size>",
|
51 |
|
|
"<pattern>",
|
52 |
|
|
"<offset> <number of transactions> <transaction size>",
|
53 |
|
|
"<offset> <size> <pattern>",
|
54 |
|
|
"<offset> <number of transactions> <transaction size> <pattern>",
|
55 |
|
|
"",
|
56 |
|
|
"<image[1:5]>",
|
57 |
|
|
""
|
58 |
|
|
} ;
|
59 |
|
|
|
60 |
|
|
#define GET_CMD(i) (GSA_COMMANDS[i])
|
61 |
|
|
#define GET_CMD_DES(i) (GSA_COMMAND_DESCRIPTIONS[i])
|
62 |
|
|
#define GET_CMD_PARMS(i) (GSA_PARAMETERS[i])
|
63 |
|
|
|
64 |
|
|
#define SYS_BUFFER_SIZE (4096)
|
65 |
|
|
#define SPARTAN_BOARD_BUFFER_SIZE (1024)
|
66 |
|
|
|
67 |
|
|
#define TARGET_BUFFER_SIZE (1024)
|
68 |
|
|
|
69 |
|
|
#define MASTER_TRANS_SIZE_OFFSET (0x1000)
|
70 |
|
|
#define MASTER_TRANS_COUNT_OFFSET (0x1004)
|
71 |
|
|
#define MASTER_OP_CODE_OFFSET (0x1008)
|
72 |
|
|
#define MASTER_ADDR_REG_OFFSET (0x100c)
|
73 |
|
|
#define TARGET_BURST_TRANS_CNT_OFFSET (0x1010)
|
74 |
|
|
#define TARGET_TEST_SIZE_OFFSET (0x1014)
|
75 |
|
|
#define TARGET_TEST_START_ADR_OFFSET (0x1018)
|
76 |
|
|
#define TARGET_TEST_START_DATA_OFFSET (0x101C)
|
77 |
|
|
#define TARGET_TEST_ERR_REP_OFFSET (0x1020)
|
78 |
|
|
#define MASTER_NUM_OF_WB_OFFSET (0x1024)
|
79 |
|
|
#define MASTER_NUM_OF_PCI_OFFSET (0x1028)
|
80 |
|
|
#define MASTER_TEST_SIZE_OFFSET (0x102C)
|
81 |
|
|
#define MASTER_TEST_START_DATA_OFFSET (0x1030)
|
82 |
|
|
#define MASTER_TEST_DATA_ERROR_OFFSET (0x1034)
|