canps : added common namespace to all common tcl commands.

Signed-off-by: Nava kishore Manne <navam@xilinx.com>
This commit is contained in:
Nava kishore Manne 2015-04-09 18:00:09 +05:30
parent fb48c9dd0b
commit 92c6b0e7b5

View file

@ -50,16 +50,16 @@
# ----------------------------------------------------------------- # -----------------------------------------------------------------
proc gen_include_files {swproj mhsinst} { proc gen_include_files {swproj mhsinst} {
if {$swproj == 0} { if {$swproj == 0} {
return "" return ""
} }
if {$swproj == 1} { if {$swproj == 1} {
set inc_file_lines {xcanps.h canps_header.h} set inc_file_lines {xcanps.h canps_header.h}
} }
return $inc_file_lines return $inc_file_lines
} }
proc gen_src_files {swproj mhsinst} { proc gen_src_files {swproj mhsinst} {
if {$swproj == 0} { if {$swproj == 0} {
return "" return ""
@ -80,30 +80,30 @@ proc gen_testfunc_def {swproj mhsinst} {
} }
proc gen_init_code {swproj mhsinst} { proc gen_init_code {swproj mhsinst} {
if {$swproj == 0} { if {$swproj == 0} {
return "" return ""
} }
if {$swproj == 1} { if {$swproj == 1} {
set ipname [get_property NAME $mhsinst] set ipname [common::get_property NAME $mhsinst]
set decl " static XCanPs ${ipname};" set decl " static XCanPs ${ipname};"
set inc_file_lines $decl set inc_file_lines $decl
return $inc_file_lines return $inc_file_lines
} }
} }
proc gen_testfunc_call {swproj mhsinst} { proc gen_testfunc_call {swproj mhsinst} {
if {$swproj == 0} { if {$swproj == 0} {
return "" return ""
} }
set ipname [get_property NAME $mhsinst] set ipname [common::get_property NAME $mhsinst]
set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"] set deviceid [::hsm::utils::get_ip_param_name $mhsinst "DEVICE_ID"]
set stdout [get_property CONFIG.STDOUT [get_os]] set stdout [common::get_property CONFIG.STDOUT [hsi::get_os]]
if { $stdout == "" || $stdout == "none" } { if { $stdout == "" || $stdout == "none" } {
set hasStdout 0 set hasStdout 0
} else { } else {
@ -111,7 +111,7 @@ proc gen_testfunc_call {swproj mhsinst} {
} }
set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst] set isintr [::hsm::utils::is_ip_interrupting_current_proc $mhsinst]
set intcvar intc set intcvar intc
set testfunc_call "" set testfunc_call ""
if {${hasStdout} == 0} { if {${hasStdout} == 0} {
@ -120,23 +120,23 @@ proc gen_testfunc_call {swproj mhsinst} {
{ {
int Status; int Status;
Status = CanPsPolledExample(${deviceid}); Status = CanPsPolledExample(${deviceid});
}" }"
if {$isintr == 1} { if {$isintr == 1} {
set intr_id "XPAR_${ipname}_INTR" set intr_id "XPAR_${ipname}_INTR"
set intr_id [string toupper $intr_id] set intr_id [string toupper $intr_id]
append testfunc_call " append testfunc_call "
{ {
int Status; int Status;
Status = CanPsIntrExample(&${intcvar}, &${ipname}, \\ Status = CanPsIntrExample(&${intcvar}, &${ipname}, \\
${deviceid}, \\ ${deviceid}, \\
${intr_id}); ${intr_id});
}" }"
} }
@ -147,11 +147,11 @@ proc gen_testfunc_call {swproj mhsinst} {
{ {
int Status; int Status;
print(\"\\r\\n Running CanPsPolledExample() for ${ipname}...\\r\\n\"); print(\"\\r\\n Running CanPsPolledExample() for ${ipname}...\\r\\n\");
Status = CanPsPolledExample(${deviceid}); Status = CanPsPolledExample(${deviceid});
if (Status == 0) { if (Status == 0) {
print(\"CanPsPolledExample PASSED\\r\\n\"); print(\"CanPsPolledExample PASSED\\r\\n\");
} }
@ -163,30 +163,29 @@ proc gen_testfunc_call {swproj mhsinst} {
if {$isintr ==1 } { if {$isintr ==1 } {
set intr_id "XPAR_${ipname}_INTR" set intr_id "XPAR_${ipname}_INTR"
set intr_id [string toupper $intr_id] set intr_id [string toupper $intr_id]
append testfunc_call " append testfunc_call "
{ {
int Status; int Status;
print(\"\\r\\n Running Interrupt Test for ${ipname}...\\r\\n\"); print(\"\\r\\n Running Interrupt Test for ${ipname}...\\r\\n\");
Status = CanPsIntrExample(&${intcvar}, &${ipname}, \\ Status = CanPsIntrExample(&${intcvar}, &${ipname}, \\
${deviceid}, \\ ${deviceid}, \\
${intr_id}); ${intr_id});
if (Status == 0) { if (Status == 0) {
print(\"CanPsIntrExample PASSED\\r\\n\"); print(\"CanPsIntrExample PASSED\\r\\n\");
} }
else { else {
print(\"CanPsIntrExample FAILED\\r\\n\"); print(\"CanPsIntrExample FAILED\\r\\n\");
} }
}" }"
} }
} }
return $testfunc_call return $testfunc_call
} }