mirror of
https://github.com/openhwgroup/cvw.git
synced 2025-06-27 17:01:20 -04:00
commit
0e0e850e68
6 changed files with 150 additions and 13 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -79,6 +79,7 @@ synthDC/wallyplots/
|
|||
synthDC/runArchive
|
||||
synthDC/hdl
|
||||
synthDC/Summary.csv
|
||||
synthDC/spyglass/lint-spyglass-reports
|
||||
|
||||
# Benchmarks
|
||||
benchmarks/embench/wally*.json
|
||||
|
|
85
bin/lint-spyglass.sh
Executable file
85
bin/lint-spyglass.sh
Executable file
|
@ -0,0 +1,85 @@
|
|||
#!/bin/bash
|
||||
|
||||
###############################################################################
|
||||
# Script Name: lint_spyglass.sh
|
||||
# Author: james.stine@okstate.edu 11 June 2025
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
||||
# Description:
|
||||
# Automates Synopsys SpyGlass linting for Wally RISC-V configurations.
|
||||
# Supports command-line options for custom goals and configs.
|
||||
###############################################################################
|
||||
|
||||
# Check WALLY environment
|
||||
if [ -z "$WALLY" ]; then
|
||||
echo "Error: WALLY environment variable is not set."
|
||||
echo "Please source your setup before running this script."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# === Defaults ===
|
||||
GOAL="lint/lint_rtl"
|
||||
DEFAULT_CONFIGS=(rv32e rv64gc rv32gc rv32imc rv32i rv64i)
|
||||
CONFIGS=()
|
||||
|
||||
# === Parse command-line options ===
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
-g|--goal)
|
||||
GOAL="$2"
|
||||
shift 2
|
||||
;;
|
||||
-c|--configs)
|
||||
IFS=',' read -r -a CONFIGS <<< "$2"
|
||||
shift 2
|
||||
;;
|
||||
-h|--help)
|
||||
echo "Usage: $0 [-g lint_goal] [-c config1,config2,...]"
|
||||
echo " -g, --goal Linting goal (e.g., lint/lint_rtl or lint/lint_rtl_enhanced)"
|
||||
echo " -c, --configs Comma-separated list of configs to run (e.g., rv32e,rv64gc)"
|
||||
echo "Defaults: goal=$GOAL, configs=${DEFAULT_CONFIGS[*]}"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $1"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Use default configs if none provided
|
||||
if [ ${#CONFIGS[@]} -eq 0 ]; then
|
||||
CONFIGS=("${DEFAULT_CONFIGS[@]}")
|
||||
fi
|
||||
|
||||
# Spyglass work directories/files
|
||||
SPYGLASS_DIR="$WALLY/synthDC/spyglass"
|
||||
TEMPLATE_PRJ="$SPYGLASS_DIR/cvw.prj"
|
||||
|
||||
# Clean output directory
|
||||
echo "Cleaning lint-spyglass-reports directory..."
|
||||
rm -rf "$SPYGLASS_DIR/lint-spyglass-reports"
|
||||
|
||||
# Iterate configs
|
||||
for config in "${CONFIGS[@]}"; do
|
||||
echo "Processing configuration: $config"
|
||||
CONFIG_PRJ="$SPYGLASS_DIR/cvw_${config}.prj"
|
||||
|
||||
# Replace placeholders in template
|
||||
sed -e "s|\$WALLY|$WALLY|g" \
|
||||
-e "s|WALLYVER|$config|g" \
|
||||
-e "s|read_file -type awl waivers.tcl|read_file -type awl $SPYGLASS_DIR/waivers.tcl|g" \
|
||||
-e "s|set_option projectwdir lint-spyglass/|set_option projectwdir ${SPYGLASS_DIR}/lint-spyglass/|g" \
|
||||
"$TEMPLATE_PRJ" > "$CONFIG_PRJ"
|
||||
|
||||
# Run SpyGlass
|
||||
echo "Running spyglass for: $config with goal: $GOAL"
|
||||
spyglass -project "$CONFIG_PRJ" -goal "$GOAL" -batch
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error running spyglass for configuration: $config"
|
||||
else
|
||||
echo "Completed: $config"
|
||||
fi
|
||||
|
||||
rm "$CONFIG_PRJ"
|
||||
done
|
|
@ -4,17 +4,21 @@
|
|||
|
||||
# License servers and commercial CAD tool paths
|
||||
# Must edit these based on your local environment. Ask your sysadmin.
|
||||
setenv MGLS_LICENSE_FILE 27002@zircon.eng.hmc.edu # Change this to your Siemens license server
|
||||
setenv SNPSLMD_LICENSE_FILE 27020@zircon.eng.hmc.edu # Change this to your Synopsys license server
|
||||
setenv QUESTAPATH /cad/mentor/questa_sim-2022.4_2/questasim/bin # Change this for your path to Questa
|
||||
setenv SNPSPATH /cad/synopsys/SYN/bin # Change this for your path to Design Compiler
|
||||
setenv VCSPATH /cad/synopsys/vcs/U-2023.03-SP2-4/bin # Change this for your path to Synopsys VCS
|
||||
setenv MGLS_LICENSE_FILE 27002@zircon.eng.hmc.edu # Change this to your Siemens license server
|
||||
setenv SNPSLMD_LICENSE_FILE 27020@zircon.eng.hmc.edu # Change this to your Synopsys license server
|
||||
setenv QUESTAPATH /cad/mentor/questa_sim-2022.4_2/questasim/bin # Change this for your path to Questa
|
||||
setenv SNPSPATH /cad/synopsys/SYN/bin # Change this for your path to Design Compiler
|
||||
setenv VCSPATH /cad/synopsys/vcs/U-2023.03-SP2-4/bin # Change this for your path to Synopsys VCS
|
||||
setenv SPYGLASS_HOME /cad/synopsys/spyglass/W-2024.09-SP2-2/SPYGLASS_HOME # Change this for your path to Synopsys Spyglass
|
||||
|
||||
|
||||
# Tools
|
||||
# Questa and Synopsys
|
||||
extend PATH $QUESTAPATH
|
||||
extend PATH $SNPSPATH
|
||||
extend PATH $VCSPATH
|
||||
# Synopsys Spyglass
|
||||
setenv SNPSLMD_QUEUE 1
|
||||
|
||||
# GCC
|
||||
if ( ! $?LD_LIBRARY_PATH ) then
|
||||
|
|
|
@ -15,18 +15,21 @@ ENDC='\033[0m' # Reset to default color
|
|||
|
||||
# license servers and commercial CAD tool paths
|
||||
# Must edit these based on your local environment.
|
||||
export MGLS_LICENSE_FILE=27002@zircon.eng.hmc.edu # Change this to your Siemens license server for Questa
|
||||
export SNPSLMD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Synopsys license server
|
||||
export IMPERASD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Imperas license server
|
||||
export BREKER_LICENSE_FILE=1819@zircon.eng.hmc.edu # Change this to your Breker license server
|
||||
export QUESTA_HOME=/cad/mentor/QUESTA # Change this for your path to Questa, excluding bin
|
||||
export DC_HOME=/cad/synopsys/SYN # Change this for your path to Synopsys DC, excluding bin
|
||||
export VCS_HOME=/cad/synopsys/VCS # Change this for your path to Synopsys VCS, excluding bin
|
||||
export BREKER_HOME=/cad/breker/TREK # Change this for your path to Breker Trek
|
||||
export MGLS_LICENSE_FILE=27002@zircon.eng.hmc.edu # Change this to your Siemens license server for Questa
|
||||
export SNPSLMD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Synopsys license server
|
||||
export IMPERASD_LICENSE_FILE=27020@zircon.eng.hmc.edu # Change this to your Imperas license server
|
||||
export BREKER_LICENSE_FILE=1819@zircon.eng.hmc.edu # Change this to your Breker license server
|
||||
export QUESTA_HOME=/cad/mentor/QUESTA # Change this for your path to Questa, excluding bin
|
||||
export DC_HOME=/cad/synopsys/SYN # Change this for your path to Synopsys DC, excluding bin
|
||||
export VCS_HOME=/cad/synopsys/VCS # Change this for your path to Synopsys VCS, excluding bin
|
||||
export BREKER_HOME=/cad/breker/TREK # Change this for your path to Breker Trek
|
||||
export SPYGLASS_HOME=/cad/synopsys/spyglass/W-2024.09-SP2-2/SPYGLASS_HOME # Change this for your path to Synopsys Spyglass
|
||||
|
||||
# Tools
|
||||
# Questa and Synopsys
|
||||
export PATH=$QUESTA_HOME/bin:$DC_HOME/bin:$VCS_HOME/bin:$PATH
|
||||
# Synopsys Spyglass
|
||||
export SNPSLMD_QUEUE=1
|
||||
|
||||
# Environmental variables for SoC
|
||||
export SYN_pdk=/proj/models/tsmc28/libraries/28nmtsmc/tcbn28hpcplusbwp30p140_190a/
|
||||
|
|
33
synthDC/spyglass/cvw.prj
Normal file
33
synthDC/spyglass/cvw.prj
Normal file
|
@ -0,0 +1,33 @@
|
|||
#
|
||||
# Synopsys SpyGlass Lint Flow
|
||||
# james.stine@okstate.edu 11 June 2025
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
||||
#
|
||||
|
||||
# Sets directory for output reports
|
||||
set_option projectwdir $WALLY/synthDC/spyglass/lint-spyglass-reports/
|
||||
set_option language_mode mixed
|
||||
set_option designread_enable_synthesis no
|
||||
set_option designread_disable_flatten no
|
||||
set_option active_methodology $SPYGLASS_HOME/GuideWare/latest/block/rtl_handoff
|
||||
set_option enableSV12 yes
|
||||
set_option handlememory yes
|
||||
set_option top wallywrapper
|
||||
set_parameter handle_large_bus yes
|
||||
|
||||
# Include DIR
|
||||
set_option incdir $WALLY/config/WALLYVER
|
||||
set_option incdir $WALLY/config/shared
|
||||
|
||||
# main CVW
|
||||
read_file -type verilog $WALLY/src/cvw.sv
|
||||
read_file -type verilog $WALLY/testbench/wallywrapper.sv
|
||||
read_file -type awl $WALLY/synthDC/spyglass/waivers.tcl
|
||||
|
||||
# generic read of Wally src files
|
||||
read_file -type verilog $WALLY/src/*/*
|
||||
read_file -type verilog $WALLY/src/*/*/*
|
||||
|
||||
current_methodology $SPYGLASS_HOME/GuideWare/latest/block/rtl_handoff
|
||||
|
||||
|
11
synthDC/spyglass/waivers.tcl
Normal file
11
synthDC/spyglass/waivers.tcl
Normal file
|
@ -0,0 +1,11 @@
|
|||
#
|
||||
# Synopsys SpyGlass Lint Waivers
|
||||
# james.stine@okstate.edu 11 June 2025
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
|
||||
#
|
||||
|
||||
# Add waivers that are not neededed to be checked
|
||||
waive -rule { W240 W528 W123 W287b }
|
||||
# Add waiver for undriven outputs for items like Uncore
|
||||
waive -du { {rom1p1r} {uncore} } -rule { {UndrivenInTerm-ML} }
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue