Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tclapp/aldec/activehdl/activehdl.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ namespace eval ::tclapp::aldec::activehdl {
lappend ::auto_path $home
}
}
package provide ::tclapp::aldec::activehdl 1.6
package provide ::tclapp::aldec::activehdl 1.7
2 changes: 1 addition & 1 deletion tclapp/aldec/activehdl/app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<catalog>
<apps>
<app>
<revision_history>Update 1.6: Coverage options.</revision_history>
<revision_history>Update 1.7: Add mappings for libraries from compiled library location.</revision_history>
<name>activehdl</name>
<pkg_require>Vivado 2014.1</pkg_require>
<company>aldec</company>
Expand Down
2 changes: 1 addition & 1 deletion tclapp/aldec/activehdl/common/helpers.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package require Vivado 1.2014.1

package provide ::tclapp::aldec::common::helpers 1.6
package provide ::tclapp::aldec::common::helpers 1.7

namespace eval ::tclapp::aldec::common {

Expand Down
4 changes: 2 additions & 2 deletions tclapp/aldec/activehdl/common/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded ::tclapp::aldec::common::helpers 1.6 [list source [file join $dir helpers.tcl]]
package ifneeded ::tclapp::aldec::common::sim 1.6 [list source [file join $dir sim.tcl]]
package ifneeded ::tclapp::aldec::common::helpers 1.7 [list source [file join $dir helpers.tcl]]
package ifneeded ::tclapp::aldec::common::sim 1.7 [list source [file join $dir sim.tcl]]
54 changes: 52 additions & 2 deletions tclapp/aldec/activehdl/common/sim.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

package require Vivado 1.2014.1

package require ::tclapp::aldec::common::helpers 1.6
package require ::tclapp::aldec::common::helpers 1.7

package provide ::tclapp::aldec::common::sim 1.6
package provide ::tclapp::aldec::common::sim 1.7

namespace eval ::tclapp::aldec::common {

Expand Down Expand Up @@ -266,6 +266,54 @@ proc usf_create_udo_file { file } {
close $fh
}

proc usf_aldec_mapLibraryCfg { fh } {
# Summary:
# Argument Usage:
# Return Value:

set librariesLocation ""

set product [get_property target_simulator [current_project]]

switch -- $product {
Riviera { set librariesLocation [get_property COMPXLIB.RIVIERA_COMPILED_LIBRARY_DIR [current_project]] }
ActiveHDL { set librariesLocation [get_property COMPXLIB.ACTIVEHDL_COMPILED_LIBRARY_DIR [current_project]] }
}

if { $librariesLocation == "" } {
return
}

set libraryCfg [file join $librariesLocation library.cfg]
if { ![file isfile $libraryCfg] } {
return
}

set f [open $libraryCfg r]

while { ![eof $f] } {
gets $f line
if { [regexp {\s*([^\s]+)\s*=\s*\"?([^\s\"]+).*} $line tmp mapName mapPath] } {

if { [file pathtype $mapPath] != "absolute" } {
set mapPath [file join $librariesLocation $mapPath]
}

set mapPath [file normalize $mapPath]

if { ![file isfile $mapPath] } {
continue
}

puts $fh "vmap $mapName \{$mapPath\}"
}
}

close $f

puts $fh ""
}

proc usf_aldec_create_do_file_for_compilation { do_file } {
# Summary:
# Argument Usage:
Expand Down Expand Up @@ -295,6 +343,8 @@ proc usf_aldec_create_do_file_for_compilation { do_file } {

puts $fh "vlib work\n"

usf_aldec_mapLibraryCfg $fh

set design_libs [usf_aldec_get_design_libs $::tclapp::aldec::common::helpers::a_sim_vars(l_design_files)]

# TODO:
Expand Down
1 change: 1 addition & 0 deletions tclapp/aldec/activehdl/common/tclIndex
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ set auto_index(::tclapp::aldec::common::sim::usf_aldec_write_setup_files) [list
set auto_index(::tclapp::aldec::common::sim::usf_aldec_write_compile_script) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_write_simulate_script) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_create_udo_file) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_aldec_mapLibraryCfg) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_aldec_create_do_file_for_compilation) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_aldec_get_elaboration_cmdline) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_aldec_get_simulation_cmdline) [list source [file join $dir sim.tcl]]
Expand Down
2 changes: 1 addition & 1 deletion tclapp/aldec/activehdl/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded ::tclapp::aldec::activehdl 1.6 [list source [file join $dir activehdl.tcl]]
package ifneeded ::tclapp::aldec::activehdl 1.7 [list source [file join $dir activehdl.tcl]]
2 changes: 1 addition & 1 deletion tclapp/aldec/activehdl/register_options.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package require Vivado 1.2014.1

package require ::tclapp::aldec::common::helpers 1.6
package require ::tclapp::aldec::common::helpers 1.7

namespace eval ::tclapp::aldec::activehdl {
namespace export register_options
Expand Down
1 change: 1 addition & 0 deletions tclapp/aldec/activehdl/revision_history.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
1.7 Update 1.7: Add mappings for libraries from compiled library location.
1.6 Update 1.6: Coverage options.
4 changes: 2 additions & 2 deletions tclapp/aldec/activehdl/sim.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

package require Vivado 1.2014.1

package require ::tclapp::aldec::common::sim 1.6
package require ::tclapp::aldec::common::helpers 1.6
package require ::tclapp::aldec::common::sim 1.7
package require ::tclapp::aldec::common::helpers 1.7

namespace eval ::tclapp::aldec::activehdl {

Expand Down
2 changes: 1 addition & 1 deletion tclapp/aldec/riviera/app.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<catalog>
<apps>
<app>
<revision_history>Update 1.6: Coverage options.</revision_history>
<revision_history>Update 1.7: Add mappings for libraries from compiled library location.</revision_history>
<name>riviera</name>
<pkg_require>Vivado 2014.1</pkg_require>
<company>aldec</company>
Expand Down
2 changes: 1 addition & 1 deletion tclapp/aldec/riviera/common/helpers.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package require Vivado 1.2014.1

package provide ::tclapp::aldec::common::helpers 1.6
package provide ::tclapp::aldec::common::helpers 1.7

namespace eval ::tclapp::aldec::common {

Expand Down
4 changes: 2 additions & 2 deletions tclapp/aldec/riviera/common/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded ::tclapp::aldec::common::helpers 1.6 [list source [file join $dir helpers.tcl]]
package ifneeded ::tclapp::aldec::common::sim 1.6 [list source [file join $dir sim.tcl]]
package ifneeded ::tclapp::aldec::common::helpers 1.7 [list source [file join $dir helpers.tcl]]
package ifneeded ::tclapp::aldec::common::sim 1.7 [list source [file join $dir sim.tcl]]
54 changes: 52 additions & 2 deletions tclapp/aldec/riviera/common/sim.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

package require Vivado 1.2014.1

package require ::tclapp::aldec::common::helpers 1.6
package require ::tclapp::aldec::common::helpers 1.7

package provide ::tclapp::aldec::common::sim 1.6
package provide ::tclapp::aldec::common::sim 1.7

namespace eval ::tclapp::aldec::common {

Expand Down Expand Up @@ -266,6 +266,54 @@ proc usf_create_udo_file { file } {
close $fh
}

proc usf_aldec_mapLibraryCfg { fh } {
# Summary:
# Argument Usage:
# Return Value:

set librariesLocation ""

set product [get_property target_simulator [current_project]]

switch -- $product {
Riviera { set librariesLocation [get_property COMPXLIB.RIVIERA_COMPILED_LIBRARY_DIR [current_project]] }
ActiveHDL { set librariesLocation [get_property COMPXLIB.ACTIVEHDL_COMPILED_LIBRARY_DIR [current_project]] }
}

if { $librariesLocation == "" } {
return
}

set libraryCfg [file join $librariesLocation library.cfg]
if { ![file isfile $libraryCfg] } {
return
}

set f [open $libraryCfg r]

while { ![eof $f] } {
gets $f line
if { [regexp {\s*([^\s]+)\s*=\s*\"?([^\s\"]+).*} $line tmp mapName mapPath] } {

if { [file pathtype $mapPath] != "absolute" } {
set mapPath [file join $librariesLocation $mapPath]
}

set mapPath [file normalize $mapPath]

if { ![file isfile $mapPath] } {
continue
}

puts $fh "vmap $mapName \{$mapPath\}"
}
}

close $f

puts $fh ""
}

proc usf_aldec_create_do_file_for_compilation { do_file } {
# Summary:
# Argument Usage:
Expand Down Expand Up @@ -295,6 +343,8 @@ proc usf_aldec_create_do_file_for_compilation { do_file } {

puts $fh "vlib work\n"

usf_aldec_mapLibraryCfg $fh

set design_libs [usf_aldec_get_design_libs $::tclapp::aldec::common::helpers::a_sim_vars(l_design_files)]

# TODO:
Expand Down
1 change: 1 addition & 0 deletions tclapp/aldec/riviera/common/tclIndex
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ set auto_index(::tclapp::aldec::common::sim::usf_aldec_write_setup_files) [list
set auto_index(::tclapp::aldec::common::sim::usf_aldec_write_compile_script) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_write_simulate_script) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_create_udo_file) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_aldec_mapLibraryCfg) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_aldec_create_do_file_for_compilation) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_aldec_get_elaboration_cmdline) [list source [file join $dir sim.tcl]]
set auto_index(::tclapp::aldec::common::sim::usf_aldec_get_simulation_cmdline) [list source [file join $dir sim.tcl]]
Expand Down
2 changes: 1 addition & 1 deletion tclapp/aldec/riviera/pkgIndex.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# script is sourced, the variable $dir must contain the
# full path name of this file's directory.

package ifneeded ::tclapp::aldec::riviera 1.6 [list source [file join $dir riviera.tcl]]
package ifneeded ::tclapp::aldec::riviera 1.7 [list source [file join $dir riviera.tcl]]
2 changes: 1 addition & 1 deletion tclapp/aldec/riviera/register_options.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

package require Vivado 1.2014.1

package require ::tclapp::aldec::common::helpers 1.6
package require ::tclapp::aldec::common::helpers 1.7

namespace eval ::tclapp::aldec::riviera {
namespace export register_options
Expand Down
1 change: 1 addition & 0 deletions tclapp/aldec/riviera/revision_history.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
1.7 Update 1.7: Add mappings for libraries from compiled library location.
1.6 Update 1.6: Coverage options.
2 changes: 1 addition & 1 deletion tclapp/aldec/riviera/riviera.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ namespace eval ::tclapp::aldec::riviera {
lappend ::auto_path $home
}
}
package provide ::tclapp::aldec::riviera 1.6
package provide ::tclapp::aldec::riviera 1.7
4 changes: 2 additions & 2 deletions tclapp/aldec/riviera/sim.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

package require Vivado 1.2014.1

package require ::tclapp::aldec::common::sim 1.6
package require ::tclapp::aldec::common::helpers 1.6
package require ::tclapp::aldec::common::sim 1.7
package require ::tclapp::aldec::common::helpers 1.7

namespace eval ::tclapp::aldec::riviera {

Expand Down