Skip to content
Snippets Groups Projects
Commit 1b23ccda authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Use mk_execute() to do the compile IP.

parent bf1aaacb
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ proc lp {{arg_lib ""}} {
#-------------------------------------------------------------------------------
proc project_mk_cmds {} {
return {clean compile files make test vmake} ;# mk with arg_cmd="" will default to "make"
return {clean execute compile files make test vmake} ;# mk with arg_cmd="" will default to "make"
}
# Get commands from the mk args
......@@ -108,6 +108,7 @@ proc parse_for_cmds arg_list {
echo "mk \[commands\] \[projects\]"
echo " possible commands are:"
echo " clean: removes the library files"
echo " execute: runs compile IP scripts"
echo " compile: runs project compileall"
echo " files: list files in compile order"
echo " help: displays this help"
......@@ -204,6 +205,25 @@ proc mk_clean {arg_lib} {
}
}
proc mk_execute {arg_lib} {
# if there are compile scripts for IP files then first use use mk_execute to compile those into this work
set compile_ip [read_lib_compile_ip_file $arg_lib]
if {[llength $compile_ip] > 0} {
echo "\[mk execute $arg_lib\]"
set sim [simdir $arg_lib]
lp $arg_lib
# create work library if it does not already exist
if {![file exists "$sim/work"]} then {
vlib work
}
global env ;# Make global env() variable known locally. This is necessary for $env(*) in compile IP tcl script, alternatively use $::env(*) in compile IP tcl scrip
foreach ip $compile_ip {
echo "do $ip"
do $ip
}
}
}
proc mk_compile {arg_lib} {
set sim [simdir $arg_lib]
if {[string compare [env] "<No Context>"] != 0} {
......@@ -212,17 +232,13 @@ proc mk_compile {arg_lib} {
}
echo "\[mk compile $arg_lib\]"
lp $arg_lib
# recreate work library
if {[file exists "$sim/work"]} then {
vdel -lib $sim/work -all
}
vlib work
# if there are compile scripts for IP files then first compile those into this work
global env ;# Make global env() variable known locally. This is necessary for $env(*) in compile IP tcl script, alternatively use $::env(*) in compile IP tcl scrip
set compile_ip [read_lib_compile_ip_file $arg_lib]
foreach ip $compile_ip {
echo "do $ip"
do $ip
}
# and then first execute any IP compile scripts
mk_execute $arg_lib
# and then compile the HDL
project compileall
}
......@@ -245,8 +261,11 @@ proc mk_vmake {arg_lib} {
# so to be compatible for both names always use work to generate the makefile
echo [exec vmake -fullsrcpath work > $sim/makefile]
}
# recreate work library
vdel -lib $sim/work -all
vlib work
# and then first execute any IP compile scripts
mk_execute $arg_lib
}
proc mk_make {arg_lib} {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment