2015-06-24 09:28:52 +00:00
|
|
|
|
|
|
|
|
2017-05-12 17:25:17 +00:00
|
|
|
package require qsys
|
2015-06-24 09:28:52 +00:00
|
|
|
source ../scripts/adi_env.tcl
|
|
|
|
source ../scripts/adi_ip_alt.tcl
|
|
|
|
|
|
|
|
|
|
|
|
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 TYPE INTEGER
|
|
|
|
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 TYPE INTEGER
|
|
|
|
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
|
|
|
|
|
2015-08-19 11:11:47 +00:00
|
|
|
ad_alt_intf signal data input NUM_OF_CHANNELS*CHANNEL_DATA_WIDTH
|
|
|
|
ad_alt_intf 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} {
|
|
|
|
ad_alt_intf 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} {
|
|
|
|
ad_alt_intf 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} {
|
|
|
|
ad_alt_intf 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} {
|
|
|
|
ad_alt_intf 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} {
|
|
|
|
ad_alt_intf 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} {
|
|
|
|
ad_alt_intf 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} {
|
|
|
|
ad_alt_intf signal split_data_7 output CHANNEL_DATA_WIDTH data
|
2015-06-24 09:28:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|