From 971759620ac79f5d07695402f09eee5a82967964 Mon Sep 17 00:00:00 2001 From: Erik Kooistra <kooistra@astron.nl> Date: Mon, 26 May 2014 11:25:18 +0000 Subject: [PATCH] Corrected lib_names list in read_lib_compile_order_file(). Delete work lib before compile. --- tools/modelsim/commands.do | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/modelsim/commands.do b/tools/modelsim/commands.do index 548f0a63d8..39c9da54af 100644 --- a/tools/modelsim/commands.do +++ b/tools/modelsim/commands.do @@ -192,15 +192,17 @@ proc mk_clean {arg_lib} { } proc mk_compile {arg_lib} { + set sim [simdir $arg_lib] if {[string compare [env] "<No Context>"] != 0} { puts "A project cannot be closed while a simulation is in progress.\nUse the \"quit -sim\" command to unload the simulation first." return } puts "\[mk compile $arg_lib\]" lp $arg_lib - if {![file exists work"]} then { - vlib work; + if {[file exists "$sim/work"]} then { + vdel -lib $sim/work -all } + vlib work project compileall } @@ -217,16 +219,13 @@ proc mk_vmake {arg_lib} { mk_compile $arg_lib } puts "\[mk vmake $arg_lib\]" - if {![file exists "$sim/makefile"] || - ([file mtime "$sim/makefile"] < [file mtime "$sim/work/_info"]) } then { + if {![file exists "$sim/makefile"] || ([file mtime "$sim/makefile"] < [file mtime "$sim/work/_info"]) } then { # Both the specific library name $(arg_lib)_lib and the work library map to the same local work library, # so to be compatible for both names always use work to generate the makefile puts [exec vmake -fullsrcpath work > $sim/makefile] } - if {[file exists "$sim/work"]} then { - vdel -lib $sim/work -all - vlib work - } + vdel -lib $sim/work -all + vlib work } proc mk_make {arg_lib} { @@ -293,6 +292,7 @@ proc read_lib_compile_order_file {arg_lib} { append file_name "_lib_order.txt" set fp [open $sim/$file_name] set data [read $fp] + set data [string trim $data] ;# trim any trailing white space close $fp set lib_names [split $data] puts $lib_names -- GitLab