@@ -16,29 +16,176 @@ adi_ip_add_core_dependencies { \
16
16
analog.com:user:util_cdc:1.0 \
17
17
}
18
18
19
+ set_property display_name " ADI AXI Stream FIFO" [ipx::current_core]
20
+ set_property description " ADI AXI Stream FIFO" [ipx::current_core]
21
+
22
+ # # Interface definitions
23
+
19
24
adi_add_bus " s_axis" " slave" \
20
25
" xilinx.com:interface:axis_rtl:1.0" \
21
26
" xilinx.com:interface:axis:1.0" \
22
27
{
23
28
{" s_axis_valid" " TVALID" } \
24
29
{" s_axis_ready" " TREADY" } \
25
- {" s_axis_data" " TDATA" } \
30
+ {" s_axis_data" " TDATA" } \
26
31
{" s_axis_tlast" " TLAST" } \
32
+ {" s_axis_tkeep" " TKEEP" } \
27
33
}
28
34
35
+ adi_set_ports_dependency " s_axis_tlast" \
36
+ " (spirit:decode(id('MODELPARAM_VALUE.TLAST_EN')) = 1)"
37
+ adi_set_ports_dependency " s_axis_tkeep" \
38
+ " (spirit:decode(id('MODELPARAM_VALUE.TKEEP_EN')) = 1)"
39
+
29
40
adi_add_bus " m_axis" " master" \
30
41
" xilinx.com:interface:axis_rtl:1.0" \
31
42
" xilinx.com:interface:axis:1.0" \
32
43
{
33
44
{" m_axis_valid" " TVALID" } \
34
45
{" m_axis_ready" " TREADY" } \
35
- {" m_axis_data" " TDATA" } \
46
+ {" m_axis_data" " TDATA" } \
36
47
{" m_axis_tlast" " TLAST" } \
48
+ {" m_axis_tkeep" " TKEEP" } \
37
49
}
38
50
51
+ adi_set_ports_dependency " m_axis_tlast" \
52
+ " (spirit:decode(id('MODELPARAM_VALUE.TLAST_EN')) = 1)"
53
+ adi_set_ports_dependency " m_axis_tkeep" \
54
+ " (spirit:decode(id('MODELPARAM_VALUE.TKEEP_EN')) = 1)"
55
+
39
56
adi_add_bus_clock " m_axis_aclk" " m_axis" " m_axis_aresetn"
40
57
adi_add_bus_clock " s_axis_aclk" " s_axis" " s_axis_aresetn"
41
58
42
- # # TODO: Validate RD_ADDRESS_WIDTH
59
+ # # Parameter validation
60
+
61
+ set_property -dict [list \
62
+ " value_validation_type" " list" \
63
+ " value_validation_list" " 8 16 32 64 128 256 512 1024 2048 4096" \
64
+ ] \
65
+ [ipx::get_user_parameters DATA_WIDTH -of_objects [ipx::current_core]]
66
+
67
+ set_property -dict [list \
68
+ " value_validation_type" " range_long" \
69
+ " value_validation_range_minimum" " 0" \
70
+ " value_validation_range_maximum" " 4096" \
71
+ ] \
72
+ [ipx::get_user_parameters ADDRESS_WIDTH -of_objects [ipx::current_core]]
73
+
74
+ set_property -dict [list \
75
+ " value_validation_type" " range_long" \
76
+ " value_validation_range_minimum" " 0" \
77
+ ] \
78
+ [ipx::get_user_parameters ALMOST_FULL_THRESHOLD -of_objects [ipx::current_core]]
79
+
80
+ set_property -dict [list \
81
+ " value_validation_type" " range_long" \
82
+ " value_validation_range_minimum" " 0" \
83
+ ] \
84
+ [ipx::get_user_parameters ALMOST_EMPTY_THRESHOLD -of_objects [ipx::current_core]]
85
+
86
+ set_property -dict [list \
87
+ " value_validation_type" " pairs" \
88
+ " value_validation_pairs" { \
89
+ " Synchronous" " 0" \
90
+ " Asynchronous" " 1" \
91
+ } \
92
+ ] \
93
+ [ipx::get_user_parameters ASYNC_CLK -of_objects [ipx::current_core]]
94
+
95
+ foreach {k v} { \
96
+ " M_AXIS_REGISTERED" " true" \
97
+ " TLAST_EN" " false" \
98
+ " TKEEP_EN" " true" \
99
+ " REMOVE_NULL_BEAT_EN" " false" \
100
+ } { \
101
+ set_property -dict [list \
102
+ " value_format" " bool" \
103
+ " value" $v \
104
+ ] \
105
+ [ipx::get_user_parameters $k -of_objects [ipx::current_core]]
106
+ set_property -dict [list \
107
+ " value_format" " bool" \
108
+ " value" $v \
109
+ ] \
110
+ [ipx::get_hdl_parameters $k -of_objects [ipx::current_core]]
111
+ }
112
+
113
+ # # Customize IP layout
114
+
115
+ # # Remove the automatically generated GUI page
116
+ ipgui::remove_page -component [ipx::current_core] [ipgui::get_pagespec -name " Page 0" -component [ipx::current_core]]
117
+ ipx::save_core [ipx::current_core]
118
+
119
+ # # Create a new GUI page
120
+ ipgui::add_page -name {AXI Stream FIFO} -component [ipx::current_core] -display_name {AXI Stream FIFO}
121
+ set page0 [ipgui::get_pagespec -name " AXI Stream FIFO" -component [ipx::current_core]]
122
+
123
+ set clock_group [ipgui::add_group -name " Clock Configuration" -component [ipx::current_core] \
124
+ -parent $page0 -display_name " Clock Configuration" ]
125
+
126
+ ipgui::add_param -name " ASYNC_CLK" -component [ipx::current_core] -parent $clock_group
127
+ set_property -dict [list \
128
+ " widget" " comboBox" \
129
+ " display_name" " Clocking mode" \
130
+ " tooltip" " \[ ASYNC_CLK\] If enabled the readn and write interface of the FIFO is asynchronous (its clocks are from different clock domain)."
131
+ ] [ipgui::get_guiparamspec -name " ASYNC_CLK" -component [ipx::current_core]]
132
+
133
+ set interface_group [ipgui::add_group -name " Interface Configuration" -component [ipx::current_core] \
134
+ -parent $page0 -display_name " Interface Configuration" ]
135
+
136
+ ipgui::add_param -name " DATA_WIDTH" -component [ipx::current_core] -parent $interface_group
137
+ set_property -dict [list \
138
+ " display_name" " Data width" \
139
+ " tooltip" " \[ DATA_WIDTH\] Data width of the AXI stream interfaces." \
140
+ ] [ipgui::get_guiparamspec -name " DATA_WIDTH" -component [ipx::current_core]]
141
+
142
+ ipgui::add_param -name " ADDRESS_WIDTH" -component [ipx::current_core] -parent $interface_group
143
+ set_property -dict [list \
144
+ " display_name" " Address width" \
145
+ " tooltip" " \[ ADDRESS_WIDTH\] Address width of the read and write address pointers. It defines the depth of the FIFO : DATA_WIDTH/8 * (2 ^ ADDRESS_WIDTH)" \
146
+ ] [ipgui::get_guiparamspec -name " ADDRESS_WIDTH" -component [ipx::current_core]]
147
+
148
+ ipgui::add_param -name " ALMOST_FULL_THRESHOLD" -component [ipx::current_core] -parent $interface_group
149
+ set_property -dict [list \
150
+ " display_name" " Almost full threshold" \
151
+ " tooltip" " \[ ALMOST_FULL_THRESHOLD\] The offset between the almost full assertion and full assertion in number of FIFO words." \
152
+ ] [ipgui::get_guiparamspec -name " ALMOST_FULL_THRESHOLD" -component [ipx::current_core]]
153
+
154
+ ipgui::add_param -name " ALMOST_EMPTY_THRESHOLD" -component [ipx::current_core] -parent $interface_group
155
+ set_property -dict [list \
156
+ " display_name" " Almost empty threshold" \
157
+ " tooltip" " \[ ALMOST_EMPTY_THRESHOLD\] The offset between the almost empty assertion and empty assertion in number of FIFO words." \
158
+ ] [ipgui::get_guiparamspec -name " ALMOST_EMPTY_THRESHOLD" -component [ipx::current_core]]
159
+
160
+ ipgui::add_param -name " TLAST_EN" -component [ipx::current_core] -parent $interface_group
161
+ set_property -dict [list \
162
+ " display_name" " TLAST Enable" \
163
+ " tooltip" " \[ TLAST_EN\] Enable the TLAST for the AXI stream interface, signaling packet boundaries." \
164
+ ] [ipgui::get_guiparamspec -name " TLAST_EN" -component [ipx::current_core]]
165
+
166
+ ipgui::add_param -name " TKEEP_EN" -component [ipx::current_core] -parent $interface_group
167
+ set_property -dict [list \
168
+ " display_name" " TKEEP Enable" \
169
+ " tooltip" " \[ TKEEP_EN\] Enable the TKEEP for the AXI stream interface, for data byte qualification for each AXIS beat." \
170
+ ] [ipgui::get_guiparamspec -name " TKEEP_EN" -component [ipx::current_core]]
171
+
172
+ set other_group [ipgui::add_group -name " Other Features" -component [ipx::current_core] \
173
+ -parent $page0 -display_name " Other Features" ]
174
+
175
+ ipgui::add_param -name " M_AXIS_REGISTERED" -component [ipx::current_core] -parent $other_group
176
+ set_property -dict [list \
177
+ " display_name" " Master AXIS Registered output" \
178
+ " tooltip" " \[ M_AXIS_REGISTERED\] Add an additional register stage to the master AXI stream data output." \
179
+ ] [ipgui::get_guiparamspec -name " M_AXIS_REGISTERED" -component [ipx::current_core]]
180
+
181
+ ipgui::add_param -name " REMOVE_NULL_BEAT_EN" -component [ipx::current_core] -parent $other_group
182
+ set_property -dict [list \
183
+ " display_name" " REMOVE_NULL_BEAT_EN Enable" \
184
+ " tooltip" " \[ REMOVE_NULL_BEAT_EN\] Filteres out all the beats with a null TKEEP qualifier." \
185
+ ] [ipgui::get_guiparamspec -name " REMOVE_NULL_BEAT_EN" -component [ipx::current_core]]
186
+ set_property enablement_tcl_expr {$TKEEP_EN == " true" } [ipx::get_user_parameters REMOVE_NULL_BEAT_EN -of_objects [ipx::current_core]]
187
+
188
+ # # Create and save the XGUI file
189
+ ipx::create_xgui_files [ipx::current_core]
43
190
44
191
ipx::save_core [ipx::current_core]
0 commit comments