Commit 4c03fd3e authored by GuillemCabo's avatar GuillemCabo
Browse files

add placeholders on recipes and generic scripts.

Scripts need to be changed with final paths and files
parent 0a29ab2e
# ======= SAME DOCKER IMAGE ===========
image: localhost:5000/spyglass_centos8
# =========== ALL THE STAGES ===========
# All the stages will be executed in this order
stages:
- linting
- sim
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive
# =========== STAGE ===========
# - linting
# =============================
linting_spyglass:
stage: linting
tags:
- spyglass
script:
- echo "lint_spyglass"
- make "docker_spyglass"
allow_failure: false
# =========== STAGE ===========
# - sim
# =============================
questa:
image: localhost:5000/questa_ubuntu:latest
stage: sim
tags:
- questa
script:
- echo "Questa TB"
- make "questa"
allow_failure: false
# CI version of linting script.
docker_spyglass:
spyglass -usage #placeholder for future recipe
exit 0
questa:
vsim -h #placeholder for future recipe
exit 0
RED='\033[7;31m'
GREEN='\033[7;32m'
BLUE='\033[7;36m'
NC='\033[0m' # No Color
TOP='($TOP)'
############
## TOP $TOP.sv
############
#clean previous files
rm -rf $TOP
# Run Spyglass
printf "Please wait, running Spyglass\n"
./local_spyglass.sh \
#../hdl/$TOP.vhd \
# TODO: add remaining files here
#Capture is there is a problem with the script
if [ $? -ne 0 ]; then
exit 2
fi
# check if there is a result file
test -f ($TOP)/consolidated_reports/($TOP)_lint_lint_rtl/moresimple.rpt || exit 1
# Check outcome
printf "UNIT - : ${BLUE} $TOP ${BLUE}${NC}\n"
cat ($TOP)/consolidated_reports/($TOP)_lint_lint_rtl/moresimple.rpt | grep -i 'error\|Syntax' | GREP_COLORS='mt=01;31' egrep -i --color=always error\|syntax
if [ $? -ne 0 ]; then
printf "SPYGLASS - Chech for errors: ${GREEN}PASS${GREEN}${NC}\n"
cat ($TOP)/consolidated_reports/($TOP)_lint_lint_rtl/moresimple.rpt | GREP_COLORS='mt=01;33' egrep -i --color=always 'warning'
else
printf "SPYGLASS - Chech for errors: ${RED}FAIL${RED}${NC}\n"
exit 1
fi
exit 0
#!/bin/bash
#Script description: Generates a spyglass project
# and retrieves the results.
#Format parameters
FN="$(basename -- $1)"
N="${FN%%.*}"
EX="${FN#*.}"
FILE_LIST=""
#remove tmp folder with same name if any
rm -rf /tmp/$N
#make destination folder
mkdir /tmp/$N
rm -rf $PWD/../../library/
mkdir $PWD/../../library/
## TODO: work on autogenerating the vhdl projects in a similar way than SV
echo "#################Actual project file " >> /tmp/$N/$N.prj
echo "#!SPYGLASS_PROJECT_FILE" >> /tmp/$N/$N.prj
echo "#!VERSION 3.0" >> /tmp/$N/$N.prj
echo "##Data Import Section" >> /tmp/$N/$N.prj
#TODO: add here your files and submodules
#echo "read_file -type vhdl $PWD/../../bsc_lightlock/hdl/mytop.vhd" >> /tmp/$N/$N.prj
#echo "read_file -type vhdl $PWD/../../bsc_lightlock/hdl/myotherfiles.vhd" >> /tmp/$N/$N.prj
#TODO: Set library name and path
#echo "set_option lib safety $PWD/../../library" >> /tmp/$N/$N.prj
#echo "set_option libhdlfiles safety { $PWD/../../bsc_lightlock/hdl/lightlock_pkg.vhd $PWD/../../bsc_lightlock/hdl/apb_lightlock.vhd $PWD/../../bsc_lightlock/hdl/staggering/staggering_handler.vhd}" >> /tmp/$N/$N.prj
echo "##Common Options Section" >> /tmp/$N/$N.prj
echo "set_option mthresh 5000000" >> /tmp/$N/$N.prj
echo "set_option language_mode mixed" >> /tmp/$N/$N.prj
echo "set_option projectwdir ." >> /tmp/$N/$N.prj
echo "set_option top apb_lightlock" >> /tmp/$N/$N.prj
echo "set_option active_methodology $SPYGLASS_HOME/GuideWare/latest/block/rtl_handoff" >> /tmp/$N/$N.prj
echo "set_option elab_precompile yes" >> /tmp/$N/$N.prj
echo "set_option hdllibdu yes" >> /tmp/$N/$N.prj
echo "##Goal Setup Section" >> /tmp/$N/$N.prj
echo "current_methodology $SPYGLASS_HOME/GuideWare/latest/block/rtl_handoff" >> /tmp/$N/$N.prj
cd /tmp/$N;
export SKIP_PLATFORM_CHECK=TRUE
echo -e "run_goal lint/lint_rtl\nexit -save\n"| spyglass_main -shell -project $N.prj;
cd -
cp -r /tmp/$N/$N ./
#!/bin/bash
RED='\033[7;31m'
GREEN='\033[7;32m'
NC='\033[0m' # No Color
#Name tmp files and VARS
LOG=.questa.log
LOCAL_LOG=.lquesta.log
#Clear tmp files if any
rm -f $LOG
# Go to target folder
cd ../tb/
rm -f $LOCAL_LOG
make vsim | grep -i -e info -e warning -e error >> $LOCAL_LOG
## Report INFO
cat $LOCAL_LOG | GREP_COLORS='mt=01;36' egrep -i --color=always '#INFO#'
## Report warnings
cat $LOCAL_LOG | grep -v ^".*Warnings: 0" | GREP_COLORS='mt=01;33' egrep -i --color=always ' Warnings:'
#Check for errors
cat $LOCAL_LOG | grep -i error | grep -v ^".*Errors: 0" | GREP_COLORS='mt=01;31' egrep -i --color=always 'error'
# if errors FAIL tests
if [ $? -ne 0 ]; then
printf "Questa - $val: ${GREEN}PASS${GREEN}${NC}\n"
else
printf "Questa - $val: ${RED}FAIL${RED}${NC}\n"
exit 1
fi
cat $LOCAL_LOG >> ../ci/$LOG
cd ../ci
##Exit without errors
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment