# Creating SmartDesign "Alpha_Blending_4pixel"
set sd_name {Alpha_Blending_4pixel}
create_smartdesign -sd_name ${sd_name}

# Disable auto promotion of pins of type 'pad'
auto_promote_pad_pins -promote_all 0

# Create top level Scalar Ports
sd_create_scalar_port -sd_name ${sd_name} -port_name {DATA_VALID_I} -port_direction {IN}
sd_create_scalar_port -sd_name ${sd_name} -port_name {RESETN_I} -port_direction {IN}
sd_create_scalar_port -sd_name ${sd_name} -port_name {SYS_CLK_I} -port_direction {IN}

sd_create_scalar_port -sd_name ${sd_name} -port_name {DATA_VALID_O} -port_direction {OUT}


# Create top level Bus Ports
sd_create_bus_port -sd_name ${sd_name} -port_name {ALPHA_I} -port_direction {IN} -port_range {[7:0]}
sd_create_bus_port -sd_name ${sd_name} -port_name {B1_I} -port_direction {IN} -port_range {[31:0]}
sd_create_bus_port -sd_name ${sd_name} -port_name {B_I} -port_direction {IN} -port_range {[31:0]}
sd_create_bus_port -sd_name ${sd_name} -port_name {G1_I} -port_direction {IN} -port_range {[31:0]}
sd_create_bus_port -sd_name ${sd_name} -port_name {G_I} -port_direction {IN} -port_range {[31:0]}
sd_create_bus_port -sd_name ${sd_name} -port_name {R1_I} -port_direction {IN} -port_range {[31:0]}
sd_create_bus_port -sd_name ${sd_name} -port_name {R_I} -port_direction {IN} -port_range {[31:0]}

sd_create_bus_port -sd_name ${sd_name} -port_name {B_O} -port_direction {OUT} -port_range {[31:0]}
sd_create_bus_port -sd_name ${sd_name} -port_name {G_O} -port_direction {OUT} -port_range {[31:0]}
sd_create_bus_port -sd_name ${sd_name} -port_name {R_O} -port_direction {OUT} -port_range {[31:0]}


sd_create_pin_slices -sd_name ${sd_name} -pin_name {R_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R_I} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G_I} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B_I} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R_O} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R_O} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R_O} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R_O} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G_O} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G_O} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G_O} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G_O} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B_O} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B_O} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B_O} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B_O} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R1_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R1_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R1_I} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {R1_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G1_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G1_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G1_I} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {G1_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B1_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B1_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B1_I} -pin_slices {[31:24]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {B1_I} -pin_slices {[7:0]}
# Add Alpha_Blending_C0_0 instance
sd_instantiate_component -sd_name ${sd_name} -component_name {Alpha_Blending_C0} -instance_name {Alpha_Blending_C0_0}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:CH1_DATA_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:CH1_DATA_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:CH1_DATA_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:CH2_DATA_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:CH2_DATA_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:CH2_DATA_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:DATA_O} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:DATA_O} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_0:DATA_O} -pin_slices {[7:0]}
sd_connect_pins_to_constant -sd_name ${sd_name} -pin_names {Alpha_Blending_C0_0:EN_I} -value {VCC}



# Add Alpha_Blending_C0_1 instance
sd_instantiate_component -sd_name ${sd_name} -component_name {Alpha_Blending_C0} -instance_name {Alpha_Blending_C0_1}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:CH1_DATA_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:CH1_DATA_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:CH1_DATA_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:CH2_DATA_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:CH2_DATA_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:CH2_DATA_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:DATA_O} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:DATA_O} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_1:DATA_O} -pin_slices {[7:0]}
sd_connect_pins_to_constant -sd_name ${sd_name} -pin_names {Alpha_Blending_C0_1:EN_I} -value {VCC}
sd_mark_pins_unused -sd_name ${sd_name} -pin_names {Alpha_Blending_C0_1:DATA_VALID_O}



# Add Alpha_Blending_C0_2 instance
sd_instantiate_component -sd_name ${sd_name} -component_name {Alpha_Blending_C0} -instance_name {Alpha_Blending_C0_2}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:CH1_DATA_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:CH1_DATA_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:CH1_DATA_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:CH2_DATA_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:CH2_DATA_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:CH2_DATA_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:DATA_O} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:DATA_O} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_2:DATA_O} -pin_slices {[7:0]}
sd_connect_pins_to_constant -sd_name ${sd_name} -pin_names {Alpha_Blending_C0_2:EN_I} -value {VCC}
sd_mark_pins_unused -sd_name ${sd_name} -pin_names {Alpha_Blending_C0_2:DATA_VALID_O}



# Add Alpha_Blending_C0_3 instance
sd_instantiate_component -sd_name ${sd_name} -component_name {Alpha_Blending_C0} -instance_name {Alpha_Blending_C0_3}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:CH1_DATA_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:CH1_DATA_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:CH1_DATA_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:CH2_DATA_I} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:CH2_DATA_I} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:CH2_DATA_I} -pin_slices {[7:0]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:DATA_O} -pin_slices {[15:8]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:DATA_O} -pin_slices {[23:16]}
sd_create_pin_slices -sd_name ${sd_name} -pin_name {Alpha_Blending_C0_3:DATA_O} -pin_slices {[7:0]}
sd_connect_pins_to_constant -sd_name ${sd_name} -pin_names {Alpha_Blending_C0_3:EN_I} -value {VCC}
sd_mark_pins_unused -sd_name ${sd_name} -pin_names {Alpha_Blending_C0_3:DATA_VALID_O}



# Add scalar net connections
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:DATA_VALID_I" "Alpha_Blending_C0_1:DATA_VALID_I" "Alpha_Blending_C0_2:DATA_VALID_I" "Alpha_Blending_C0_3:DATA_VALID_I" "DATA_VALID_I" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:DATA_VALID_O" "DATA_VALID_O" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:RESETN_I" "Alpha_Blending_C0_1:RESETN_I" "Alpha_Blending_C0_2:RESETN_I" "Alpha_Blending_C0_3:RESETN_I" "RESETN_I" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:SYS_CLK_I" "Alpha_Blending_C0_1:SYS_CLK_I" "Alpha_Blending_C0_2:SYS_CLK_I" "Alpha_Blending_C0_3:SYS_CLK_I" "SYS_CLK_I" }

# Add bus net connections
sd_connect_pins -sd_name ${sd_name} -pin_names {"ALPHA_I" "Alpha_Blending_C0_0:ALPHA_I" "Alpha_Blending_C0_1:ALPHA_I" "Alpha_Blending_C0_2:ALPHA_I" "Alpha_Blending_C0_3:ALPHA_I" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:CH1_DATA_I[15:8]" "G_I[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:CH1_DATA_I[23:16]" "R_I[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:CH1_DATA_I[7:0]" "B_I[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:CH2_DATA_I[15:8]" "G1_I[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:CH2_DATA_I[23:16]" "R1_I[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:CH2_DATA_I[7:0]" "B1_I[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:DATA_O[15:8]" "G_O[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:DATA_O[23:16]" "R_O[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_0:DATA_O[7:0]" "B_O[31:24]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:CH1_DATA_I[15:8]" "G_I[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:CH1_DATA_I[23:16]" "R_I[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:CH1_DATA_I[7:0]" "B_I[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:CH2_DATA_I[15:8]" "G1_I[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:CH2_DATA_I[23:16]" "R1_I[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:CH2_DATA_I[7:0]" "B1_I[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:DATA_O[15:8]" "G_O[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:DATA_O[23:16]" "R_O[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_1:DATA_O[7:0]" "B_O[23:16]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:CH1_DATA_I[15:8]" "G_I[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:CH1_DATA_I[23:16]" "R_I[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:CH1_DATA_I[7:0]" "B_I[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:CH2_DATA_I[15:8]" "G1_I[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:CH2_DATA_I[23:16]" "R1_I[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:CH2_DATA_I[7:0]" "B1_I[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:DATA_O[15:8]" "G_O[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:DATA_O[23:16]" "R_O[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_2:DATA_O[7:0]" "B_O[15:8]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:CH1_DATA_I[15:8]" "G_I[7:0]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:CH1_DATA_I[23:16]" "R_I[7:0]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:CH1_DATA_I[7:0]" "B_I[7:0]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:CH2_DATA_I[15:8]" "G1_I[7:0]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:CH2_DATA_I[23:16]" "R1_I[7:0]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:CH2_DATA_I[7:0]" "B1_I[7:0]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:DATA_O[15:8]" "G_O[7:0]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:DATA_O[23:16]" "R_O[7:0]" }
sd_connect_pins -sd_name ${sd_name} -pin_names {"Alpha_Blending_C0_3:DATA_O[7:0]" "B_O[7:0]" }


# Re-enable auto promotion of pins of type 'pad'
auto_promote_pad_pins -promote_all 1
# Save the SmartDesign 
save_smartdesign -sd_name ${sd_name}
# Generate SmartDesign "Alpha_Blending_4pixel"
generate_component -component_name ${sd_name}
