Skip to content

Commit

Permalink
Few enhancements (#868)
Browse files Browse the repository at this point in the history
* display HLS release

* add snap_trace command to display the waveform depending on the simulator

* improve message displayed

* correct bug #866

Signed-off-by: Bruno Mesnet <bruno.mesnet@fr.ibm.com>
  • Loading branch information
bmesnet authored and acastellane committed Feb 15, 2019
1 parent 7234155 commit a3711f4
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
3 changes: 2 additions & 1 deletion actions/hls.mk
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ $(syn_dir): $(srcs) run_hls_script.tcl
@if [ ! -d "$(SNAP_ROOT)/hardware/logs" ]; then \
mkdir -p $(SNAP_ROOT)/hardware/logs; \
fi
@echo "Compiling with Vivado HLS `vivado_hls -version|head -n1|cut -d " " -f 11`"
vivado_hls -f run_hls_script.tcl >> $(SNAP_ROOT)/hardware/logs/action_make.log
$(RM) -rf $@/systemc $@/verilog

Expand Down Expand Up @@ -100,7 +101,7 @@ $(SOLUTION_NAME): $(objs)
# Check for reserved HLS MMIO reg at offset 0x17c.
#
check: $(syn_dir)
@if [ $(HLS_ACTION_CLOCK) != $(shell grep "Setting up clock" $(SOLUTION_DIR)*/$(SOLUTION_NAME)/$(SOLUTION_NAME).log |cut -d " " -f 12|cut -d "n" -f 1) ]; then \
@if [ X$(HLS_ACTION_CLOCK) != X$(shell grep "Setting up clock" $(SOLUTION_DIR)*/$(SOLUTION_NAME)/$(SOLUTION_NAME).log |cut -d " " -f 12|cut -d "n" -f 1) ]; then \
echo " ---------------------------------------------------------- "; \
echo " ERROR: Action was last compiled with a different HLS clock."; \
echo " Please force the recompilation with a 'make clean' command"; \
Expand Down
3 changes: 2 additions & 1 deletion snap_env
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ while [ -z "$SETUP_DONE" ]; do
echo "Vivado version is set to: `vivado -version|head -n1`"
RESP=`vivado -version|head -n1 |cut -d' ' -f2`
if [ "$CAPI10" == "y" ] && [ $RESP == "v2018.2" ]; then
SETUP_INFO="$SETUP_INFO\n### WARNING ### Building an image with Vivado 2018.2 for CAPI1.0 cards will drive to errors."
SETUP_INFO="$SETUP_INFO\n### WARNING ### Building an image with Vivado 2018.2 or 2018.3 for CAPI1.0 cards will drive to errors."
SETUP_INFO="$SETUP_INFO\n### It is highly recommended to use Vivado 2018.1 with CAPI1.0 cards."
fi
echo "Vivado HLS version is set to: `vivado_hls -version|head -n1|cut -d " " -f 11`"
fi

####### checking default variables
Expand Down
7 changes: 6 additions & 1 deletion snap_path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@
export SNAP_ROOT=$(dirname $(readlink -f "$BASH_SOURCE"))
[ -f "${SNAP_ROOT}/snap_env.sh" ] && . ${SNAP_ROOT}/snap_env.sh
export PATH=$PATH:$SNAP_ROOT/software/tools
[ -n "$ACTION_ROOT" ] && export PATH=$PATH:$ACTION_ROOT/sw
if [[ -z ${ACTION_ROOT} ]]; then
echo "Set ACTION_ROOT to your action directory if you want to have it available everywhere!"
echo "export ACTION_ROOT=\"path_to_your_action_directory\""
else
[ -n "$ACTION_ROOT" ] && export PATH=$PATH:$ACTION_ROOT/sw
fi
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP_ROOT/software/lib
45 changes: 45 additions & 0 deletions snap_trace
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
############################################################################
############################################################################
##
## Copyright 2016,2017 International Business Machines
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE#2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions AND
## limitations under the License.
##
############################################################################
############################################################################
#
snapdir=$(dirname $(readlink -f "$BASH_SOURCE")) # path containing this script
PATH=$snapdir:$PATH

snap_config=$snapdir/\.snap_config

simulator=`grep SIMULATOR $snap_config|cut -d = -f 2 |tr -d '"'`

cd hardware/sim
if [ $simulator == "xsim" ]; then
if [ -d "xsim" ]; then
./xsimtrace
else
echo "Please launch a simulation (make sim) prior to see traces"
fi
fi
if [ $simulator == "irun" ]; then
if [ -d "ies" ]; then
./iruntrace
else
echo "Please launch a simulation (make sim) prior to see traces"
fi
fi

cd ../..

0 comments on commit a3711f4

Please sign in to comment.