Skip to content

Commit

Permalink
Add doc about blackbox io clock domain specification
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Feb 26, 2024
1 parent b85f86a commit 2547821
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions source/SpinalHDL/Structuring/blackbox.rst
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,43 @@ For example:
mapCurrentClockDomain(io.clkB)
}
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 :

.. code-block:: scala
class DemoBlackbox extends BlackBox {
val io = new Bundle{
val clk, rst = in Bool()
val a = in Bool()
val b = out Bool()
}
mapCurrentClockDomain(io.clk, io.rst)
ClockDomainTag(this.clockDomain)(
io.a,
io.b
)
}
You can also apply the tag to the whole bundle with :

.. code-block:: scala

Check failure on line 185 in source/SpinalHDL/Structuring/blackbox.rst

View workflow job for this annotation

GitHub Actions / pots

Error in "code-block" directive:
val io = new Bundle{
val clk, rst = in Bool()
val a = in Bool()
val b = out Bool()
}
ClockDomainTag(this.clockDomain)(io)
You can also apply the current clock domain to all the ports using (SpinalHDL 1.10.2):

.. code-block:: scala

Check failure on line 195 in source/SpinalHDL/Structuring/blackbox.rst

View workflow job for this annotation

GitHub Actions / pots

Error in "code-block" directive:
val io = new Bundle{
val clk, rst = in Bool()
val a = in Bool()
val b = out Bool()
}
setIoCd()
io prefix
---------

Expand Down

0 comments on commit 2547821

Please sign in to comment.