|
7 | 7 |
|
8 | 8 | #define OCM_BASE INTEL_ONCHIP_MEMORY_0_BASE |
9 | 9 |
|
10 | | -#if 0 |
11 | | -// Using usleep as the delay function |
12 | | -int usleep(useconds_t usec); |
13 | | - |
14 | | -// Function to test PIO functionality |
15 | | -int pio_test() |
16 | | -{ |
17 | | - int count = 0; |
18 | | - int i; |
19 | | - int pio_err = 0; |
20 | | - printf("Application to toggle the PIOs- [4:0] \n"); |
21 | | - |
22 | | - while (count < 64) |
23 | | - { |
24 | | - i = count & 0xf; |
25 | | - |
26 | | - // Write data to the PIO register at base address PIO_0_BASE |
27 | | - IOWR_ALTERA_AVALON_PIO_DATA(PIO_0_BASE, count & 0xf); |
28 | | - |
29 | | - // Introduce a short delay |
30 | | - usleep(100); |
31 | | - |
32 | | - // Read back data from the PIO register |
33 | | - printf("DATA READBACK FROM PIO_0_BASE is 0x%x \n", IORD_ALTERA_AVALON_PIO_DATA(PIO_0_BASE)); |
34 | | - |
35 | | - // Verify if the written data matches the read data |
36 | | - if (i != IORD_ALTERA_AVALON_PIO_DATA(PIO_0_BASE)) |
37 | | - { |
38 | | - printf("Data MISMATCH - TEST FAILED \n"); |
39 | | - pio_err = pio_err + 1; |
40 | | - } |
41 | | - else |
42 | | - { |
43 | | - printf("DATA MATCHED - TEST PASSED \n"); |
44 | | - } |
45 | | - count++; |
46 | | - } |
47 | | - return pio_err; |
48 | | -} |
49 | | -#endif |
50 | | - |
51 | 10 | int main() |
52 | 11 | { |
53 | 12 | int p; |
@@ -88,23 +47,6 @@ int main() |
88 | 47 |
|
89 | 48 | printf("Memory Test Complete \n"); |
90 | 49 |
|
91 | | -#if 0 |
92 | | - int pio_fail_flag; |
93 | | - |
94 | | - // Run the PIO test function |
95 | | - pio_fail_flag = pio_test(); |
96 | | - |
97 | | - // Check the result of the PIO test |
98 | | - if (pio_fail_flag != 0) |
99 | | - { |
100 | | - printf("NIOSV-PIO Test failed with PIO_ERR = %d\n", pio_fail_flag); |
101 | | - } |
102 | | - else |
103 | | - { |
104 | | - printf("NIOSV-PIO Test PASSED \n"); |
105 | | - } |
106 | | -#endif |
107 | | - |
108 | 50 | // Read and print the System ID from the peripheral core |
109 | 51 | printf("Print the value of System ID \n"); |
110 | 52 | sys_id = IORD_ALTERA_AVALON_SYSID_QSYS_ID(SYSID_QSYS_0_BASE); // Read System ID from the Qsys system ID peripheral |
|
0 commit comments