|
| 1 | +# Copyright (c) 2011-2024 Columbia University, System Level Design Group |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +############################################################ |
| 5 | +# Design Parameters |
| 6 | +############################################################ |
| 7 | + |
| 8 | +# |
| 9 | +# Source the common configurations |
| 10 | +# |
| 11 | +source ../../../common/hls/project.tcl |
| 12 | + |
| 13 | + |
| 14 | +# |
| 15 | +# Set the private memory library |
| 16 | +# |
| 17 | +use_hls_lib "./memlib" |
| 18 | + |
| 19 | + |
| 20 | +# |
| 21 | +# Local synthesis attributes |
| 22 | +# |
| 23 | +if {$TECH eq "virtex7"} { |
| 24 | + # Library is in ns, but simulation uses ps! |
| 25 | + set CLOCK_PERIOD 10.0 |
| 26 | + set SIM_CLOCK_PERIOD 10000.0 |
| 27 | + set_attr default_input_delay 0.1 |
| 28 | +} |
| 29 | +if {$TECH eq "zynq7000"} { |
| 30 | + # Library is in ns, but simulation uses ps! |
| 31 | + set CLOCK_PERIOD 10.0 |
| 32 | + set SIM_CLOCK_PERIOD 10000.0 |
| 33 | + set_attr default_input_delay 0.1 |
| 34 | +} |
| 35 | +if {$TECH eq "virtexu"} { |
| 36 | + # Library is in ns, but simulation uses ps! |
| 37 | + set CLOCK_PERIOD 8.0 |
| 38 | + set SIM_CLOCK_PERIOD 8000.0 |
| 39 | + set_attr default_input_delay 0.1 |
| 40 | +} |
| 41 | +if {$TECH eq "virtexup"} { |
| 42 | + # Library is in ns, but simulation uses ps! |
| 43 | + set CLOCK_PERIOD 6.4 |
| 44 | + set SIM_CLOCK_PERIOD 6400.0 |
| 45 | + set_attr default_input_delay 0.1 |
| 46 | +} |
| 47 | +if {$TECH eq "cmos32soi"} { |
| 48 | + set CLOCK_PERIOD 1000.0 |
| 49 | + set SIM_CLOCK_PERIOD 1000.0 |
| 50 | + set_attr default_input_delay 100.0 |
| 51 | +} |
| 52 | +if {$TECH eq "gf12"} { |
| 53 | + set CLOCK_PERIOD 1.0 |
| 54 | + set SIM_CLOCK_PERIOD 1.0 |
| 55 | + set_attr default_input_delay 0.1 |
| 56 | +} |
| 57 | +set_attr clock_period $CLOCK_PERIOD |
| 58 | + |
| 59 | + |
| 60 | +# |
| 61 | +# System level modules to be synthesized |
| 62 | +# |
| 63 | +define_hls_module test ../src/test.cpp |
| 64 | + |
| 65 | + |
| 66 | +# |
| 67 | +# Testbench or system level modules |
| 68 | +# |
| 69 | +define_system_module tb ../tb/system.cpp ../tb/sc_main.cpp |
| 70 | + |
| 71 | +###################################################################### |
| 72 | +# HLS and Simulation configurations |
| 73 | +###################################################################### |
| 74 | +set DEFAULT_ARGV "" |
| 75 | + |
| 76 | +foreach dma [list 32 64] { |
| 77 | + define_io_config * IOCFG_DMA$dma -DDMA_WIDTH=$dma |
| 78 | + |
| 79 | + define_system_config tb TESTBENCH_DMA$dma -io_config IOCFG_DMA$dma |
| 80 | + |
| 81 | + define_sim_config "BEHAV_DMA$dma" "test BEH" "tb TESTBENCH_DMA$dma" -io_config IOCFG_DMA$dma -argv $DEFAULT_ARGV |
| 82 | + |
| 83 | + foreach cfg [list BASIC] { |
| 84 | + set cname $cfg\_DMA$dma |
| 85 | + define_hls_config test $cname -io_config IOCFG_DMA$dma --clock_period=$CLOCK_PERIOD $COMMON_HLS_FLAGS -DHLS_DIRECTIVES_$cfg |
| 86 | + if {$TECH_IS_XILINX == 1} { |
| 87 | + define_sim_config "$cname\_V" "test RTL_V $cname" "tb TESTBENCH_DMA$dma" -io_config IOCFG_DMA$dma -argv $DEFAULT_ARGV -verilog_top_modules glbl |
| 88 | + } else { |
| 89 | + define_sim_config "$cname\_V" "test RTL_V $cname" "tb TESTBENCH_DMA$dma" -io_config IOCFG_DMA$dma -argv $DEFAULT_ARGV |
| 90 | + } |
| 91 | + } |
| 92 | +} |
| 93 | + |
| 94 | +# |
| 95 | +# Compile Flags |
| 96 | +# |
| 97 | +set_attr hls_cc_options "$INCLUDES" |
| 98 | + |
| 99 | +# |
| 100 | +# Simulation Options |
| 101 | +# |
| 102 | +use_systemc_simulator xcelium |
| 103 | +set_attr cc_options "$INCLUDES -DCLOCK_PERIOD=$SIM_CLOCK_PERIOD" |
| 104 | +# enable_waveform_logging -vcd |
| 105 | +set_attr end_of_sim_command "make saySimPassed" |
0 commit comments