From d5f121a39c2443b1c462508147af179776dfbce9 Mon Sep 17 00:00:00 2001 From: Nava kishore Manne Date: Thu, 9 Apr 2015 10:57:10 +0530 Subject: [PATCH] hwicap: added namespace for all HSI TCL commands. Signed-off-by: Nava kishore Manne --- .../drivers/hwicap/data/hwicap.tcl | 31 ++++++++++++++++++- .../drivers/hwicap/data/hwicap_tapp.tcl | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/hwicap/data/hwicap.tcl b/XilinxProcessorIPLib/drivers/hwicap/data/hwicap.tcl index b8ba96fb..135d23e0 100755 --- a/XilinxProcessorIPLib/drivers/hwicap/data/hwicap.tcl +++ b/XilinxProcessorIPLib/drivers/hwicap/data/hwicap.tcl @@ -42,7 +42,36 @@ #-------------------------------- proc generate {drv_handle} { - + + # This returns the C_FAMILY parameter from the processor. + # MicroBlaze has C_FAMILY defined, but PowerPC does not. + set sw_proc_handle [get_sw_processor] + set prochandle [get_cells [get_property HW_INSTANCE $sw_proc_handle] ] + set proctype [string tolower [get_property SPECIAL $prochandle]] + set family [string tolower [get_property CONFIG.C_FAMILY $prochandle]] + + # Create a definition in a header file + set filename "./src/xhwicap_family.h" + set filehandle [ open $filename a ] + ::hsm::utils::write_c_header $filehandle "Device family" + if {[string compare $family "kintex7"] == 0} { + puts $filehandle "#define XHI_FPGA_FAMILY 7\n" + } elseif {[string compare $family "virtex7"] == 0} { + puts $filehandle "#define XHI_FPGA_FAMILY 8\n" + } elseif {[string compare $family "artix7"] == 0} { + puts $filehandle "#define XHI_FPGA_FAMILY 9\n" + } elseif {[string compare $family "zynq"] == 0} { + puts $filehandle "#define XHI_FPGA_FAMILY 10\n" + } elseif {[string compare $family "kintex8"] == 0} { + puts $filehandle "#define XHI_FPGA_FAMILY 11\n" + } elseif {[string compare $family "kintexu"] == 0} { + puts $filehandle "#define XHI_FPGA_FAMILY 11\n" + } else { + puts $filehandle "#define XHI_FPGA_FAMILY 1\n" + } + close $filehandle + + # Generate #defines in xparameters.h xdefine_include_file $drv_handle "xparameters.h" "XHwIcap" "NUM_INSTANCES" "C_BASEADDR" "C_HIGHADDR" "DEVICE_ID" "C_ICAP_DWIDTH" "C_MODE" diff --git a/XilinxProcessorIPLib/drivers/hwicap/data/hwicap_tapp.tcl b/XilinxProcessorIPLib/drivers/hwicap/data/hwicap_tapp.tcl index 2d77e8cc..ce338a34 100755 --- a/XilinxProcessorIPLib/drivers/hwicap/data/hwicap_tapp.tcl +++ b/XilinxProcessorIPLib/drivers/hwicap/data/hwicap_tapp.tcl @@ -89,7 +89,7 @@ proc gen_testfunc_call {swproj mhsinst} { } set ipname [get_property NAME $mhsinst] - set deviceid [::hsi::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]] if { $stdout == "" || $stdout == "none" } { set hasStdout 0