Skip to content

Commit 86e2d44

Browse files
committed
Various small improvements
1 parent ee58196 commit 86e2d44

File tree

3 files changed

+60
-22
lines changed

3 files changed

+60
-22
lines changed

source/SpinalHDL/Libraries/Pipeline/introduction.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,13 @@ You can access its arbitration via :
186186
- Description
187187
* - ``node.valid``
188188
- RW
189-
- Is the signal which specifies if a transaction is present on the node. It is driven by the upstream. Once asserted, it must only be de-asserted the cycle after which either both valid and ready or node.cancel are high. valid must not depend on ready.
189+
- Is the signal which specifies if a transaction is present on the node. It is driven by the upstream. Once asserted, it must only be de-asserted the cycle after which either both ``valid`` and ``ready`` or ``node.cancel`` are high. ``valid`` must not depend on ``ready``.
190190
* - ``node.ready``
191191
- RW
192-
- Is the signal which specifies if the node's transaction can proceed downstream. It is driven by the downstream to create backpressure. The signal has no meaning when there is no transaction (node.valid being deasserted)
192+
- Is the signal which specifies if the node's transaction can proceed downstream. It is driven by the downstream to create backpressure. The signal has no meaning when there is no transaction (``node.valid`` being deasserted).
193193
* - ``node.cancel``
194194
- RW
195-
- Is the signal which specifies if the node's transaction in being canceled from the pipeline. It is driven by the downstream. The signal has no meaning when there is no transaction (node.valid being deasserted)
195+
- Is the signal which specifies if the node's transaction in being canceled from the pipeline. It is driven by the downstream. The signal has no meaning when there is no transaction (``node.valid`` being deasserted)
196196
* - ``node.isValid``
197197
- RO
198198
- ``node.valid``'s read only accessor
@@ -204,15 +204,15 @@ You can access its arbitration via :
204204
- ``node.cancel``'s read only accessor
205205
* - ``node.isFiring``
206206
- RO
207-
- True when the node transaction is successfully moving further (valid && ready && !cancel). Useful to commit state changes.
207+
- ``True`` when the node transaction is successfully moving further (``valid && ready && !cancel``). Useful to commit state changes.
208208
* - ``node.isMoving``
209209
- RO
210-
- True when the node transaction will not be present anymore on the node (starting from the next cycle),
210+
- ``True`` when the node transaction will not be present anymore on the node (starting from the next cycle),
211211
either because downstream is ready to take the transaction,
212-
or because the transaction is canceled from the pipeline. (``valid && (ready || cancel)``). Useful to "reset" states.
212+
or because the transaction is canceled from the pipeline (``valid && (ready || cancel)``). Useful to "reset" states.
213213
* - ``node.isCanceling``
214214
- RO
215-
- True when the node transaction is being canceled. Meaning that it will not appear anywhere in the pipeline in future cycles.
215+
- True when the node transaction is being cleaned up. Meaning that it will not appear anywhere in the pipeline in future cycles. It is equivalent to ``isValid && isCancel``.
216216

217217
Note that the ``node.valid``/``node.ready`` signals follows the same conventions than
218218
the :doc:`../stream`'s ones .

source/SpinalHDL/Libraries/stream.rst

Lines changed: 43 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ Functions
113113
- Return True when a transaction is stall on the bus (valid && ! ready)
114114
- Bool
115115
-
116+
* - x.isFree
117+
- Return True when the bus isn't stuck with a transaction (!isStall)
118+
- Bool
119+
-
116120
* - x.queue(size:Int)
117121
- Return a Stream connected to x through a FIFO
118122
- Stream[T]
@@ -219,20 +223,47 @@ On each stream you can call the .queue(size) to get a buffered stream. But you c
219223
myFifo.io.push << streamA
220224
myFifo.io.pop >> streamB
221225
226+
227+
Mandatory parameters:
228+
222229
.. list-table::
223230
:header-rows: 1
224231
:widths: 1 1 2
225232

226-
* - parameter name
233+
* - Name
227234
- Type
228235
- Description
229236
* - dataType
230237
- T
231238
- Payload data type
232239
* - depth
233240
- Int
234-
- Size of the memory used to store elements
241+
- Number of element stored in the fifo, Note that if ``withAsyncRead==false``, then one extra transaction can be stored.
242+
243+
Optional parameters:
235244

245+
.. list-table::
246+
:header-rows: 1
247+
:widths: 1 1 2
248+
249+
* - Name
250+
- Default
251+
- Description
252+
* - withAsyncRead
253+
- ``false``
254+
- Read the memory using asynchronous read port (ex distributed ram). If false, add 1 cycle latency.
255+
* - withBypass
256+
- ``false``
257+
- Bypass the push port to the pop port when the fifo is empty.If false, add 1 cycle latency. Only available if ``withAsyncRead == true``.
258+
* - forFMax
259+
- ``false``
260+
- Tune the design to get the maximal clock frequency.
261+
* - useVec
262+
- ``false``
263+
- Use an ``Vec`` of register instead of a Mem to store the content
264+
* - initPayload
265+
- ``None``
266+
- A ``=> Option[T]`` function that return a value to init the ``Vec`` register, only meaningful when ``useVec == true``
236267

237268
.. list-table::
238269
:header-rows: 1
@@ -420,10 +451,10 @@ When you have multiple Streams and you want to arbitrate them to drive a single
420451
.. code-block:: scala
421452
422453
val streamA, streamB, streamC = Stream(Bits(8 bits))
423-
val arbitredABC = StreamArbiterFactory.roundRobin.onArgs(streamA, streamB, streamC)
454+
val arbiteredABC = StreamArbiterFactory.roundRobin.onArgs(streamA, streamB, streamC)
424455
425456
val streamD, streamE, streamF = Stream(Bits(8 bits))
426-
val arbitredDEF = StreamArbiterFactory.lowerFirst.noLock.onArgs(streamD, streamE, streamF)
457+
val arbiteredDEF = StreamArbiterFactory.lowerFirst.noLock.onArgs(streamD, streamE, streamF)
427458
428459
.. list-table::
429460
:header-rows: 1
@@ -490,7 +521,7 @@ all output streams have processed each item regardlessly.
490521
.. code-block:: scala
491522
492523
val inputStream = Stream(Bits(8 bits))
493-
val (outputstream1, outputstream2) = StreamFork2(inputStream, synchronous=false)
524+
val (outputStream1, outputStream2) = StreamFork2(inputStream, synchronous=false)
494525
495526
or
496527

@@ -558,11 +589,16 @@ The ``count`` is captured and registered each time inputStream fires for an indi
558589
val extender = StreamTransactionExtender(inputStream, outputStream, count) {
559590
// id, is the 0-based index of total output transfers so far in the current input transaction.
560591
// last, is the last transfer indication, same as the last signal for extender.
561-
// the returned payload is allowed to be modified only based on id and last signals, other translation should be done outside of this.
592+
// the returned payload is allowed to be modified only based on id and last signals, other
593+
// translation should be done outside of this.
562594
(id, payload, last) => payload
563595
}
564596
565-
This ``extender`` provides several status signals, such as ``working``, ``last``, ``done`` where ``working`` means there is one input transfer accepted and in-progress, ``last`` indicates the last output transfer is prepared and waiting to complete, ``done`` become valid represents the last output transfer is fireing and making the current input transaction process complete and ready to start another transaction.
597+
This ``extender`` provides several status signals, such as ``working``, ``last``, ``done`` where
598+
``working`` means there is one input transfer accepted and in-progress, ``last`` indicates the last
599+
output transfer is prepared and waiting to complete, ``done`` become valid represents the last
600+
output transfer is firing and making the current input transaction process complete and ready to
601+
start another transaction.
566602

567603
.. wavedrom::
568604

source/SpinalHDL/Structuring/clock_domain.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,25 @@ This definition takes five parameters:
4040
- Description
4141
- Default
4242
* - ``clock``
43-
- Clock signal that defines the domain
43+
- Clock signal that defines the domain.
4444
-
4545
* - ``reset``
46-
- Reset signal. If a register exists which needs a reset and the clock domain doesn't provide one, an error message will be displayed
46+
- Reset signal. If a register exists which needs a reset and the clock domain doesn't provide one,
47+
an error message will be displayed.
4748
- null
4849
* - ``softReset``
49-
- Reset which infers an additional synchronous reset
50+
- Reset which infers an additional synchronous reset.
5051
- null
5152
* - ``clockEnable``
52-
- The goal of this signal is to disable the clock on the whole clock domain without having to manually implement that on each synchronous element
53+
- The goal of this signal is to disable the clock on the whole clock domain without having to manually
54+
implement that on each synchronous element
5355
- null
5456
* - ``frequency``
5557
- Allows you to specify the frequency of the given clock domain and later read it in your design.
56-
This parameter does not generate and PLL or other hardware to control the frequency
58+
This parameter does not generate a PLL or more hardware to control the frequency.
5759
- UnknownFrequency
5860
* - ``config``
59-
- Specify the polarity of signals and the nature of the reset
61+
- Specify the polarity of signals and the nature of the reset.
6062
- Current config
6163

6264

@@ -516,8 +518,8 @@ A ``SlowArea`` is used to create a new clock domain area which is slower than th
516518
BootReset
517519
^^^^^^^^^
518520

519-
`clockDomain.withBootReset()` could specify register's resetKind as BOOT.
520-
`clockDomain.withSyncReset()` could specify register's resetKind as SYNC (sync-reset).
521+
``clockDomain.withBootReset()`` could specify register's resetKind as ``BOOT``.
522+
``clockDomain.withSyncReset()`` could specify register's resetKind as ``SYNC`` (sync-reset).
521523

522524
.. code-block:: scala
523525

0 commit comments

Comments
 (0)