diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-11-06 11:45:08 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-11-06 11:45:08 -0600 |
| commit | ff5f2a94c06ce3af9cc04033220dcd0f6c8826e3 (patch) | |
| tree | 449d1ebf4c8574bff55f356f6a9732d869f84a30 /ip/dsp_mul_sim | |
| parent | 543f9de75d19eb34c386ad25662beb8dd2aed5c4 (diff) | |
Add dsp_mul IP variation
Diffstat (limited to 'ip/dsp_mul_sim')
| -rw-r--r-- | ip/dsp_mul_sim/aldec/rivierapro_setup.tcl | 278 | ||||
| -rw-r--r-- | ip/dsp_mul_sim/cadence/cds.lib | 19 | ||||
| -rw-r--r-- | ip/dsp_mul_sim/cadence/hdl.var | 2 | ||||
| -rwxr-xr-x | ip/dsp_mul_sim/cadence/ncsim_setup.sh | 195 | ||||
| -rw-r--r-- | ip/dsp_mul_sim/dsp_mul.v | 338 | ||||
| -rw-r--r-- | ip/dsp_mul_sim/mentor/msim_setup.tcl | 272 | ||||
| -rwxr-xr-x | ip/dsp_mul_sim/synopsys/vcs/vcs_setup.sh | 152 | ||||
| -rw-r--r-- | ip/dsp_mul_sim/synopsys/vcsmx/synopsys_sim.setup | 12 | ||||
| -rwxr-xr-x | ip/dsp_mul_sim/synopsys/vcsmx/vcsmx_setup.sh | 195 |
9 files changed, 1463 insertions, 0 deletions
diff --git a/ip/dsp_mul_sim/aldec/rivierapro_setup.tcl b/ip/dsp_mul_sim/aldec/rivierapro_setup.tcl new file mode 100644 index 0000000..8936f01 --- /dev/null +++ b/ip/dsp_mul_sim/aldec/rivierapro_setup.tcl @@ -0,0 +1,278 @@ + +# (C) 2001-2022 Altera Corporation. All rights reserved. +# Your use of Altera Corporation's design tools, logic functions and +# other software and tools, and its AMPP partner logic functions, and +# any output files any of the foregoing (including device programming +# or simulation files), and any associated documentation or information +# are expressly subject to the terms and conditions of the Altera +# Program License Subscription Agreement, Altera MegaCore Function +# License Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by Altera +# or its authorized distributors. Please refer to the applicable +# agreement for further details. + +# ACDS 20.1 720 linux 2022.11.06.17:40:06 +# ---------------------------------------- +# Auto-generated simulation script rivierapro_setup.tcl +# ---------------------------------------- +# This script provides commands to simulate the following IP detected in +# your Quartus project: +# dsp_mul +# +# Altera recommends that you source this Quartus-generated IP simulation +# script from your own customized top-level script, and avoid editing this +# generated script. +# +# To write a top-level script that compiles Altera simulation libraries and +# the Quartus-generated IP in your project, along with your design and +# testbench files, copy the text from the TOP-LEVEL TEMPLATE section below +# into a new file, e.g. named "aldec.do", and modify the text as directed. +# +# ---------------------------------------- +# # TOP-LEVEL TEMPLATE - BEGIN +# # +# # QSYS_SIMDIR is used in the Quartus-generated IP simulation script to +# # construct paths to the files required to simulate the IP in your Quartus +# # project. By default, the IP script assumes that you are launching the +# # simulator from the IP script location. If launching from another +# # location, set QSYS_SIMDIR to the output directory you specified when you +# # generated the IP script, relative to the directory from which you launch +# # the simulator. +# # +# set QSYS_SIMDIR <script generation output directory> +# # +# # Source the generated IP simulation script. +# source $QSYS_SIMDIR/aldec/rivierapro_setup.tcl +# # +# # Set any compilation options you require (this is unusual). +# set USER_DEFINED_COMPILE_OPTIONS <compilation options> +# set USER_DEFINED_VHDL_COMPILE_OPTIONS <compilation options for VHDL> +# set USER_DEFINED_VERILOG_COMPILE_OPTIONS <compilation options for Verilog> +# # +# # Call command to compile the Quartus EDA simulation library. +# dev_com +# # +# # Call command to compile the Quartus-generated IP simulation files. +# com +# # +# # Add commands to compile all design files and testbench files, including +# # the top level. (These are all the files required for simulation other +# # than the files compiled by the Quartus-generated IP simulation script) +# # +# vlog -sv2k5 <your compilation options> <design and testbench files> +# # +# # Set the top-level simulation or testbench module/entity name, which is +# # used by the elab command to elaborate the top level. +# # +# set TOP_LEVEL_NAME <simulation top> +# # +# # Set any elaboration options you require. +# set USER_DEFINED_ELAB_OPTIONS <elaboration options> +# # +# # Call command to elaborate your design and testbench. +# elab +# # +# # Run the simulation. +# run +# # +# # Report success to the shell. +# exit -code 0 +# # +# # TOP-LEVEL TEMPLATE - END +# ---------------------------------------- +# +# IP SIMULATION SCRIPT +# ---------------------------------------- +# If dsp_mul is one of several IP cores in your +# Quartus project, you can generate a simulation script +# suitable for inclusion in your top-level simulation +# script by running the following command line: +# +# ip-setup-simulation --quartus-project=<quartus project> +# +# ip-setup-simulation will discover the Altera IP +# within the Quartus project, and generate a unified +# script which supports all the Altera IP within the design. +# ---------------------------------------- + +# ---------------------------------------- +# Initialize variables +if ![info exists SYSTEM_INSTANCE_NAME] { + set SYSTEM_INSTANCE_NAME "" +} elseif { ![ string match "" $SYSTEM_INSTANCE_NAME ] } { + set SYSTEM_INSTANCE_NAME "/$SYSTEM_INSTANCE_NAME" +} + +if ![info exists TOP_LEVEL_NAME] { + set TOP_LEVEL_NAME "dsp_mul" +} + +if ![info exists QSYS_SIMDIR] { + set QSYS_SIMDIR "./../" +} + +if ![info exists QUARTUS_INSTALL_DIR] { + set QUARTUS_INSTALL_DIR "/nix/store/w7fwf5djgj7x4jp14b81i51c84kg010y-quartus-prime-lite-unwrapped-20.1.1.720/quartus/" +} + +if ![info exists USER_DEFINED_COMPILE_OPTIONS] { + set USER_DEFINED_COMPILE_OPTIONS "" +} +if ![info exists USER_DEFINED_VHDL_COMPILE_OPTIONS] { + set USER_DEFINED_VHDL_COMPILE_OPTIONS "" +} +if ![info exists USER_DEFINED_VERILOG_COMPILE_OPTIONS] { + set USER_DEFINED_VERILOG_COMPILE_OPTIONS "" +} +if ![info exists USER_DEFINED_ELAB_OPTIONS] { + set USER_DEFINED_ELAB_OPTIONS "" +} + +# ---------------------------------------- +# Initialize simulation properties - DO NOT MODIFY! +set ELAB_OPTIONS "" +set SIM_OPTIONS "" +if ![ string match "*-64 vsim*" [ vsim -version ] ] { +} else { +} + +set Aldec "Riviera" +if { [ string match "*Active-HDL*" [ vsim -version ] ] } { + set Aldec "Active" +} + +if { [ string match "Active" $Aldec ] } { + scripterconf -tcl + createdesign "$TOP_LEVEL_NAME" "." + opendesign "$TOP_LEVEL_NAME" +} + +# ---------------------------------------- +# Copy ROM/RAM files to simulation directory +alias file_copy { + echo "\[exec\] file_copy" +} + +# ---------------------------------------- +# Create compilation libraries +proc ensure_lib { lib } { if ![file isdirectory $lib] { vlib $lib } } +ensure_lib ./libraries +ensure_lib ./libraries/work +vmap work ./libraries/work +ensure_lib ./libraries/altera_ver +vmap altera_ver ./libraries/altera_ver +ensure_lib ./libraries/lpm_ver +vmap lpm_ver ./libraries/lpm_ver +ensure_lib ./libraries/sgate_ver +vmap sgate_ver ./libraries/sgate_ver +ensure_lib ./libraries/altera_mf_ver +vmap altera_mf_ver ./libraries/altera_mf_ver +ensure_lib ./libraries/altera_lnsim_ver +vmap altera_lnsim_ver ./libraries/altera_lnsim_ver +ensure_lib ./libraries/cyclonev_ver +vmap cyclonev_ver ./libraries/cyclonev_ver +ensure_lib ./libraries/cyclonev_hssi_ver +vmap cyclonev_hssi_ver ./libraries/cyclonev_hssi_ver +ensure_lib ./libraries/cyclonev_pcie_hip_ver +vmap cyclonev_pcie_hip_ver ./libraries/cyclonev_pcie_hip_ver + + +# ---------------------------------------- +# Compile device library files +alias dev_com { + echo "\[exec\] dev_com" + eval vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_primitives.v" -work altera_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/220model.v" -work lpm_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/sgate.v" -work sgate_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_mf.v" -work altera_mf_ver + vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_lnsim.sv" -work altera_lnsim_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/aldec/cyclonev_atoms_ncrypt.v" -work cyclonev_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/aldec/cyclonev_hmi_atoms_ncrypt.v" -work cyclonev_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_atoms.v" -work cyclonev_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/aldec/cyclonev_hssi_atoms_ncrypt.v" -work cyclonev_hssi_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_hssi_atoms.v" -work cyclonev_hssi_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/aldec/cyclonev_pcie_hip_atoms_ncrypt.v" -work cyclonev_pcie_hip_ver + vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_pcie_hip_atoms.v" -work cyclonev_pcie_hip_ver +} + +# ---------------------------------------- +# Compile the design files in correct order +alias com { + echo "\[exec\] com" + eval vlog -v2k5 $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QSYS_SIMDIR/dsp_mul.v" +} + +# ---------------------------------------- +# Elaborate top level design +alias elab { + echo "\[exec\] elab" + eval vsim +access +r -t ps $ELAB_OPTIONS -L work -L altera_ver -L lpm_ver -L sgate_ver -L altera_mf_ver -L altera_lnsim_ver -L cyclonev_ver -L cyclonev_hssi_ver -L cyclonev_pcie_hip_ver $TOP_LEVEL_NAME +} + +# ---------------------------------------- +# Elaborate the top level design with -dbg -O2 option +alias elab_debug { + echo "\[exec\] elab_debug" + eval vsim -dbg -O2 +access +r -t ps $ELAB_OPTIONS -L work -L altera_ver -L lpm_ver -L sgate_ver -L altera_mf_ver -L altera_lnsim_ver -L cyclonev_ver -L cyclonev_hssi_ver -L cyclonev_pcie_hip_ver $TOP_LEVEL_NAME +} + +# ---------------------------------------- +# Compile all the design files and elaborate the top level design +alias ld " + dev_com + com + elab +" + +# ---------------------------------------- +# Compile all the design files and elaborate the top level design with -dbg -O2 +alias ld_debug " + dev_com + com + elab_debug +" + +# ---------------------------------------- +# Print out user commmand line aliases +alias h { + echo "List Of Command Line Aliases" + echo + echo "file_copy -- Copy ROM/RAM files to simulation directory" + echo + echo "dev_com -- Compile device library files" + echo + echo "com -- Compile the design files in correct order" + echo + echo "elab -- Elaborate top level design" + echo + echo "elab_debug -- Elaborate the top level design with -dbg -O2 option" + echo + echo "ld -- Compile all the design files and elaborate the top level design" + echo + echo "ld_debug -- Compile all the design files and elaborate the top level design with -dbg -O2" + echo + echo + echo + echo "List Of Variables" + echo + echo "TOP_LEVEL_NAME -- Top level module name." + echo " For most designs, this should be overridden" + echo " to enable the elab/elab_debug aliases." + echo + echo "SYSTEM_INSTANCE_NAME -- Instantiated system module name inside top level module." + echo + echo "QSYS_SIMDIR -- Platform Designer base simulation directory." + echo + echo "QUARTUS_INSTALL_DIR -- Quartus installation directory." + echo + echo "USER_DEFINED_COMPILE_OPTIONS -- User-defined compile options, added to com/dev_com aliases." + echo + echo "USER_DEFINED_ELAB_OPTIONS -- User-defined elaboration options, added to elab/elab_debug aliases." + echo + echo "USER_DEFINED_VHDL_COMPILE_OPTIONS -- User-defined vhdl compile options, added to com/dev_com aliases." + echo + echo "USER_DEFINED_VERILOG_COMPILE_OPTIONS -- User-defined verilog compile options, added to com/dev_com aliases." +} +file_copy +h diff --git a/ip/dsp_mul_sim/cadence/cds.lib b/ip/dsp_mul_sim/cadence/cds.lib new file mode 100644 index 0000000..b2eae0a --- /dev/null +++ b/ip/dsp_mul_sim/cadence/cds.lib @@ -0,0 +1,19 @@ + +DEFINE std $CDS_ROOT/tools/inca/files/STD/ +DEFINE synopsys $CDS_ROOT/tools/inca/files/SYNOPSYS/ +DEFINE ieee $CDS_ROOT/tools/inca/files/IEEE/ +DEFINE ambit $CDS_ROOT/tools/inca/files/AMBIT/ +DEFINE vital_memory $CDS_ROOT/tools/inca/files/VITAL_MEMORY/ +DEFINE ncutils $CDS_ROOT/tools/inca/files/NCUTILS/ +DEFINE ncinternal $CDS_ROOT/tools/inca/files/NCINTERNAL/ +DEFINE ncmodels $CDS_ROOT/tools/inca/files/NCMODELS/ +DEFINE cds_assertions $CDS_ROOT/tools/inca/files/CDS_ASSERTIONS/ +DEFINE work ./libraries/work/ +DEFINE altera_ver ./libraries/altera_ver/ +DEFINE lpm_ver ./libraries/lpm_ver/ +DEFINE sgate_ver ./libraries/sgate_ver/ +DEFINE altera_mf_ver ./libraries/altera_mf_ver/ +DEFINE altera_lnsim_ver ./libraries/altera_lnsim_ver/ +DEFINE cyclonev_ver ./libraries/cyclonev_ver/ +DEFINE cyclonev_hssi_ver ./libraries/cyclonev_hssi_ver/ +DEFINE cyclonev_pcie_hip_ver ./libraries/cyclonev_pcie_hip_ver/ diff --git a/ip/dsp_mul_sim/cadence/hdl.var b/ip/dsp_mul_sim/cadence/hdl.var new file mode 100644 index 0000000..c1b7814 --- /dev/null +++ b/ip/dsp_mul_sim/cadence/hdl.var @@ -0,0 +1,2 @@ + +DEFINE WORK work diff --git a/ip/dsp_mul_sim/cadence/ncsim_setup.sh b/ip/dsp_mul_sim/cadence/ncsim_setup.sh new file mode 100755 index 0000000..77f7887 --- /dev/null +++ b/ip/dsp_mul_sim/cadence/ncsim_setup.sh @@ -0,0 +1,195 @@ + +# (C) 2001-2022 Altera Corporation. All rights reserved. +# Your use of Altera Corporation's design tools, logic functions and +# other software and tools, and its AMPP partner logic functions, and +# any output files any of the foregoing (including device programming +# or simulation files), and any associated documentation or information +# are expressly subject to the terms and conditions of the Altera +# Program License Subscription Agreement, Altera MegaCore Function +# License Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by Altera +# or its authorized distributors. Please refer to the applicable +# agreement for further details. + +# ACDS 20.1 720 linux 2022.11.06.17:40:06 + +# ---------------------------------------- +# ncsim - auto-generated simulation script + +# ---------------------------------------- +# This script provides commands to simulate the following IP detected in +# your Quartus project: +# dsp_mul +# +# Altera recommends that you source this Quartus-generated IP simulation +# script from your own customized top-level script, and avoid editing this +# generated script. +# +# To write a top-level shell script that compiles Altera simulation libraries +# and the Quartus-generated IP in your project, along with your design and +# testbench files, copy the text from the TOP-LEVEL TEMPLATE section below +# into a new file, e.g. named "ncsim.sh", and modify text as directed. +# +# You can also modify the simulation flow to suit your needs. Set the +# following variables to 1 to disable their corresponding processes: +# - SKIP_FILE_COPY: skip copying ROM/RAM initialization files +# - SKIP_DEV_COM: skip compiling the Quartus EDA simulation library +# - SKIP_COM: skip compiling Quartus-generated IP simulation files +# - SKIP_ELAB and SKIP_SIM: skip elaboration and simulation +# +# ---------------------------------------- +# # TOP-LEVEL TEMPLATE - BEGIN +# # +# # QSYS_SIMDIR is used in the Quartus-generated IP simulation script to +# # construct paths to the files required to simulate the IP in your Quartus +# # project. By default, the IP script assumes that you are launching the +# # simulator from the IP script location. If launching from another +# # location, set QSYS_SIMDIR to the output directory you specified when you +# # generated the IP script, relative to the directory from which you launch +# # the simulator. In this case, you must also copy the generated files +# # "cds.lib" and "hdl.var" - plus the directory "cds_libs" if generated - +# # into the location from which you launch the simulator, or incorporate +# # into any existing library setup. +# # +# # Run Quartus-generated IP simulation script once to compile Quartus EDA +# # simulation libraries and Quartus-generated IP simulation files, and copy +# # any ROM/RAM initialization files to the simulation directory. +# # - If necessary, specify any compilation options: +# # USER_DEFINED_COMPILE_OPTIONS +# # USER_DEFINED_VHDL_COMPILE_OPTIONS applied to vhdl compiler +# # USER_DEFINED_VERILOG_COMPILE_OPTIONS applied to verilog compiler +# # +# source <script generation output directory>/cadence/ncsim_setup.sh \ +# SKIP_ELAB=1 \ +# SKIP_SIM=1 \ +# USER_DEFINED_COMPILE_OPTIONS=<compilation options for your design> \ +# USER_DEFINED_VHDL_COMPILE_OPTIONS=<VHDL compilation options for your design> \ +# USER_DEFINED_VERILOG_COMPILE_OPTIONS=<Verilog compilation options for your design> \ +# QSYS_SIMDIR=<script generation output directory> +# # +# # Compile all design files and testbench files, including the top level. +# # (These are all the files required for simulation other than the files +# # compiled by the IP script) +# # +# ncvlog <compilation options> <design and testbench files> +# # +# # TOP_LEVEL_NAME is used in this script to set the top-level simulation or +# # testbench module/entity name. +# # +# # Run the IP script again to elaborate and simulate the top level: +# # - Specify TOP_LEVEL_NAME and USER_DEFINED_ELAB_OPTIONS. +# # - Override the default USER_DEFINED_SIM_OPTIONS. For example, to run +# # until $finish(), set to an empty string: USER_DEFINED_SIM_OPTIONS="". +# # +# source <script generation output directory>/cadence/ncsim_setup.sh \ +# SKIP_FILE_COPY=1 \ +# SKIP_DEV_COM=1 \ +# SKIP_COM=1 \ +# TOP_LEVEL_NAME=<simulation top> \ +# USER_DEFINED_ELAB_OPTIONS=<elaboration options for your design> \ +# USER_DEFINED_SIM_OPTIONS=<simulation options for your design> +# # +# # TOP-LEVEL TEMPLATE - END +# ---------------------------------------- +# +# IP SIMULATION SCRIPT +# ---------------------------------------- +# If dsp_mul is one of several IP cores in your +# Quartus project, you can generate a simulation script +# suitable for inclusion in your top-level simulation +# script by running the following command line: +# +# ip-setup-simulation --quartus-project=<quartus project> +# +# ip-setup-simulation will discover the Altera IP +# within the Quartus project, and generate a unified +# script which supports all the Altera IP within the design. +# ---------------------------------------- +# ACDS 20.1 720 linux 2022.11.06.17:40:06 +# ---------------------------------------- +# initialize variables +TOP_LEVEL_NAME="dsp_mul" +QSYS_SIMDIR="./../" +QUARTUS_INSTALL_DIR="/nix/store/w7fwf5djgj7x4jp14b81i51c84kg010y-quartus-prime-lite-unwrapped-20.1.1.720/quartus/" +SKIP_FILE_COPY=0 +SKIP_DEV_COM=0 +SKIP_COM=0 +SKIP_ELAB=0 +SKIP_SIM=0 +USER_DEFINED_ELAB_OPTIONS="" +USER_DEFINED_SIM_OPTIONS="-input \"@run 100; exit\"" + +# ---------------------------------------- +# overwrite variables - DO NOT MODIFY! +# This block evaluates each command line argument, typically used for +# overwriting variables. An example usage: +# sh <simulator>_setup.sh SKIP_SIM=1 +for expression in "$@"; do + eval $expression + if [ $? -ne 0 ]; then + echo "Error: This command line argument, \"$expression\", is/has an invalid expression." >&2 + exit $? + fi +done + +# ---------------------------------------- +# initialize simulation properties - DO NOT MODIFY! +ELAB_OPTIONS="" +SIM_OPTIONS="" +if [[ `ncsim -version` != *"ncsim(64)"* ]]; then + : +else + : +fi + +# ---------------------------------------- +# create compilation libraries +mkdir -p ./libraries/work/ +mkdir -p ./libraries/altera_ver/ +mkdir -p ./libraries/lpm_ver/ +mkdir -p ./libraries/sgate_ver/ +mkdir -p ./libraries/altera_mf_ver/ +mkdir -p ./libraries/altera_lnsim_ver/ +mkdir -p ./libraries/cyclonev_ver/ +mkdir -p ./libraries/cyclonev_hssi_ver/ +mkdir -p ./libraries/cyclonev_pcie_hip_ver/ + +# ---------------------------------------- +# copy RAM/ROM files to simulation directory + +# ---------------------------------------- +# compile device library files +if [ $SKIP_DEV_COM -eq 0 ]; then + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_primitives.v" -work altera_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/220model.v" -work lpm_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/sgate.v" -work sgate_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_mf.v" -work altera_mf_ver + ncvlog -sv $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_lnsim.sv" -work altera_lnsim_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cadence/cyclonev_atoms_ncrypt.v" -work cyclonev_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cadence/cyclonev_hmi_atoms_ncrypt.v" -work cyclonev_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_atoms.v" -work cyclonev_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cadence/cyclonev_hssi_atoms_ncrypt.v" -work cyclonev_hssi_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_hssi_atoms.v" -work cyclonev_hssi_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cadence/cyclonev_pcie_hip_atoms_ncrypt.v" -work cyclonev_pcie_hip_ver + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_pcie_hip_atoms.v" -work cyclonev_pcie_hip_ver +fi + +# ---------------------------------------- +# compile design files in correct order +if [ $SKIP_COM -eq 0 ]; then + ncvlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QSYS_SIMDIR/dsp_mul.v" +fi + +# ---------------------------------------- +# elaborate top level design +if [ $SKIP_ELAB -eq 0 ]; then + export GENERIC_PARAM_COMPAT_CHECK=1 + ncelab -access +w+r+c -namemap_mixgen $ELAB_OPTIONS $USER_DEFINED_ELAB_OPTIONS $TOP_LEVEL_NAME +fi + +# ---------------------------------------- +# simulate +if [ $SKIP_SIM -eq 0 ]; then + eval ncsim -licqueue $SIM_OPTIONS $USER_DEFINED_SIM_OPTIONS $TOP_LEVEL_NAME +fi diff --git a/ip/dsp_mul_sim/dsp_mul.v b/ip/dsp_mul_sim/dsp_mul.v new file mode 100644 index 0000000..cf2fa4d --- /dev/null +++ b/ip/dsp_mul_sim/dsp_mul.v @@ -0,0 +1,338 @@ +// (C) 2001-2020 Intel Corporation. All rights reserved. +// Your use of Intel Corporation's design tools, logic functions and other +// software and tools, and its AMPP partner logic functions, and any output +// files from any of the foregoing (including device programming or simulation +// files), and any associated documentation or information are expressly subject +// to the terms and conditions of the Intel Program License Subscription +// Agreement, Intel FPGA IP License Agreement, or other applicable +// license agreement, including, without limitation, that your use is for the +// sole purpose of programming logic devices manufactured by Intel and sold by +// Intel or its authorized distributors. Please refer to the applicable +// agreement for further details. + + +// synopsys translate_off +`timescale 1 ps / 1 ps +// synopsys translate_on +module dsp_mul ( + aclr0, + chainin, + clock0, + dataa_0, + datab_0, + ena0, + signa, + signb, + result); + + input aclr0; + input [63:0] chainin; + input clock0; + input [31:0] dataa_0; + input [31:0] datab_0; + input ena0; + input signa; + input signb; + output [63:0] result; + + wire [63:0] sub_wire0; + wire [63:0] result = sub_wire0[63:0]; + + wire [31:0] wire_dataa; + assign wire_dataa[31:0] = dataa_0; + + wire [31:0] wire_datab; + assign wire_datab[31:0] = datab_0; + + altera_mult_add altera_mult_add_component ( + .aclr0 (aclr0), + .chainin (chainin), + .clock0 (clock0), + .ena0 (ena0), + .signa (signa), + .signb (signb), + .dataa (wire_dataa), + .datab (wire_datab), + .result (sub_wire0), + .accum_sload (1'b0), + .aclr1 (1'b0), + .aclr2 (1'b0), + .aclr3 (1'b0), + .addnsub1 (1'b1), + .addnsub1_round (1'b0), + .addnsub3 (1'b1), + .addnsub3_round (1'b0), + .chainout_round (1'b0), + .chainout_sat_overflow (), + .chainout_saturate (1'b0), + .clock1 (1'b1), + .clock2 (1'b1), + .clock3 (1'b1), + .coefsel0 ({3{1'b0}}), + .coefsel1 ({3{1'b0}}), + .coefsel2 ({3{1'b0}}), + .coefsel3 ({3{1'b0}}), + .datac ({16{1'b0}}), + .ena1 (1'b1), + .ena2 (1'b1), + .ena3 (1'b1), + .mult01_round (1'b0), + .mult01_saturation (1'b0), + .mult0_is_saturated (), + .mult1_is_saturated (), + .mult23_round (1'b0), + .mult23_saturation (1'b0), + .mult2_is_saturated (), + .mult3_is_saturated (), + .negate (1'b0), + .output_round (1'b0), + .output_saturate (1'b0), + .overflow (), + .rotate (1'b0), + .scanina ({32{1'b0}}), + .scaninb ({32{1'b0}}), + .scanouta (), + .scanoutb (), + .sclr0 (1'b0), + .sclr1 (1'b0), + .sclr2 (1'b0), + .sclr3 (1'b0), + .shift_right (1'b0), + .sload_accum (1'b0), + .sourcea ({1{1'b0}}), + .sourceb ({1{1'b0}}), + .zero_chainout (1'b0), + .zero_loopback (1'b0)); + defparam + altera_mult_add_component.number_of_multipliers = 1, + altera_mult_add_component.width_a = 32, + altera_mult_add_component.width_b = 32, + altera_mult_add_component.width_result = 64, + altera_mult_add_component.output_register = "CLOCK0", + altera_mult_add_component.output_aclr = "ACLR0", + altera_mult_add_component.output_sclr = "NONE", + altera_mult_add_component.multiplier1_direction = "ADD", + altera_mult_add_component.port_addnsub1 = "PORT_UNUSED", + altera_mult_add_component.addnsub_multiplier_register1 = "UNREGISTERED", + altera_mult_add_component.addnsub_multiplier_aclr1 = "NONE", + altera_mult_add_component.addnsub_multiplier_sclr1 = "NONE", + altera_mult_add_component.multiplier3_direction = "ADD", + altera_mult_add_component.port_addnsub3 = "PORT_UNUSED", + altera_mult_add_component.addnsub_multiplier_register3 = "UNREGISTERED", + altera_mult_add_component.addnsub_multiplier_aclr3 = "NONE", + altera_mult_add_component.addnsub_multiplier_sclr3 = "NONE", + altera_mult_add_component.use_subnadd = "NO", + altera_mult_add_component.representation_a = "UNSIGNED", + altera_mult_add_component.port_signa = "PORT_USED", + altera_mult_add_component.signed_register_a = "CLOCK0", + altera_mult_add_component.signed_aclr_a = "ACLR0", + altera_mult_add_component.signed_sclr_a = "NONE", + altera_mult_add_component.port_signb = "PORT_USED", + altera_mult_add_component.representation_b = "UNSIGNED", + altera_mult_add_component.signed_register_b = "CLOCK0", + altera_mult_add_component.signed_aclr_b = "ACLR0", + altera_mult_add_component.signed_sclr_b = "NONE", + altera_mult_add_component.input_register_a0 = "CLOCK0", + altera_mult_add_component.input_register_a1 = "UNREGISTERED", + altera_mult_add_component.input_register_a2 = "UNREGISTERED", + altera_mult_add_component.input_register_a3 = "UNREGISTERED", + altera_mult_add_component.input_aclr_a0 = "ACLR0", + altera_mult_add_component.input_aclr_a1 = "NONE", + altera_mult_add_component.input_aclr_a2 = "NONE", + altera_mult_add_component.input_aclr_a3 = "NONE", + altera_mult_add_component.input_sclr_a0 = "NONE", + altera_mult_add_component.input_sclr_a1 = "NONE", + altera_mult_add_component.input_sclr_a2 = "NONE", + altera_mult_add_component.input_sclr_a3 = "NONE", + altera_mult_add_component.input_register_b0 = "CLOCK0", + altera_mult_add_component.input_register_b1 = "UNREGISTERED", + altera_mult_add_component.input_register_b2 = "UNREGISTERED", + altera_mult_add_component.input_register_b3 = "UNREGISTERED", + altera_mult_add_component.input_aclr_b0 = "ACLR0", + altera_mult_add_component.input_aclr_b1 = "NONE", + altera_mult_add_component.input_aclr_b2 = "NONE", + altera_mult_add_component.input_aclr_b3 = "NONE", + altera_mult_add_component.input_sclr_b0 = "NONE", + altera_mult_add_component.input_sclr_b1 = "NONE", + altera_mult_add_component.input_sclr_b2 = "NONE", + altera_mult_add_component.input_sclr_b3 = "NONE", + altera_mult_add_component.scanouta_register = "UNREGISTERED", + altera_mult_add_component.scanouta_aclr = "NONE", + altera_mult_add_component.scanouta_sclr = "NONE", + altera_mult_add_component.input_source_a0 = "DATAA", + altera_mult_add_component.input_source_a1 = "DATAA", + altera_mult_add_component.input_source_a2 = "DATAA", + altera_mult_add_component.input_source_a3 = "DATAA", + altera_mult_add_component.input_source_b0 = "DATAB", + altera_mult_add_component.input_source_b1 = "DATAB", + altera_mult_add_component.input_source_b2 = "DATAB", + altera_mult_add_component.input_source_b3 = "DATAB", + altera_mult_add_component.multiplier_register0 = "UNREGISTERED", + altera_mult_add_component.multiplier_register1 = "UNREGISTERED", + altera_mult_add_component.multiplier_register2 = "UNREGISTERED", + altera_mult_add_component.multiplier_register3 = "UNREGISTERED", + altera_mult_add_component.multiplier_aclr0 = "NONE", + altera_mult_add_component.multiplier_aclr1 = "NONE", + altera_mult_add_component.multiplier_aclr2 = "NONE", + altera_mult_add_component.multiplier_aclr3 = "NONE", + altera_mult_add_component.multiplier_sclr0 = "NONE", + altera_mult_add_component.multiplier_sclr1 = "NONE", + altera_mult_add_component.multiplier_sclr2 = "NONE", + altera_mult_add_component.multiplier_sclr3 = "NONE", + altera_mult_add_component.preadder_mode = "SIMPLE", + altera_mult_add_component.preadder_direction_0 = "ADD", + altera_mult_add_component.preadder_direction_1 = "ADD", + altera_mult_add_component.preadder_direction_2 = "ADD", + altera_mult_add_component.preadder_direction_3 = "ADD", + altera_mult_add_component.width_c = 16, + altera_mult_add_component.input_register_c0 = "UNREGISTERED", + altera_mult_add_component.input_register_c1 = "UNREGISTERED", + altera_mult_add_component.input_register_c2 = "UNREGISTERED", + altera_mult_add_component.input_register_c3 = "UNREGISTERED", + altera_mult_add_component.input_aclr_c0 = "NONE", + altera_mult_add_component.input_aclr_c1 = "NONE", + altera_mult_add_component.input_aclr_c2 = "NONE", + altera_mult_add_component.input_aclr_c3 = "NONE", + altera_mult_add_component.input_sclr_c0 = "NONE", + altera_mult_add_component.input_sclr_c1 = "NONE", + altera_mult_add_component.input_sclr_c2 = "NONE", + altera_mult_add_component.input_sclr_c3 = "NONE", + altera_mult_add_component.width_coef = 18, + altera_mult_add_component.coefsel0_register = "UNREGISTERED", + altera_mult_add_component.coefsel1_register = "UNREGISTERED", + altera_mult_add_component.coefsel2_register = "UNREGISTERED", + altera_mult_add_component.coefsel3_register = "UNREGISTERED", + altera_mult_add_component.coefsel0_aclr = "NONE", + altera_mult_add_component.coefsel1_aclr = "NONE", + altera_mult_add_component.coefsel2_aclr = "NONE", + altera_mult_add_component.coefsel3_aclr = "NONE", + altera_mult_add_component.coefsel0_sclr = "NONE", + altera_mult_add_component.coefsel1_sclr = "NONE", + altera_mult_add_component.coefsel2_sclr = "NONE", + altera_mult_add_component.coefsel3_sclr = "NONE", + altera_mult_add_component.coef0_0 = 0, + altera_mult_add_component.coef0_1 = 0, + altera_mult_add_component.coef0_2 = 0, + altera_mult_add_component.coef0_3 = 0, + altera_mult_add_component.coef0_4 = 0, + altera_mult_add_component.coef0_5 = 0, + altera_mult_add_component.coef0_6 = 0, + altera_mult_add_component.coef0_7 = 0, + altera_mult_add_component.coef1_0 = 0, + altera_mult_add_component.coef1_1 = 0, + altera_mult_add_component.coef1_2 = 0, + altera_mult_add_component.coef1_3 = 0, + altera_mult_add_component.coef1_4 = 0, + altera_mult_add_component.coef1_5 = 0, + altera_mult_add_component.coef1_6 = 0, + altera_mult_add_component.coef1_7 = 0, + altera_mult_add_component.coef2_0 = 0, + altera_mult_add_component.coef2_1 = 0, + altera_mult_add_component.coef2_2 = 0, + altera_mult_add_component.coef2_3 = 0, + altera_mult_add_component.coef2_4 = 0, + altera_mult_add_component.coef2_5 = 0, + altera_mult_add_component.coef2_6 = 0, + altera_mult_add_component.coef2_7 = 0, + altera_mult_add_component.coef3_0 = 0, + altera_mult_add_component.coef3_1 = 0, + altera_mult_add_component.coef3_2 = 0, + altera_mult_add_component.coef3_3 = 0, + altera_mult_add_component.coef3_4 = 0, + altera_mult_add_component.coef3_5 = 0, + altera_mult_add_component.coef3_6 = 0, + altera_mult_add_component.coef3_7 = 0, + altera_mult_add_component.accumulator = "NO", + altera_mult_add_component.accum_direction = "ADD", + altera_mult_add_component.use_sload_accum_port = "NO", + altera_mult_add_component.loadconst_value = 64, + altera_mult_add_component.accum_sload_register = "UNREGISTERED", + altera_mult_add_component.accum_sload_aclr = "NONE", + altera_mult_add_component.accum_sload_sclr = "NONE", + altera_mult_add_component.double_accum = "NO", + altera_mult_add_component.width_chainin = 64, + altera_mult_add_component.chainout_adder = "YES", + altera_mult_add_component.chainout_adder_direction = "ADD", + altera_mult_add_component.port_negate = "PORT_UNUSED", + altera_mult_add_component.negate_register = "UNREGISTERED", + altera_mult_add_component.negate_aclr = "NONE", + altera_mult_add_component.negate_sclr = "NONE", + altera_mult_add_component.systolic_delay1 = "UNREGISTERED", + altera_mult_add_component.systolic_aclr1 = "NONE", + altera_mult_add_component.systolic_sclr1 = "NONE", + altera_mult_add_component.systolic_delay3 = "UNREGISTERED", + altera_mult_add_component.systolic_aclr3 = "NONE", + altera_mult_add_component.systolic_sclr3 = "NONE", + altera_mult_add_component.latency = 0, + altera_mult_add_component.input_a0_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_a1_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_a2_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_a3_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_a0_latency_aclr = "NONE", + altera_mult_add_component.input_a1_latency_aclr = "NONE", + altera_mult_add_component.input_a2_latency_aclr = "NONE", + altera_mult_add_component.input_a3_latency_aclr = "NONE", + altera_mult_add_component.input_a0_latency_sclr = "NONE", + altera_mult_add_component.input_a1_latency_sclr = "NONE", + altera_mult_add_component.input_a2_latency_sclr = "NONE", + altera_mult_add_component.input_a3_latency_sclr = "NONE", + altera_mult_add_component.input_b0_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_b1_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_b2_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_b3_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_b0_latency_aclr = "NONE", + altera_mult_add_component.input_b1_latency_aclr = "NONE", + altera_mult_add_component.input_b2_latency_aclr = "NONE", + altera_mult_add_component.input_b3_latency_aclr = "NONE", + altera_mult_add_component.input_b0_latency_sclr = "NONE", + altera_mult_add_component.input_b1_latency_sclr = "NONE", + altera_mult_add_component.input_b2_latency_sclr = "NONE", + altera_mult_add_component.input_b3_latency_sclr = "NONE", + altera_mult_add_component.input_c0_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_c1_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_c2_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_c3_latency_clock = "UNREGISTERED", + altera_mult_add_component.input_c0_latency_aclr = "NONE", + altera_mult_add_component.input_c1_latency_aclr = "NONE", + altera_mult_add_component.input_c2_latency_aclr = "NONE", + altera_mult_add_component.input_c3_latency_aclr = "NONE", + altera_mult_add_component.input_c0_latency_sclr = "NONE", + altera_mult_add_component.input_c1_latency_sclr = "NONE", + altera_mult_add_component.input_c2_latency_sclr = "NONE", + altera_mult_add_component.input_c3_latency_sclr = "NONE", + altera_mult_add_component.coefsel0_latency_clock = "UNREGISTERED", + altera_mult_add_component.coefsel1_latency_clock = "UNREGISTERED", + altera_mult_add_component.coefsel2_latency_clock = "UNREGISTERED", + altera_mult_add_component.coefsel3_latency_clock = "UNREGISTERED", + altera_mult_add_component.coefsel0_latency_aclr = "NONE", + altera_mult_add_component.coefsel1_latency_aclr = "NONE", + altera_mult_add_component.coefsel2_latency_aclr = "NONE", + altera_mult_add_component.coefsel3_latency_aclr = "NONE", + altera_mult_add_component.coefsel0_latency_sclr = "NONE", + altera_mult_add_component.coefsel1_latency_sclr = "NONE", + altera_mult_add_component.coefsel2_latency_sclr = "NONE", + altera_mult_add_component.coefsel3_latency_sclr = "NONE", + altera_mult_add_component.signed_latency_clock_a = "UNREGISTERED", + altera_mult_add_component.signed_latency_aclr_a = "NONE", + altera_mult_add_component.signed_latency_sclr_a = "NONE", + altera_mult_add_component.signed_latency_clock_b = "UNREGISTERED", + altera_mult_add_component.signed_latency_aclr_b = "NONE", + altera_mult_add_component.signed_latency_sclr_b = "NONE", + altera_mult_add_component.addnsub_multiplier_latency_clock1 = "UNREGISTERED", + altera_mult_add_component.addnsub_multiplier_latency_aclr1 = "NONE", + altera_mult_add_component.addnsub_multiplier_latency_sclr1 = "NONE", + altera_mult_add_component.addnsub_multiplier_latency_clock3 = "UNREGISTERED", + altera_mult_add_component.addnsub_multiplier_latency_aclr3 = "NONE", + altera_mult_add_component.addnsub_multiplier_latency_sclr3 = "NONE", + altera_mult_add_component.accum_sload_latency_clock = "UNREGISTERED", + altera_mult_add_component.accum_sload_latency_aclr = "NONE", + altera_mult_add_component.accum_sload_latency_sclr = "NONE", + altera_mult_add_component.negate_latency_clock = "UNREGISTERED", + altera_mult_add_component.negate_latency_aclr = "NONE", + altera_mult_add_component.negate_latency_sclr = "NONE", + altera_mult_add_component.selected_device_family = "Cyclone V"; + + +endmodule + + diff --git a/ip/dsp_mul_sim/mentor/msim_setup.tcl b/ip/dsp_mul_sim/mentor/msim_setup.tcl new file mode 100644 index 0000000..d13c11e --- /dev/null +++ b/ip/dsp_mul_sim/mentor/msim_setup.tcl @@ -0,0 +1,272 @@ + +# (C) 2001-2022 Altera Corporation. All rights reserved. +# Your use of Altera Corporation's design tools, logic functions and +# other software and tools, and its AMPP partner logic functions, and +# any output files any of the foregoing (including device programming +# or simulation files), and any associated documentation or information +# are expressly subject to the terms and conditions of the Altera +# Program License Subscription Agreement, Altera MegaCore Function +# License Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by Altera +# or its authorized distributors. Please refer to the applicable +# agreement for further details. + +# ---------------------------------------- +# Auto-generated simulation script msim_setup.tcl +# ---------------------------------------- +# This script provides commands to simulate the following IP detected in +# your Quartus project: +# dsp_mul +# +# Altera recommends that you source this Quartus-generated IP simulation +# script from your own customized top-level script, and avoid editing this +# generated script. +# +# To write a top-level script that compiles Altera simulation libraries and +# the Quartus-generated IP in your project, along with your design and +# testbench files, copy the text from the TOP-LEVEL TEMPLATE section below +# into a new file, e.g. named "mentor.do", and modify the text as directed. +# +# ---------------------------------------- +# # TOP-LEVEL TEMPLATE - BEGIN +# # +# # QSYS_SIMDIR is used in the Quartus-generated IP simulation script to +# # construct paths to the files required to simulate the IP in your Quartus +# # project. By default, the IP script assumes that you are launching the +# # simulator from the IP script location. If launching from another +# # location, set QSYS_SIMDIR to the output directory you specified when you +# # generated the IP script, relative to the directory from which you launch +# # the simulator. +# # +# set QSYS_SIMDIR <script generation output directory> +# # +# # Source the generated IP simulation script. +# source $QSYS_SIMDIR/mentor/msim_setup.tcl +# # +# # Set any compilation options you require (this is unusual). +# set USER_DEFINED_COMPILE_OPTIONS <compilation options> +# set USER_DEFINED_VHDL_COMPILE_OPTIONS <compilation options for VHDL> +# set USER_DEFINED_VERILOG_COMPILE_OPTIONS <compilation options for Verilog> +# # +# # Call command to compile the Quartus EDA simulation library. +# dev_com +# # +# # Call command to compile the Quartus-generated IP simulation files. +# com +# # +# # Add commands to compile all design files and testbench files, including +# # the top level. (These are all the files required for simulation other +# # than the files compiled by the Quartus-generated IP simulation script) +# # +# vlog <compilation options> <design and testbench files> +# # +# # Set the top-level simulation or testbench module/entity name, which is +# # used by the elab command to elaborate the top level. +# # +# set TOP_LEVEL_NAME <simulation top> +# # +# # Set any elaboration options you require. +# set USER_DEFINED_ELAB_OPTIONS <elaboration options> +# # +# # Call command to elaborate your design and testbench. +# elab +# # +# # Run the simulation. +# run -a +# # +# # Report success to the shell. +# exit -code 0 +# # +# # TOP-LEVEL TEMPLATE - END +# ---------------------------------------- +# +# IP SIMULATION SCRIPT +# ---------------------------------------- +# If dsp_mul is one of several IP cores in your +# Quartus project, you can generate a simulation script +# suitable for inclusion in your top-level simulation +# script by running the following command line: +# +# ip-setup-simulation --quartus-project=<quartus project> +# +# ip-setup-simulation will discover the Altera IP +# within the Quartus project, and generate a unified +# script which supports all the Altera IP within the design. +# ---------------------------------------- +# ACDS 20.1 720 linux 2022.11.06.17:40:06 + +# ---------------------------------------- +# Initialize variables +if ![info exists SYSTEM_INSTANCE_NAME] { + set SYSTEM_INSTANCE_NAME "" +} elseif { ![ string match "" $SYSTEM_INSTANCE_NAME ] } { + set SYSTEM_INSTANCE_NAME "/$SYSTEM_INSTANCE_NAME" +} + +if ![info exists TOP_LEVEL_NAME] { + set TOP_LEVEL_NAME "dsp_mul" +} + +if ![info exists QSYS_SIMDIR] { + set QSYS_SIMDIR "./../" +} + +if ![info exists QUARTUS_INSTALL_DIR] { + set QUARTUS_INSTALL_DIR "/nix/store/w7fwf5djgj7x4jp14b81i51c84kg010y-quartus-prime-lite-unwrapped-20.1.1.720/quartus/" +} + +if ![info exists USER_DEFINED_COMPILE_OPTIONS] { + set USER_DEFINED_COMPILE_OPTIONS "" +} +if ![info exists USER_DEFINED_VHDL_COMPILE_OPTIONS] { + set USER_DEFINED_VHDL_COMPILE_OPTIONS "" +} +if ![info exists USER_DEFINED_VERILOG_COMPILE_OPTIONS] { + set USER_DEFINED_VERILOG_COMPILE_OPTIONS "" +} +if ![info exists USER_DEFINED_ELAB_OPTIONS] { + set USER_DEFINED_ELAB_OPTIONS "" +} + +# ---------------------------------------- +# Initialize simulation properties - DO NOT MODIFY! +set ELAB_OPTIONS "" +set SIM_OPTIONS "" +if ![ string match "*-64 vsim*" [ vsim -version ] ] { +} else { +} + +# ---------------------------------------- +# Copy ROM/RAM files to simulation directory +alias file_copy { + echo "\[exec\] file_copy" +} + +# ---------------------------------------- +# Create compilation libraries +proc ensure_lib { lib } { if ![file isdirectory $lib] { vlib $lib } } +ensure_lib ./libraries/ +ensure_lib ./libraries/work/ +vmap work ./libraries/work/ +vmap work_lib ./libraries/work/ +if ![ string match "*ModelSim ALTERA*" [ vsim -version ] ] { + ensure_lib ./libraries/altera_ver/ + vmap altera_ver ./libraries/altera_ver/ + ensure_lib ./libraries/lpm_ver/ + vmap lpm_ver ./libraries/lpm_ver/ + ensure_lib ./libraries/sgate_ver/ + vmap sgate_ver ./libraries/sgate_ver/ + ensure_lib ./libraries/altera_mf_ver/ + vmap altera_mf_ver ./libraries/altera_mf_ver/ + ensure_lib ./libraries/altera_lnsim_ver/ + vmap altera_lnsim_ver ./libraries/altera_lnsim_ver/ + ensure_lib ./libraries/cyclonev_ver/ + vmap cyclonev_ver ./libraries/cyclonev_ver/ + ensure_lib ./libraries/cyclonev_hssi_ver/ + vmap cyclonev_hssi_ver ./libraries/cyclonev_hssi_ver/ + ensure_lib ./libraries/cyclonev_pcie_hip_ver/ + vmap cyclonev_pcie_hip_ver ./libraries/cyclonev_pcie_hip_ver/ +} + + +# ---------------------------------------- +# Compile device library files +alias dev_com { + echo "\[exec\] dev_com" + if ![ string match "*ModelSim ALTERA*" [ vsim -version ] ] { + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_primitives.v" -work altera_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/220model.v" -work lpm_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/sgate.v" -work sgate_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_mf.v" -work altera_mf_ver + eval vlog -sv $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_lnsim.sv" -work altera_lnsim_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/mentor/cyclonev_atoms_ncrypt.v" -work cyclonev_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/mentor/cyclonev_hmi_atoms_ncrypt.v" -work cyclonev_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_atoms.v" -work cyclonev_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/mentor/cyclonev_hssi_atoms_ncrypt.v" -work cyclonev_hssi_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_hssi_atoms.v" -work cyclonev_hssi_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/mentor/cyclonev_pcie_hip_atoms_ncrypt.v" -work cyclonev_pcie_hip_ver + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_pcie_hip_atoms.v" -work cyclonev_pcie_hip_ver + } +} + +# ---------------------------------------- +# Compile the design files in correct order +alias com { + echo "\[exec\] com" + eval vlog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QSYS_SIMDIR/dsp_mul.v" +} + +# ---------------------------------------- +# Elaborate top level design +alias elab { + echo "\[exec\] elab" + eval vsim -t ps $ELAB_OPTIONS $USER_DEFINED_ELAB_OPTIONS -L work -L work_lib -L altera_ver -L lpm_ver -L sgate_ver -L altera_mf_ver -L altera_lnsim_ver -L cyclonev_ver -L cyclonev_hssi_ver -L cyclonev_pcie_hip_ver $TOP_LEVEL_NAME +} + +# ---------------------------------------- +# Elaborate the top level design with -voptargs=+acc option +alias elab_debug { + echo "\[exec\] elab_debug" + eval vsim -voptargs=+acc -t ps $ELAB_OPTIONS $USER_DEFINED_ELAB_OPTIONS -L work -L work_lib -L altera_ver -L lpm_ver -L sgate_ver -L altera_mf_ver -L altera_lnsim_ver -L cyclonev_ver -L cyclonev_hssi_ver -L cyclonev_pcie_hip_ver $TOP_LEVEL_NAME +} + +# ---------------------------------------- +# Compile all the design files and elaborate the top level design +alias ld " + dev_com + com + elab +" + +# ---------------------------------------- +# Compile all the design files and elaborate the top level design with -voptargs=+acc +alias ld_debug " + dev_com + com + elab_debug +" + +# ---------------------------------------- +# Print out user commmand line aliases +alias h { + echo "List Of Command Line Aliases" + echo + echo "file_copy -- Copy ROM/RAM files to simulation directory" + echo + echo "dev_com -- Compile device library files" + echo + echo "com -- Compile the design files in correct order" + echo + echo "elab -- Elaborate top level design" + echo + echo "elab_debug -- Elaborate the top level design with -voptargs=+acc option" + echo + echo "ld -- Compile all the design files and elaborate the top level design" + echo + echo "ld_debug -- Compile all the design files and elaborate the top level design with -voptargs=+acc" + echo + echo + echo + echo "List Of Variables" + echo + echo "TOP_LEVEL_NAME -- Top level module name." + echo " For most designs, this should be overridden" + echo " to enable the elab/elab_debug aliases." + echo + echo "SYSTEM_INSTANCE_NAME -- Instantiated system module name inside top level module." + echo + echo "QSYS_SIMDIR -- Platform Designer base simulation directory." + echo + echo "QUARTUS_INSTALL_DIR -- Quartus installation directory." + echo + echo "USER_DEFINED_COMPILE_OPTIONS -- User-defined compile options, added to com/dev_com aliases." + echo + echo "USER_DEFINED_ELAB_OPTIONS -- User-defined elaboration options, added to elab/elab_debug aliases." + echo + echo "USER_DEFINED_VHDL_COMPILE_OPTIONS -- User-defined vhdl compile options, added to com/dev_com aliases." + echo + echo "USER_DEFINED_VERILOG_COMPILE_OPTIONS -- User-defined verilog compile options, added to com/dev_com aliases." +} +file_copy +h diff --git a/ip/dsp_mul_sim/synopsys/vcs/vcs_setup.sh b/ip/dsp_mul_sim/synopsys/vcs/vcs_setup.sh new file mode 100755 index 0000000..4bfbc7a --- /dev/null +++ b/ip/dsp_mul_sim/synopsys/vcs/vcs_setup.sh @@ -0,0 +1,152 @@ + +# (C) 2001-2022 Altera Corporation. All rights reserved. +# Your use of Altera Corporation's design tools, logic functions and +# other software and tools, and its AMPP partner logic functions, and +# any output files any of the foregoing (including device programming +# or simulation files), and any associated documentation or information +# are expressly subject to the terms and conditions of the Altera +# Program License Subscription Agreement, Altera MegaCore Function +# License Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by Altera +# or its authorized distributors. Please refer to the applicable +# agreement for further details. + +# ACDS 20.1 720 linux 2022.11.06.17:40:06 + +# ---------------------------------------- +# vcs - auto-generated simulation script + +# ---------------------------------------- +# This script provides commands to simulate the following IP detected in +# your Quartus project: +# dsp_mul +# +# Altera recommends that you source this Quartus-generated IP simulation +# script from your own customized top-level script, and avoid editing this +# generated script. +# +# To write a top-level shell script that compiles Altera simulation libraries +# and the Quartus-generated IP in your project, along with your design and +# testbench files, follow the guidelines below. +# +# 1) Copy the shell script text from the TOP-LEVEL TEMPLATE section +# below into a new file, e.g. named "vcs_sim.sh". +# +# 2) Copy the text from the DESIGN FILE LIST & OPTIONS TEMPLATE section into +# a separate file, e.g. named "filelist.f". +# +# ---------------------------------------- +# # TOP-LEVEL TEMPLATE - BEGIN +# # +# # TOP_LEVEL_NAME is used in the Quartus-generated IP simulation script to +# # set the top-level simulation or testbench module/entity name. +# # +# # QSYS_SIMDIR is used in the Quartus-generated IP simulation script to +# # construct paths to the files required to simulate the IP in your Quartus +# # project. By default, the IP script assumes that you are launching the +# # simulator from the IP script location. If launching from another +# # location, set QSYS_SIMDIR to the output directory you specified when you +# # generated the IP script, relative to the directory from which you launch +# # the simulator. +# # +# # Source the Quartus-generated IP simulation script and do the following: +# # - Compile the Quartus EDA simulation library and IP simulation files. +# # - Specify TOP_LEVEL_NAME and QSYS_SIMDIR. +# # - Compile the design and top-level simulation module/entity using +# # information specified in "filelist.f". +# # - Override the default USER_DEFINED_SIM_OPTIONS. For example, to run +# # until $finish(), set to an empty string: USER_DEFINED_SIM_OPTIONS="". +# # - Run the simulation. +# # +# source <script generation output directory>/synopsys/vcs/vcs_setup.sh \ +# TOP_LEVEL_NAME=<simulation top> \ +# QSYS_SIMDIR=<script generation output directory> \ +# USER_DEFINED_ELAB_OPTIONS="\"-f filelist.f\"" \ +# USER_DEFINED_SIM_OPTIONS=<simulation options for your design> +# # +# # TOP-LEVEL TEMPLATE - END +# ---------------------------------------- +# +# ---------------------------------------- +# # DESIGN FILE LIST & OPTIONS TEMPLATE - BEGIN +# # +# # Compile all design files and testbench files, including the top level. +# # (These are all the files required for simulation other than the files +# # compiled by the Quartus-generated IP simulation script) +# # +# +systemverilogext+.sv +# <design and testbench files, compile-time options, elaboration options> +# # +# # DESIGN FILE LIST & OPTIONS TEMPLATE - END +# ---------------------------------------- +# +# IP SIMULATION SCRIPT +# ---------------------------------------- +# If dsp_mul is one of several IP cores in your +# Quartus project, you can generate a simulation script +# suitable for inclusion in your top-level simulation +# script by running the following command line: +# +# ip-setup-simulation --quartus-project=<quartus project> +# +# ip-setup-simulation will discover the Altera IP +# within the Quartus project, and generate a unified +# script which supports all the Altera IP within the design. +# ---------------------------------------- +# ACDS 20.1 720 linux 2022.11.06.17:40:06 +# ---------------------------------------- +# initialize variables +TOP_LEVEL_NAME="dsp_mul" +QSYS_SIMDIR="./../../" +QUARTUS_INSTALL_DIR="/nix/store/w7fwf5djgj7x4jp14b81i51c84kg010y-quartus-prime-lite-unwrapped-20.1.1.720/quartus/" +SKIP_FILE_COPY=0 +SKIP_SIM=0 +USER_DEFINED_ELAB_OPTIONS="" +USER_DEFINED_SIM_OPTIONS="+vcs+finish+100" +# ---------------------------------------- +# overwrite variables - DO NOT MODIFY! +# This block evaluates each command line argument, typically used for +# overwriting variables. An example usage: +# sh <simulator>_setup.sh SKIP_SIM=1 +for expression in "$@"; do + eval $expression + if [ $? -ne 0 ]; then + echo "Error: This command line argument, \"$expression\", is/has an invalid expression." >&2 + exit $? + fi +done + +# ---------------------------------------- +# initialize simulation properties - DO NOT MODIFY! +ELAB_OPTIONS="" +SIM_OPTIONS="" +if [[ `vcs -platform` != *"amd64"* ]]; then + : +else + : +fi + +# ---------------------------------------- +# copy RAM/ROM files to simulation directory + +vcs -lca -timescale=1ps/1ps -sverilog +verilog2001ext+.v -ntb_opts dtm $ELAB_OPTIONS $USER_DEFINED_ELAB_OPTIONS \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/altera_primitives.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/220model.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/sgate.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/altera_mf.v \ + $QUARTUS_INSTALL_DIR/eda/sim_lib/altera_lnsim.sv \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/synopsys/cyclonev_atoms_ncrypt.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/synopsys/cyclonev_hmi_atoms_ncrypt.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_atoms.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/synopsys/cyclonev_hssi_atoms_ncrypt.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_hssi_atoms.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/synopsys/cyclonev_pcie_hip_atoms_ncrypt.v \ + -v $QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_pcie_hip_atoms.v \ + $QSYS_SIMDIR/dsp_mul.v \ + -top $TOP_LEVEL_NAME +# ---------------------------------------- +# simulate +if [ $SKIP_SIM -eq 0 ]; then + ./simv $SIM_OPTIONS $USER_DEFINED_SIM_OPTIONS +fi diff --git a/ip/dsp_mul_sim/synopsys/vcsmx/synopsys_sim.setup b/ip/dsp_mul_sim/synopsys/vcsmx/synopsys_sim.setup new file mode 100644 index 0000000..0ee2069 --- /dev/null +++ b/ip/dsp_mul_sim/synopsys/vcsmx/synopsys_sim.setup @@ -0,0 +1,12 @@ + +WORK > DEFAULT +DEFAULT: ./libraries/work/ +work: ./libraries/work/ +altera_ver: ./libraries/altera_ver/ +lpm_ver: ./libraries/lpm_ver/ +sgate_ver: ./libraries/sgate_ver/ +altera_mf_ver: ./libraries/altera_mf_ver/ +altera_lnsim_ver: ./libraries/altera_lnsim_ver/ +cyclonev_ver: ./libraries/cyclonev_ver/ +cyclonev_hssi_ver: ./libraries/cyclonev_hssi_ver/ +cyclonev_pcie_hip_ver: ./libraries/cyclonev_pcie_hip_ver/ diff --git a/ip/dsp_mul_sim/synopsys/vcsmx/vcsmx_setup.sh b/ip/dsp_mul_sim/synopsys/vcsmx/vcsmx_setup.sh new file mode 100755 index 0000000..60d0552 --- /dev/null +++ b/ip/dsp_mul_sim/synopsys/vcsmx/vcsmx_setup.sh @@ -0,0 +1,195 @@ + +# (C) 2001-2022 Altera Corporation. All rights reserved. +# Your use of Altera Corporation's design tools, logic functions and +# other software and tools, and its AMPP partner logic functions, and +# any output files any of the foregoing (including device programming +# or simulation files), and any associated documentation or information +# are expressly subject to the terms and conditions of the Altera +# Program License Subscription Agreement, Altera MegaCore Function +# License Agreement, or other applicable license agreement, including, +# without limitation, that your use is for the sole purpose of +# programming logic devices manufactured by Altera and sold by Altera +# or its authorized distributors. Please refer to the applicable +# agreement for further details. + +# ACDS 20.1 720 linux 2022.11.06.17:40:06 + +# ---------------------------------------- +# vcsmx - auto-generated simulation script + +# ---------------------------------------- +# This script provides commands to simulate the following IP detected in +# your Quartus project: +# dsp_mul +# +# Altera recommends that you source this Quartus-generated IP simulation +# script from your own customized top-level script, and avoid editing this +# generated script. +# +# To write a top-level shell script that compiles Altera simulation libraries +# and the Quartus-generated IP in your project, along with your design and +# testbench files, copy the text from the TOP-LEVEL TEMPLATE section below +# into a new file, e.g. named "vcsmx_sim.sh", and modify text as directed. +# +# You can also modify the simulation flow to suit your needs. Set the +# following variables to 1 to disable their corresponding processes: +# - SKIP_FILE_COPY: skip copying ROM/RAM initialization files +# - SKIP_DEV_COM: skip compiling the Quartus EDA simulation library +# - SKIP_COM: skip compiling Quartus-generated IP simulation files +# - SKIP_ELAB and SKIP_SIM: skip elaboration and simulation +# +# ---------------------------------------- +# # TOP-LEVEL TEMPLATE - BEGIN +# # +# # QSYS_SIMDIR is used in the Quartus-generated IP simulation script to +# # construct paths to the files required to simulate the IP in your Quartus +# # project. By default, the IP script assumes that you are launching the +# # simulator from the IP script location. If launching from another +# # location, set QSYS_SIMDIR to the output directory you specified when you +# # generated the IP script, relative to the directory from which you launch +# # the simulator. In this case, you must also copy the generated library +# # setup "synopsys_sim.setup" into the location from which you launch the +# # simulator, or incorporate into any existing library setup. +# # +# # Run Quartus-generated IP simulation script once to compile Quartus EDA +# # simulation libraries and Quartus-generated IP simulation files, and copy +# # any ROM/RAM initialization files to the simulation directory. +# # +# # - If necessary, specify any compilation options: +# # USER_DEFINED_COMPILE_OPTIONS +# # USER_DEFINED_VHDL_COMPILE_OPTIONS applied to vhdl compiler +# # USER_DEFINED_VERILOG_COMPILE_OPTIONS applied to verilog compiler +# # +# source <script generation output directory>/synopsys/vcsmx/vcsmx_setup.sh \ +# SKIP_ELAB=1 \ +# SKIP_SIM=1 \ +# USER_DEFINED_COMPILE_OPTIONS=<compilation options for your design> \ +# USER_DEFINED_VHDL_COMPILE_OPTIONS=<VHDL compilation options for your design> \ +# USER_DEFINED_VERILOG_COMPILE_OPTIONS=<Verilog compilation options for your design> \ +# QSYS_SIMDIR=<script generation output directory> +# # +# # Compile all design files and testbench files, including the top level. +# # (These are all the files required for simulation other than the files +# # compiled by the IP script) +# # +# vlogan <compilation options> <design and testbench files> +# # +# # TOP_LEVEL_NAME is used in this script to set the top-level simulation or +# # testbench module/entity name. +# # +# # Run the IP script again to elaborate and simulate the top level: +# # - Specify TOP_LEVEL_NAME and USER_DEFINED_ELAB_OPTIONS. +# # - Override the default USER_DEFINED_SIM_OPTIONS. For example, to run +# # until $finish(), set to an empty string: USER_DEFINED_SIM_OPTIONS="". +# # +# source <script generation output directory>/synopsys/vcsmx/vcsmx_setup.sh \ +# SKIP_FILE_COPY=1 \ +# SKIP_DEV_COM=1 \ +# SKIP_COM=1 \ +# TOP_LEVEL_NAME="'-top <simulation top>'" \ +# QSYS_SIMDIR=<script generation output directory> \ +# USER_DEFINED_ELAB_OPTIONS=<elaboration options for your design> \ +# USER_DEFINED_SIM_OPTIONS=<simulation options for your design> +# # +# # TOP-LEVEL TEMPLATE - END +# ---------------------------------------- +# +# IP SIMULATION SCRIPT +# ---------------------------------------- +# If dsp_mul is one of several IP cores in your +# Quartus project, you can generate a simulation script +# suitable for inclusion in your top-level simulation +# script by running the following command line: +# +# ip-setup-simulation --quartus-project=<quartus project> +# +# ip-setup-simulation will discover the Altera IP +# within the Quartus project, and generate a unified +# script which supports all the Altera IP within the design. +# ---------------------------------------- +# ACDS 20.1 720 linux 2022.11.06.17:40:06 +# ---------------------------------------- +# initialize variables +TOP_LEVEL_NAME="dsp_mul" +QSYS_SIMDIR="./../../" +QUARTUS_INSTALL_DIR="/nix/store/w7fwf5djgj7x4jp14b81i51c84kg010y-quartus-prime-lite-unwrapped-20.1.1.720/quartus/" +SKIP_FILE_COPY=0 +SKIP_DEV_COM=0 +SKIP_COM=0 +SKIP_ELAB=0 +SKIP_SIM=0 +USER_DEFINED_ELAB_OPTIONS="" +USER_DEFINED_SIM_OPTIONS="+vcs+finish+100" + +# ---------------------------------------- +# overwrite variables - DO NOT MODIFY! +# This block evaluates each command line argument, typically used for +# overwriting variables. An example usage: +# sh <simulator>_setup.sh SKIP_SIM=1 +for expression in "$@"; do + eval $expression + if [ $? -ne 0 ]; then + echo "Error: This command line argument, \"$expression\", is/has an invalid expression." >&2 + exit $? + fi +done + +# ---------------------------------------- +# initialize simulation properties - DO NOT MODIFY! +ELAB_OPTIONS="" +SIM_OPTIONS="" +if [[ `vcs -platform` != *"amd64"* ]]; then + : +else + : +fi + +# ---------------------------------------- +# create compilation libraries +mkdir -p ./libraries/work/ +mkdir -p ./libraries/altera_ver/ +mkdir -p ./libraries/lpm_ver/ +mkdir -p ./libraries/sgate_ver/ +mkdir -p ./libraries/altera_mf_ver/ +mkdir -p ./libraries/altera_lnsim_ver/ +mkdir -p ./libraries/cyclonev_ver/ +mkdir -p ./libraries/cyclonev_hssi_ver/ +mkdir -p ./libraries/cyclonev_pcie_hip_ver/ + +# ---------------------------------------- +# copy RAM/ROM files to simulation directory + +# ---------------------------------------- +# compile device library files +if [ $SKIP_DEV_COM -eq 0 ]; then + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_primitives.v" -work altera_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/220model.v" -work lpm_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/sgate.v" -work sgate_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_mf.v" -work altera_mf_ver + vlogan +v2k -sverilog $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/altera_lnsim.sv" -work altera_lnsim_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/synopsys/cyclonev_atoms_ncrypt.v" -work cyclonev_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/synopsys/cyclonev_hmi_atoms_ncrypt.v" -work cyclonev_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_atoms.v" -work cyclonev_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/synopsys/cyclonev_hssi_atoms_ncrypt.v" -work cyclonev_hssi_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_hssi_atoms.v" -work cyclonev_hssi_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/synopsys/cyclonev_pcie_hip_atoms_ncrypt.v" -work cyclonev_pcie_hip_ver + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QUARTUS_INSTALL_DIR/eda/sim_lib/cyclonev_pcie_hip_atoms.v" -work cyclonev_pcie_hip_ver +fi + +# ---------------------------------------- +# compile design files in correct order +if [ $SKIP_COM -eq 0 ]; then + vlogan +v2k $USER_DEFINED_VERILOG_COMPILE_OPTIONS $USER_DEFINED_COMPILE_OPTIONS "$QSYS_SIMDIR/dsp_mul.v" +fi + +# ---------------------------------------- +# elaborate top level design +if [ $SKIP_ELAB -eq 0 ]; then + vcs -lca -t ps $ELAB_OPTIONS $USER_DEFINED_ELAB_OPTIONS $TOP_LEVEL_NAME +fi + +# ---------------------------------------- +# simulate +if [ $SKIP_SIM -eq 0 ]; then + ./simv $SIM_OPTIONS $USER_DEFINED_SIM_OPTIONS +fi |
