# /******************************************************************************* # Copyright (c) 2018, Xilinx, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # # 3. Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # *******************************************************************************/ if { $::argc != 4 } { puts "ERROR: Program \"$::argv0\" requires 4 arguments!\n" puts "Usage: $::argv0 \n" exit } set xoname [lindex $::argv 0] set krnl_name [lindex $::argv 1] set target [lindex $::argv 2] set device [lindex $::argv 3] set suffix "${krnl_name}_${target}_${device}" set path_to_hdl "." set path_to_packaged "./packaged_kernel_${suffix}" set path_to_tmp_project "./tmp_kernel_pack_${suffix}" create_project -force kernel_pack $path_to_tmp_project add_files -norecurse [glob $path_to_hdl/*.v $path_to_hdl/*.sv] update_compile_order -fileset sources_1 update_compile_order -fileset sim_1 ipx::package_project -root_dir $path_to_packaged -vendor capra.cs.cornell.edu -library RTLKernel -taxonomy /KernelIP -import_files -set_current false ipx::unload_core $path_to_packaged/component.xml ipx::edit_ip_in_project -upgrade true -name tmp_edit_project -directory $path_to_packaged $path_to_packaged/component.xml set_property core_revision 2 [ipx::current_core] foreach up [ipx::get_user_parameters] { ipx::remove_user_parameter [get_property NAME $up] [ipx::current_core] } set_property sdx_kernel true [ipx::current_core] set_property sdx_kernel_type rtl [ipx::current_core] ipx::create_xgui_files [ipx::current_core] # ipx::associate_bus_interfaces -busif m01_axi -clock ap_clk [ipx::current_core] ipx::associate_bus_interfaces -busif s_axi_control -clock ap_clk [ipx::current_core] ipx::associate_bus_interfaces -busif m0_axi -clock ap_clk [ipx::current_core] set_property xpm_libraries {XPM_CDC XPM_MEMORY} [ipx::current_core] set_property supported_families { } [ipx::current_core] set_property auto_family_support_level level_2 [ipx::current_core] ipx::update_checksums [ipx::current_core] ipx::save_core [ipx::current_core] close_project # -delete if {[file exists "${xoname}"]} { file delete -force "${xoname}" } package_xo -xo_path ${xoname} -kernel_name Toplevel -ip_directory ./packaged_kernel_${suffix} -kernel_xml ./kernel.xml