spips: Added polled, interrupt tests in peripheral tests.

This patch changes testapp tcl file to add polled and
interrupt tests in peripheral tests.

Signed-off-by: P L Sai Krishna <lakshmis@xilinx.com>
Reviewed-by: Punnaiah Choudary Kalluri <punnaia@xilinx.com>
This commit is contained in:
P L Sai Krishna 2015-08-17 19:23:00 +05:30 committed by Nava kishore Manne
parent a1f6e45ede
commit d81bd4063a
2 changed files with 74 additions and 2 deletions

View file

@ -37,4 +37,7 @@
#include "xstatus.h"
int SpiPsSelfTestExample(u16 DeviceId);
int SpiPsFlashPolledExample(XSpiPs *SpiInstancePtr, u16 SpiDeviceId);
int SpiPsFlashIntrExample(XScuGic *IntcInstancePtr, XSpiPs *SpiInstancePtr,
u16 SpiDeviceId, u16 SpiIntrId);
#endif

View file

@ -63,7 +63,7 @@ proc gen_src_files {swproj mhsinst} {
}
if {$swproj == 1} {
set inc_file_lines {examples/xspips_selftest_example.c data/spips_header.h}
set inc_file_lines {examples/xspips_selftest_example.c examples/xspips_flash_intr_example.c examples/xspips_flash_polled_example.c data/spips_header.h}
return $inc_file_lines
}
@ -79,7 +79,10 @@ proc gen_init_code {swproj mhsinst} {
return ""
}
if {$swproj == 1} {
return ""
set ipname [common::get_property NAME $mhsinst]
set decl " static XSpiPs ${ipname};"
set inc_file_lines $decl
return $inc_file_lines
}
}
@ -99,6 +102,9 @@ proc gen_testfunc_call {swproj mhsinst} {
set hasStdout 1
}
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set intcvar intc
set testfunc_call ""
if {${hasStdout} == 0} {
@ -111,6 +117,28 @@ proc gen_testfunc_call {swproj mhsinst} {
Status = SpiPsSelfTestExample(${deviceid});
}"
append testfunc_call "
{
int Status;
Status = SpiPsFlashPolledExample(&${ipname}, ${deviceid});
}"
if {$isintr == 1} {
set intr_id "XPAR_${ipname}_INTR"
set intr_id [string toupper $intr_id]
append testfunc_call "
{
int Status;
Status = SpiPsFlashIntrExample(&${intcvar}, &${ipname}, \\
${deviceid}, \\
${intr_id});
}"
}
} else {
@ -132,6 +160,47 @@ proc gen_testfunc_call {swproj mhsinst} {
}
}"
append testfunc_call "
{
int Status;
print(\"\\r\\n Running SPIPsPolledExample() for ${ipname}...\\r\\n\");
Status = SpiPsFlashPolledExample(&${ipname}, ${deviceid});
if (Status == 0) {
print(\"SPIPsPolledExample PASSED\\r\\n\");
}
else {
print(\"SPIPsPolledExample FAILED\\r\\n\");
}
}"
if {$isintr ==1 } {
set intr_id "XPAR_${ipname}_INTR"
set intr_id [string toupper $intr_id]
append testfunc_call "
{
int Status;
print(\"\\r\\n Running Interrupt Test for ${ipname}...\\r\\n\");
Status = SpiPsFlashIntrExample(&${intcvar}, &${ipname}, \\
${deviceid}, \\
${intr_id});
if (Status == 0) {
print(\"SPIPsIntrExample PASSED\\r\\n\");
}
else {
print(\"SPIPsIntrExample FAILED\\r\\n\");
}
}"
}
}
return $testfunc_call