2023-07-06 12:08:22 +00:00
|
|
|
###############################################################################
|
|
|
|
## Copyright (C) 2015-2023 Analog Devices, Inc. All rights reserved.
|
|
|
|
### SPDX short identifier: ADIBSD
|
|
|
|
###############################################################################
|
2015-06-24 09:28:52 +00:00
|
|
|
|
2021-02-25 09:41:57 +00:00
|
|
|
package require qsys 14.0
|
2022-07-12 11:06:15 +00:00
|
|
|
source ../../scripts/adi_env.tcl
|
2018-08-14 10:08:06 +00:00
|
|
|
source ../scripts/adi_ip_intel.tcl
|
2015-06-24 09:28:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
set_module_property NAME util_bsplit
|
|
|
|
set_module_property DESCRIPTION "Channel Split Utility"
|
|
|
|
set_module_property VERSION 1.0
|
2015-07-17 14:07:15 +00:00
|
|
|
set_module_property GROUP "Analog Devices"
|
2015-06-24 09:28:52 +00:00
|
|
|
set_module_property DISPLAY_NAME util_bsplit
|
|
|
|
set_module_property ELABORATION_CALLBACK p_util_bsplit
|
|
|
|
|
|
|
|
# files
|
|
|
|
|
|
|
|
add_fileset quartus_synth QUARTUS_SYNTH "" "Quartus Synthesis"
|
|
|
|
set_fileset_property quartus_synth TOP_LEVEL util_bsplit
|
|
|
|
add_fileset_file util_bsplit.v VERILOG PATH util_bsplit.v TOP_LEVEL_FILE
|
|
|
|
|
|
|
|
# parameters
|
|
|
|
|
2015-08-19 11:11:47 +00:00
|
|
|
add_parameter CHANNEL_DATA_WIDTH INTEGER 0
|
|
|
|
set_parameter_property CHANNEL_DATA_WIDTH DEFAULT_VALUE 32
|
|
|
|
set_parameter_property CHANNEL_DATA_WIDTH DISPLAY_NAME CHANNEL_DATA_WIDTH
|
|
|
|
set_parameter_property CHANNEL_DATA_WIDTH UNITS None
|
|
|
|
set_parameter_property CHANNEL_DATA_WIDTH HDL_PARAMETER true
|
2015-06-24 09:28:52 +00:00
|
|
|
|
2015-08-19 11:11:47 +00:00
|
|
|
add_parameter NUM_OF_CHANNELS INTEGER 0
|
|
|
|
set_parameter_property NUM_OF_CHANNELS DEFAULT_VALUE 8
|
|
|
|
set_parameter_property NUM_OF_CHANNELS DISPLAY_NAME NUM_OF_CHANNELS
|
|
|
|
set_parameter_property NUM_OF_CHANNELS UNITS None
|
|
|
|
set_parameter_property NUM_OF_CHANNELS HDL_PARAMETER true
|
2015-06-24 09:28:52 +00:00
|
|
|
|
|
|
|
# avalon streaming
|
|
|
|
|
2018-08-14 13:53:45 +00:00
|
|
|
ad_interface signal data input NUM_OF_CHANNELS*CHANNEL_DATA_WIDTH
|
|
|
|
ad_interface signal split_data_0 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
|
|
|
|
proc p_util_bsplit {} {
|
|
|
|
|
2015-08-19 11:11:47 +00:00
|
|
|
set p_ch_cnt [get_parameter_value "NUM_OF_CHANNELS"]
|
|
|
|
set p_ch_dw [get_parameter_value "CHANNEL_DATA_WIDTH"]
|
2015-06-24 09:28:52 +00:00
|
|
|
|
2015-08-19 11:11:47 +00:00
|
|
|
if {[get_parameter_value NUM_OF_CHANNELS] > 1} {
|
2018-08-14 13:53:45 +00:00
|
|
|
ad_interface signal split_data_1 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
}
|
2015-08-19 11:11:47 +00:00
|
|
|
if {[get_parameter_value NUM_OF_CHANNELS] > 2} {
|
2018-08-14 13:53:45 +00:00
|
|
|
ad_interface signal split_data_2 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
}
|
2015-08-19 11:11:47 +00:00
|
|
|
if {[get_parameter_value NUM_OF_CHANNELS] > 3} {
|
2018-08-14 13:53:45 +00:00
|
|
|
ad_interface signal split_data_3 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
}
|
2015-08-19 11:11:47 +00:00
|
|
|
if {[get_parameter_value NUM_OF_CHANNELS] > 4} {
|
2018-08-14 13:53:45 +00:00
|
|
|
ad_interface signal split_data_4 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
}
|
2015-08-19 11:11:47 +00:00
|
|
|
if {[get_parameter_value NUM_OF_CHANNELS] > 5} {
|
2018-08-14 13:53:45 +00:00
|
|
|
ad_interface signal split_data_5 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
}
|
2015-08-19 11:11:47 +00:00
|
|
|
if {[get_parameter_value NUM_OF_CHANNELS] > 6} {
|
2018-08-14 13:53:45 +00:00
|
|
|
ad_interface signal split_data_6 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
}
|
2015-08-19 11:11:47 +00:00
|
|
|
if {[get_parameter_value NUM_OF_CHANNELS] > 7} {
|
2018-08-14 13:53:45 +00:00
|
|
|
ad_interface signal split_data_7 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|