You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/SpinalHDL/Structuring/blackbox.rst
+37Lines changed: 37 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -163,6 +163,43 @@ For example:
163
163
mapCurrentClockDomain(io.clkB)
164
164
}
165
165
166
+
By default the ports of the blackbox are considered clock-less, meaning no clock crossing checks will be made on their usage. You can specify ports clock domain by using the ClockDomainTag :
167
+
168
+
.. code-block:: scala
169
+
170
+
class DemoBlackbox extends BlackBox {
171
+
val io = new Bundle{
172
+
val clk, rst = in Bool()
173
+
val a = in Bool()
174
+
val b = out Bool()
175
+
}
176
+
mapCurrentClockDomain(io.clk, io.rst)
177
+
ClockDomainTag(this.clockDomain)(
178
+
io.a,
179
+
io.b
180
+
)
181
+
}
182
+
183
+
You can also apply the tag to the whole bundle with :
184
+
185
+
.. code-block:: scala
186
+
val io = new Bundle{
187
+
val clk, rst = in Bool()
188
+
val a = in Bool()
189
+
val b = out Bool()
190
+
}
191
+
ClockDomainTag(this.clockDomain)(io)
192
+
193
+
You can also apply the current clock domain to all the ports using (SpinalHDL 1.10.2):
0 commit comments