ひでみのアイデア帳

くだらないことなんだけど、忘れないために・・・

IP-XACTを生成するスクリプト

これも備忘録なのだ。

IP作成中の副産物・・・。

ファイル構造はこんな感じ。

IP_LIB
┣build_ip.tcl
┗aq_sigcap_v1
 ┣create_ip.tcl
 ┗src
  ┣aq_sigcap.v
  ┣aq_sigcap_axi_ls.v
  ┣aq_sigcap_ctl.v
  ┗aq_sigcap_mem.v

ここでbuild_ip.tclを実行すればIPコアが出来上がる。

$ vivado -mode batch -source build_ip.tcl

build_ip.tcl

set BUILD_DIR "build"

set FILES [list \
               "aq_sigcap_v1" \
               ]

foreach elem $FILES {
    cd $elem

    file mkdir $BUILD_DIR
    cd $BUILD_DIR

    source ../create_ip.tcl

    cd ..
    file delete -force -- $BUILD_DIR

    cd ..
}

create_ip.tcl

set PROJECT_NAME aq_sigcap_v1
set PART_NAME xc7z020clg400-1

create_project $PROJECT_NAME ./$PROJECT_NAME -part $PART_NAME -force

set FILES [list \
           ../../$PROJECT_NAME/src/aq_sigcap.v \
           ../../$PROJECT_NAME/src/aq_sigcap_axi_ls.v \
           ../../$PROJECT_NAME/src/aq_sigcap_ctl.v \
           ../../$PROJECT_NAME/src/aq_sigcap_mem.v \
          ]

add_files -norecurse $FILES

ipx::package_project -root_dir ../../$PROJECT_NAME -vendor aquaxis.com -library aquaxis -taxonomy /UserIP

#set_property vendor aquaxis.com [ipx::current_core]
#set_property library aquaxis [ipx::current_core]
set_property core_revision 1 [ipx::current_core]

ipx::create_xgui_files [ipx::current_core]
ipx::update_checksums [ipx::current_core]
ipx::save_core [ipx::current_core]

#set_property  ip_repo_paths  ../../$PROJECT_NAME [current_project]