Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
CAOS_HW
HDL_IP
SafeSU
Commits
54a0c396
Commit
54a0c396
authored
Oct 28, 2021
by
Guillem Cabo
Browse files
Ft/spyglass ci
parent
9e361f41
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
0 → 100644
View file @
54a0c396
# ======= SAME DOCKER IMAGE ===========
image
:
localhost:5000/spyglass_centos8:latest
# =========== ALL THE STAGES ===========
# All the stages will be executed in this order
stages
:
-
linting
variables
:
GIT_SUBMODULE_STRATEGY
:
recursive
before_script
:
-
git submodule sync --recursive
-
git submodule update --init --recursive
# =========== STAGE ===========
# - linting
# =============================
linting_spyglass
:
stage
:
linting
artifacts
:
paths
:
#TODO:add spyglass log
-
./artifact_linting_verilator_BSC.log
when
:
always
expire_in
:
30 days
script
:
-
echo "lint_spyglass"
-
make "docker_spyglass"
# This is a fake call inside the Makefile, just and example
allow_failure
:
false
Makefile
0 → 100644
View file @
54a0c396
#Run linting tests as a user
# requires passwordless ssh acces to epi3 and verilator installed locally
user_linting
:
cd
ci/
&&
bash lint.sh
# CI version of linting script. Checks AXI and AHB versions of PMU with spyglass
docker_spyglass
:
cd
ci/
&&
bash lint_CI.sh
exit
0
ci/lint_CI.sh
0 → 100755
View file @
54a0c396
RED
=
'\033[7;31m'
GREEN
=
'\033[7;32m'
BLUE
=
'\033[7;36m'
NC
=
'\033[0m'
# No Color
############
## TOP pmu_ahb.sv
############
# Run Spyglass
printf
"Please wait, running Spyglass
\n
"
./local_spyglass.sh ../hdl/pmu_ahb.sv
\
../hdl/PMU_raw.sv
\
../submodules/crossbar/hdl/crossbar.sv
\
../submodules/MCCU/hdl/MCCU.sv
\
../submodules/RDC/hdl/RDC.sv
\
../submodules/quota/PMU_quota.sv
\
../submodules/counters/PMU_counters.sv
\
../submodules/overflow/PMU_overflow.sv
#../submodules/overflow/PMU_overflow.sv 1> /dev/null
#Capture is there is a problem with the script
if
[
$?
-ne
0
]
;
then
exit
2
fi
# Check outcome
printf
"UNIT - :
${
BLUE
}
pmu_ahb
${
BLUE
}${
NC
}
\n
"
cat
pmu_ahb/consolidated_reports/pmu_ahb_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
pmu_ahb/consolidated_reports/pmu_ahb_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
############
## TOP AXI_PMU.sv
############
# Run Spyglass
printf
"Please wait, running Spyglass
\n
"
./local_spyglass.sh ../hdl/AXI_PMU.sv
\
../hdl/AXI_PMU_interface_v1_0_S00_AXI.sv
\
../submodules/RDC/hdl/RDC.sv
\
../submodules/MCCU/hdl/MCCU.sv 1> /dev/null
# Check outcome
printf
"UNIT - :
${
BLUE
}
AXI_PMU
${
BLUE
}${
NC
}
\n
"
cat
AXI_PMU/consolidated_reports/AXI_PMU_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
AXI_PMU/consolidated_reports/AXI_PMU_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
ci/local_spyglass.sh
0 → 100755
View file @
54a0c396
#!/bin/bash
#Format parameters
FN
=
"
$(
basename
--
$1
)
"
N
=
"
${
FN
%%.*
}
"
EX
=
"
${
FN
#*.
}
"
#remove tmp folder with same name if any
rm
-rf
/tmp/
$N
#make destination folder
mkdir
/tmp/
$N
#copy files and set script
for
var
in
"
$@
"
do
echo
"read_file {./"
$(
basename
--
$var
)
"}"
>>
/tmp/importspy
cp
$var
/tmp/
$N
done
#set the top for spyglass. must be the first argument of the script.
echo
"set_option top
$N
"
>>
/tmp/optionsspy
cp
/home/develop/template_spyglass.prj /tmp/
$N
/
$N
.prj
;
cd
/tmp/
$N
;
sed
-i
'/Data Import Section/ r /tmp/importspy'
./
$N
.prj
;
sed
-i
'/Common Options Section/ r /tmp/optionsspy'
./
$N
.prj
;
export
SKIP_PLATFORM_CHECK
=
TRUE
echo
-e
"run_goal lint/lint_rtl
\n
exit -save
\n
"
| spyglass_main
-shell
-project
$N
.prj
;
cd
-
cp
-r
/tmp/
$N
/
$N
./
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment