From dc0b3db1b4f1895a07e5fe280ee3790e87f97b9f Mon Sep 17 00:00:00 2001 From: Ataberk Date: Sun, 25 Sep 2022 17:22:03 +0200 Subject: Initial commit --- .../sim_scripts/scratchpad/xsim/README.txt | 49 +++++ .../sim_scripts/scratchpad/xsim/U200.smi | 30 +++ .../sim_scripts/scratchpad/xsim/cmd.tcl | 12 ++ .../sim_scripts/scratchpad/xsim/file_info.txt | 2 + .../sim_scripts/scratchpad/xsim/glbl.v | 84 ++++++++ .../xsim/protoinst_files/bd_9f2c.protoinst | 9 + .../xsim/protoinst_files/bd_afa8.protoinst | 9 + .../xsim/protoinst_files/bd_ba6a.protoinst | 9 + .../sim_scripts/scratchpad/xsim/scratchpad.sh | 212 +++++++++++++++++++++ .../sim_scripts/scratchpad/xsim/summary.log | 20 ++ .../sim_scripts/scratchpad/xsim/vlog.prj | 6 + 11 files changed, 442 insertions(+) create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/README.txt create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/U200.smi create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/cmd.tcl create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/file_info.txt create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/glbl.v create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_9f2c.protoinst create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_afa8.protoinst create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_ba6a.protoinst create mode 100755 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/scratchpad.sh create mode 100755 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/summary.log create mode 100644 projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/vlog.prj (limited to 'projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim') diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/README.txt b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/README.txt new file mode 100644 index 0000000..2eae1bd --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/README.txt @@ -0,0 +1,49 @@ +################################################################################ +# Vivado (TM) v2020.2 (64-bit) +# +# README.txt: Please read the sections below to understand the steps required to +# run the exported script and information about the source files. +# +# Generated by export_simulation on Tue Mar 08 14:24:53 CET 2022 +# +################################################################################ + +1. How to run the generated simulation script:- + +From the shell prompt in the current directory, issue the following command:- + +./scratchpad.sh + +This command will launch the 'compile', 'elaborate' and 'simulate' functions +implemented in the script file for the 3-step flow. These functions are called +from the main 'run' function in the script file. + +The 'run' function first executes the 'setup' function, the purpose of which is to +create simulator specific setup files, create design library mappings and library +directories and copy 'glbl.v' from the Vivado software install location into the +current directory. + +The 'setup' function is also used for removing the simulator generated data in +order to reset the current directory to the original state when export_simulation +was launched from Vivado. This generated data can be removed by specifying the +'-reset_run' switch to the './scratchpad.sh' script. + +./scratchpad.sh -reset_run + +To keep the generated data from the previous run but regenerate the setup files and +library directories, use the '-noclean_files' switch. + +./scratchpad.sh -noclean_files + +For more information on the script, please type './scratchpad.sh -help'. + +2. Additional design information files:- + +export_simulation generates following additional file that can be used for fetching +the design files information or for integrating with external custom scripts. + +Name : file_info.txt +Purpose: This file contains detail design file information based on the compile order + when export_simulation was executed from Vivado. The file contains information + about the file type, name, whether it is part of the IP, associated library + and the file path information. diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/U200.smi b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/U200.smi new file mode 100644 index 0000000..f20b0a8 --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/U200.smi @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/cmd.tcl b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/cmd.tcl new file mode 100644 index 0000000..eef7a0f --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/cmd.tcl @@ -0,0 +1,12 @@ +set curr_wave [current_wave_config] +if { [string length $curr_wave] == 0 } { + if { [llength [get_objects]] > 0} { + add_wave / + set_property needs_save false [current_wave_config] + } else { + send_msg_id Add_Wave-1 WARNING "No top level signals found. Simulator will start without a wave window. If you want to open a wave window go to 'File->New Waveform Configuration' or type 'create_wave_config' in the TCL console." + } +} + +run -all +quit diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/file_info.txt b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/file_info.txt new file mode 100644 index 0000000..a593cef --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/file_info.txt @@ -0,0 +1,2 @@ +scratchpad.v,verilog,xil_defaultlib,../../../../U200.srcs/sources_1/ip/scratchpad/sim/scratchpad.v, +glbl.v,Verilog,xil_defaultlib,glbl.v diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/glbl.v b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/glbl.v new file mode 100644 index 0000000..ed3b249 --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/glbl.v @@ -0,0 +1,84 @@ +// $Header: /devl/xcs/repo/env/Databases/CAEInterfaces/verunilibs/data/glbl.v,v 1.14 2010/10/28 20:44:00 fphillip Exp $ +`ifndef GLBL +`define GLBL +`timescale 1 ps / 1 ps + +module glbl (); + + parameter ROC_WIDTH = 100000; + parameter TOC_WIDTH = 0; + parameter GRES_WIDTH = 10000; + parameter GRES_START = 10000; + +//-------- STARTUP Globals -------------- + wire GSR; + wire GTS; + wire GWE; + wire PRLD; + wire GRESTORE; + tri1 p_up_tmp; + tri (weak1, strong0) PLL_LOCKG = p_up_tmp; + + wire PROGB_GLBL; + wire CCLKO_GLBL; + wire FCSBO_GLBL; + wire [3:0] DO_GLBL; + wire [3:0] DI_GLBL; + + reg GSR_int; + reg GTS_int; + reg PRLD_int; + reg GRESTORE_int; + +//-------- JTAG Globals -------------- + wire JTAG_TDO_GLBL; + wire JTAG_TCK_GLBL; + wire JTAG_TDI_GLBL; + wire JTAG_TMS_GLBL; + wire JTAG_TRST_GLBL; + + reg JTAG_CAPTURE_GLBL; + reg JTAG_RESET_GLBL; + reg JTAG_SHIFT_GLBL; + reg JTAG_UPDATE_GLBL; + reg JTAG_RUNTEST_GLBL; + + reg JTAG_SEL1_GLBL = 0; + reg JTAG_SEL2_GLBL = 0 ; + reg JTAG_SEL3_GLBL = 0; + reg JTAG_SEL4_GLBL = 0; + + reg JTAG_USER_TDO1_GLBL = 1'bz; + reg JTAG_USER_TDO2_GLBL = 1'bz; + reg JTAG_USER_TDO3_GLBL = 1'bz; + reg JTAG_USER_TDO4_GLBL = 1'bz; + + assign (strong1, weak0) GSR = GSR_int; + assign (strong1, weak0) GTS = GTS_int; + assign (weak1, weak0) PRLD = PRLD_int; + assign (strong1, weak0) GRESTORE = GRESTORE_int; + + initial begin + GSR_int = 1'b1; + PRLD_int = 1'b1; + #(ROC_WIDTH) + GSR_int = 1'b0; + PRLD_int = 1'b0; + end + + initial begin + GTS_int = 1'b1; + #(TOC_WIDTH) + GTS_int = 1'b0; + end + + initial begin + GRESTORE_int = 1'b0; + #(GRES_START); + GRESTORE_int = 1'b1; + #(GRES_WIDTH); + GRESTORE_int = 1'b0; + end + +endmodule +`endif diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_9f2c.protoinst b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_9f2c.protoinst new file mode 100644 index 0000000..cf73fce --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_9f2c.protoinst @@ -0,0 +1,9 @@ +{ + "version": "1.0", + "modules": { + "bd_9f2c": { + "proto_instances": { + } + } + } +} diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_afa8.protoinst b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_afa8.protoinst new file mode 100644 index 0000000..a0656b6 --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_afa8.protoinst @@ -0,0 +1,9 @@ +{ + "version": "1.0", + "modules": { + "bd_afa8": { + "proto_instances": { + } + } + } +} diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_ba6a.protoinst b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_ba6a.protoinst new file mode 100644 index 0000000..c42e1c4 --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/protoinst_files/bd_ba6a.protoinst @@ -0,0 +1,9 @@ +{ + "version": "1.0", + "modules": { + "bd_ba6a": { + "proto_instances": { + } + } + } +} diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/scratchpad.sh b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/scratchpad.sh new file mode 100755 index 0000000..3ee51c2 --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/scratchpad.sh @@ -0,0 +1,212 @@ +#!/bin/bash -f +#********************************************************************************************************* +# Vivado (TM) v2020.2 (64-bit) +# +# Filename : scratchpad.sh +# Simulator : Xilinx Vivado Simulator +# Description : Simulation script for compiling, elaborating and verifying the project source files. +# The script will automatically create the design libraries sub-directories in the run +# directory, add the library logical mappings in the simulator setup file, create default +# 'do/prj' file, execute compilation, elaboration and simulation steps. +# +# Generated by Vivado on Tue Mar 08 14:24:53 CET 2022 +# SW Build 3064766 on Wed Nov 18 09:12:47 MST 2020 +# +# Copyright 1986-2020 Xilinx, Inc. All Rights Reserved. +# +# usage: scratchpad.sh [-help] +# usage: scratchpad.sh [-lib_map_path] +# usage: scratchpad.sh [-noclean_files] +# usage: scratchpad.sh [-reset_run] +# +#********************************************************************************************************* + +# Command line options +xv_boost_lib_path=/tools/Xilinx/Vivado/2020.2/tps/boost_1_64_0 +xvlog_opts="--relax -L xdma_v4_1_8" + + +# Script info +echo -e "scratchpad.sh - Script generated by export_simulation (Vivado v2020.2 (64-bit)-id)\n" + +# Main steps +run() +{ + check_args $# $1 + setup $1 $2 + compile + elaborate + simulate +} + +# RUN_STEP: +compile() +{ + # Compile design files + xvlog $xvlog_opts -prj vlog.prj 2>&1 | tee compile.log + +} + +# RUN_STEP: +elaborate() +{ + xelab --relax --debug typical --mt auto -L blk_mem_gen_v8_4_4 -L xil_defaultlib -L unisims_ver -L unimacro_ver -L secureip -L xpm --snapshot scratchpad xil_defaultlib.scratchpad xil_defaultlib.glbl -log elaborate.log +} + +# RUN_STEP: +simulate() +{ + xsim scratchpad -key {Behavioral:sim_1:Functional:scratchpad} -tclbatch cmd.tcl -protoinst "protoinst_files/bd_9f2c.protoinst" -protoinst "protoinst_files/bd_ba6a.protoinst" -protoinst "protoinst_files/bd_afa8.protoinst" -log simulate.log +} + +# STEP: setup +setup() +{ + case $1 in + "-lib_map_path" ) + if [[ ($2 == "") ]]; then + echo -e "ERROR: Simulation library directory path not specified (type \"./scratchpad.sh -help\" for more information)\n" + exit 1 + fi + copy_setup_file $2 + ;; + "-reset_run" ) + reset_run + echo -e "INFO: Simulation run files deleted.\n" + exit 0 + ;; + "-noclean_files" ) + # do not remove previous data + ;; + * ) + copy_setup_file $2 + esac + + # Add any setup/initialization commands here:- + + # + +} + +# Copy xsim.ini file +copy_setup_file() +{ + file="xsim.ini" + lib_map_path="/tools/Xilinx/Vivado/2020.2/data/xsim" + if [[ ($1 != "") ]]; then + lib_map_path="$1" + fi + if [[ ($lib_map_path != "") ]]; then + src_file="$lib_map_path/$file" + if [[ -e $src_file ]]; then + cp $src_file . + fi + + # Map local design libraries to xsim.ini + map_local_libs + + fi +} + +# Map local design libraries +map_local_libs() +{ + updated_mappings=() + local_mappings=() + + # Local design libraries + local_libs=() + + if [[ 0 == ${#local_libs[@]} ]]; then + return + fi + + file="xsim.ini" + file_backup="xsim.ini.bak" + + if [[ -e $file ]]; then + rm -f $file_backup + # Create a backup copy of the xsim.ini file + cp $file $file_backup + # Read libraries from backup file and search in local library collection + while read -r line + do + IN=$line + # Split mapping entry with '=' delimiter to fetch library name and mapping + read lib_name mapping <<<$(IFS="="; echo $IN) + # If local library found, then construct the local mapping and add to local mapping collection + if `echo ${local_libs[@]} | grep -wq $lib_name` ; then + line="$lib_name=xsim.dir/$lib_name" + local_mappings+=("$lib_name") + fi + # Add to updated library mapping collection + updated_mappings+=("$line") + done < "$file_backup" + # Append local libraries not found originally from xsim.ini + for (( i=0; i<${#local_libs[*]}; i++ )); do + lib_name="${local_libs[i]}" + if `echo ${local_mappings[@]} | grep -wvq $lib_name` ; then + line="$lib_name=xsim.dir/$lib_name" + updated_mappings+=("$line") + fi + done + # Write updated mappings in xsim.ini + rm -f $file + for (( i=0; i<${#updated_mappings[*]}; i++ )); do + lib_name="${updated_mappings[i]}" + echo $lib_name >> $file + done + else + for (( i=0; i<${#local_libs[*]}; i++ )); do + lib_name="${local_libs[i]}" + mapping="$lib_name=xsim.dir/$lib_name" + echo $mapping >> $file + done + fi +} + +# Delete generated data from the previous run +reset_run() +{ + files_to_remove=(xelab.pb xsim.jou xvhdl.log xvlog.log compile.log elaborate.log simulate.log xelab.log xsim.log run.log xvhdl.pb xvlog.pb scratchpad.wdb xsim.dir) + for (( i=0; i<${#files_to_remove[*]}; i++ )); do + file="${files_to_remove[i]}" + if [[ -e $file ]]; then + rm -rf $file + fi + done +} + +# Check command line arguments +check_args() +{ + if [[ ($1 == 1 ) && ($2 != "-lib_map_path" && $2 != "-noclean_files" && $2 != "-reset_run" && $2 != "-help" && $2 != "-h") ]]; then + echo -e "ERROR: Unknown option specified '$2' (type \"./scratchpad.sh -help\" for more information)\n" + exit 1 + fi + + if [[ ($2 == "-help" || $2 == "-h") ]]; then + usage + fi +} + +# Script usage +usage() +{ + msg="Usage: scratchpad.sh [-help]\n\ +Usage: scratchpad.sh [-lib_map_path]\n\ +Usage: scratchpad.sh [-reset_run]\n\ +Usage: scratchpad.sh [-noclean_files]\n\n\ +[-help] -- Print help information for this script\n\n\ +[-lib_map_path ] -- Compiled simulation library directory path. The simulation library is compiled\n\ +using the compile_simlib tcl command. Please see 'compile_simlib -help' for more information.\n\n\ +[-reset_run] -- Recreate simulator setup files and library mappings for a clean run. The generated files\n\ +from the previous run will be removed. If you don't want to remove the simulator generated files, use the\n\ +-noclean_files switch.\n\n\ +[-noclean_files] -- Reset previous run, but do not remove simulator generated files from the previous run.\n\n" + echo -e $msg + exit 1 +} + +# Launch script +run $1 $2 diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/summary.log b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/summary.log new file mode 100755 index 0000000..28dc68a --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/summary.log @@ -0,0 +1,20 @@ + +User Configuration +-------------------------------------------------------------------------------- +Algorithm : Minimum_Area +Memory Type : Single_Port_RAM +Port A Read Width : [32] +Port A Write Width : [32] +Memory Depth : [1024] + +---------------------------------------------------------------------------------- + +Block RAM resource(s) (18K BRAMs) : [0] +Block RAM resource(s) (36K BRAMs) : [1] +---------------------------------------------------------------------------------- +Clock A Frequency : [100] +Port A Enable Rate : [100] +Port A Write Rate : [50] +---------------------------------------------------------------------------------- +Estimated Power for IP : 2.119075 mW +---------------------------------------------------------------------------------- diff --git a/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/vlog.prj b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/vlog.prj new file mode 100644 index 0000000..cd813ef --- /dev/null +++ b/projects/U200/U200.ip_user_files/sim_scripts/scratchpad/xsim/vlog.prj @@ -0,0 +1,6 @@ +verilog xil_defaultlib \ +"../../../../U200.srcs/sources_1/ip/scratchpad/sim/scratchpad.v" \ + +verilog xil_defaultlib "glbl.v" + +nosort -- cgit v1.2.3