]> rtime.felk.cvut.cz Git - fpga/zynq/canbench-sw.git/blob - system/ip/audio_single_pwm_1.0/bd/bd.tcl
microzed_apo: Include skeleton for single channel PWM audio output.
[fpga/zynq/canbench-sw.git] / system / ip / audio_single_pwm_1.0 / bd / bd.tcl
1
2 proc init { cellpath otherInfo } {
3
4         set cell_handle [get_bd_cells $cellpath]
5         set all_busif [get_bd_intf_pins $cellpath/*]
6         set axi_standard_param_list [list ID_WIDTH AWUSER_WIDTH ARUSER_WIDTH WUSER_WIDTH RUSER_WIDTH BUSER_WIDTH]
7         set full_sbusif_list [list  ]
8
9         foreach busif $all_busif {
10                 if { [string equal -nocase [get_property MODE $busif] "slave"] == 1 } {
11                         set busif_param_list [list]
12                         set busif_name [get_property NAME $busif]
13                         if { [lsearch -exact -nocase $full_sbusif_list $busif_name ] == -1 } {
14                             continue
15                         }
16                         foreach tparam $axi_standard_param_list {
17                                 lappend busif_param_list "C_${busif_name}_${tparam}"
18                         }
19                         bd::mark_propagate_only $cell_handle $busif_param_list
20                 }
21         }
22 }
23
24
25 proc pre_propagate {cellpath otherInfo } {
26
27         set cell_handle [get_bd_cells $cellpath]
28         set all_busif [get_bd_intf_pins $cellpath/*]
29         set axi_standard_param_list [list ID_WIDTH AWUSER_WIDTH ARUSER_WIDTH WUSER_WIDTH RUSER_WIDTH BUSER_WIDTH]
30
31         foreach busif $all_busif {
32                 if { [string equal -nocase [get_property CONFIG.PROTOCOL $busif] "AXI4"] != 1 } {
33                         continue
34                 }
35                 if { [string equal -nocase [get_property MODE $busif] "master"] != 1 } {
36                         continue
37                 }
38
39                 set busif_name [get_property NAME $busif]
40                 foreach tparam $axi_standard_param_list {
41                         set busif_param_name "C_${busif_name}_${tparam}"
42
43                         set val_on_cell_intf_pin [get_property CONFIG.${tparam} $busif]
44                         set val_on_cell [get_property CONFIG.${busif_param_name} $cell_handle]
45
46                         if { [string equal -nocase $val_on_cell_intf_pin $val_on_cell] != 1 } {
47                                 if { $val_on_cell != "" } {
48                                         set_property CONFIG.${tparam} $val_on_cell $busif
49                                 }
50                         }
51                 }
52         }
53 }
54
55
56 proc propagate {cellpath otherInfo } {
57
58         set cell_handle [get_bd_cells $cellpath]
59         set all_busif [get_bd_intf_pins $cellpath/*]
60         set axi_standard_param_list [list ID_WIDTH AWUSER_WIDTH ARUSER_WIDTH WUSER_WIDTH RUSER_WIDTH BUSER_WIDTH]
61
62         foreach busif $all_busif {
63                 if { [string equal -nocase [get_property CONFIG.PROTOCOL $busif] "AXI4"] != 1 } {
64                         continue
65                 }
66                 if { [string equal -nocase [get_property MODE $busif] "slave"] != 1 } {
67                         continue
68                 }
69
70                 set busif_name [get_property NAME $busif]
71                 foreach tparam $axi_standard_param_list {
72                         set busif_param_name "C_${busif_name}_${tparam}"
73
74                         set val_on_cell_intf_pin [get_property CONFIG.${tparam} $busif]
75                         set val_on_cell [get_property CONFIG.${busif_param_name} $cell_handle]
76
77                         if { [string equal -nocase $val_on_cell_intf_pin $val_on_cell] != 1 } {
78                                 #override property of bd_interface_net to bd_cell -- only for slaves.  May check for supported values..
79                                 if { $val_on_cell_intf_pin != "" } {
80                                         set_property CONFIG.${busif_param_name} $val_on_cell_intf_pin $cell_handle
81                                 }
82                         }
83                 }
84         }
85 }
86