Skip to content

Commit

Permalink
Merge pull request #303 from slaclab/pre-release
Browse files Browse the repository at this point in the history
Release Candidate v4.8.5
  • Loading branch information
ruck314 authored Sep 6, 2023
2 parents e33ca73 + ff6df6f commit 1c70f36
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 36 deletions.
2 changes: 1 addition & 1 deletion system_vcs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ endif

# VCS elaborate options
ifndef VCS_ELAB_OPTS
export VCS_ELAB_OPTS = -full64 +warn=none -kdb -lca -debug_pp -t ps -licqueue -l $(SIM_OUT_DIR)/elaborate.log
export VCS_ELAB_OPTS = -full64 -debug_acc+pp+dmptf +warn=none -kdb -lca -debug_pp -t ps -licqueue -l $(SIM_OUT_DIR)/elaborate.log
endif

# Path to VCS analyze script
Expand Down
4 changes: 2 additions & 2 deletions system_vivado.mk
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export SIM_CARGS_VHDL = -nc -l +v2k -xlrm -kdb
endif

ifndef SIM_VCS_FLAGS
export SIM_VCS_FLAGS = +warn=none -kdb -lca
export SIM_VCS_FLAGS = -debug_acc+pp+dmptf +warn=none -kdb -lca
endif

###############################################################
Expand Down Expand Up @@ -368,7 +368,7 @@ vcs : $(SOURCE_DEPEND)
@cd $(OUT_DIR); vivado -mode batch -source $(RUCKUS_DIR)/vivado/vcs.tcl

###############################################################
#### Vivado ModelSim/Questa Simulation #################################
#### Vivado ModelSim/Questa Simulation ########################
###############################################################
.PHONY : msim
msim : $(SOURCE_DEPEND)
Expand Down
2 changes: 1 addition & 1 deletion vivado/proc/sim_management.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ proc VcsCompleteMessage {dirPath rogueSim} {
}
}
puts "\t\$ ./sim_vcs_mx.sh"
puts "\t\$ ./simv -gui=verdi -verdi_opts \"-ultra\" &"
puts "\t\$ ./simv -verdi &"
puts "********************************************************\n\n"
}
5 changes: 5 additions & 0 deletions vivado/sources.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ close ${out}
set_property top ${PROJECT} [current_fileset]
# set_property top "glbl" [get_filesets sim_1]

# If VIVADO_PROJECT_SIM variable exist, set as sim top
if { [info exists ::env(VIVADO_PROJECT_SIM)] } {
set_property top ${VIVADO_PROJECT_SIM} [get_filesets sim_1]
}

# Init the global variable
set ::DIR_PATH ""
set ::DIR_LIST ""
Expand Down
74 changes: 42 additions & 32 deletions vivado/vcs.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ SourceTclFile ${VIVADO_DIR}/pre_vcs.tcl

# Setup variables
set VersionNumber [GetVcsName]
set simLibOutDir ${VIVADO_INSTALL}/vcs-${VersionNumber}
if { [info exists ::env(VCS_LIB_PATH)] } {
set simLibOutDir $::env(VCS_LIB_PATH)
} else {
set simLibOutDir ${VIVADO_INSTALL}/vcs-${VersionNumber}
}
set simTbOutDir ${OUT_DIR}/${PROJECT}_project.sim/sim_1/behav
set simTbFileName [get_property top [get_filesets sim_1]]

Expand Down Expand Up @@ -342,44 +346,50 @@ while { [eof ${in}] != 1 } {

gets ${in} line

set simString " simulate"
if { ${line} == ${simString} } {
if { ${rogueSimEn} == true } {
set simString " source ${simTbOutDir}/setup_env.sh"
puts ${out} ${simString}
}
} else {
# Do not execute the simulation in sim_vcs_mx.sh build script
if { [string match "*simulate.do" ${line}] } {
set line " echo \"Ready to simulate\""

# Replace ${simTbFileName}_simv with the simv
set replaceString "${simTbFileName}_simv simv"
set line [string map ${replaceString} ${line}]
}

# Update the compile options (fix bug in export_simulation not including more_options properties)
if { [VersionCompare 2022.1] <= 0 } {
set line [string map [list ${vlogan_opts_old} ${vlogan_opts_new}] ${line}]
set line [string map [list ${vhdlan_opts_old} ${vhdlan_opts_new}] ${line}]
set line [string map [list ${vcs_elab_opts_old} ${vcs_elab_opts_new}] ${line}]
}
# Replace ${simTbFileName}_simv with the simv
set replaceString "${simTbFileName}_simv simv"
set line [string map ${replaceString} ${line}]

# Change the glbl.v path (Vivado 2017.2 fix)
set replaceString "behav/vcs/glbl.v glbl.v"
set line [string map ${replaceString} ${line}]
# Update the compile options (fix bug in export_simulation not including more_options properties)
if { [VersionCompare 2022.1] <= 0 } {
set line [string map [list ${vlogan_opts_old} ${vlogan_opts_new}] ${line}]
set line [string map [list ${vhdlan_opts_old} ${vhdlan_opts_new}] ${line}]
set line [string map [list ${vcs_elab_opts_old} ${vcs_elab_opts_new}] ${line}]
}

# Check if only a VHDL simulation
if { ${vList} == "" &&
${vhList} == "" &&
${svList} == "" } {
# Remove xil_defaultlib.glbl (bug fix for Vivado compiling VCS script)
set line [string map { "xil_defaultlib.glbl" "" } ${line}]
}
# Change the glbl.v path (Vivado 2017.2 fix)
set replaceString "behav/vcs/glbl.v glbl.v"
set line [string map ${replaceString} ${line}]

if { ${mixedSim} != true } {
set line [string map [list ${surf_glbl_old} ${surf_glbl_new}] ${line}]
}
# Remove additional/redundant command line switch '-l[og]'
set line [string map {" -l .tmp_log" ""} ${line}]
if { [string match "*vhdlan.log 2>/dev/null" ${line}] } {
set line " 2>&1 | tee -a vhdlan.log"
}
if { [string match "*vlogan.log 2>/dev/null" ${line}] } {
set line " 2>&1 | tee -a vlogan.log"
}

# Write to file
puts ${out} ${line}
# Check if only a VHDL simulation
if { ${vList} == "" &&
${vhList} == "" &&
${svList} == "" } {
# Remove xil_defaultlib.glbl (bug fix for Vivado compiling VCS script)
set line [string map { "xil_defaultlib.glbl" "" } ${line}]
}

if { ${mixedSim} != true } {
set line [string map [list ${surf_glbl_old} ${surf_glbl_new}] ${line}]
}

# Write to file
puts ${out} ${line}
}

# Close the files
Expand Down

0 comments on commit 1c70f36

Please sign in to comment.