Add doc about SVIF (system verilog interface)#247
Add doc about SVIF (system verilog interface)#247yportne13 wants to merge 3 commits intoSpinalHDL:masterfrom
Conversation
|
FYI: while WIP please open as a draft - then it doesn't show up in the inboxes of the maintainers to review. |
|
Hi, One thing which is important i think, is to specify in the doc that this feature may be subject to changes (experimental) |
mrcmry
left a comment
There was a problem hiding this comment.
Hi !
I have seen that the PR to the spinal lib has been merged in dev and is in v1.14.1.
I did some typo suggestions, you can use the github web interface to add them to a batch and merge them in a commit in the web interface (see this doc).
And then if it's ok for you we can merge this PR.
| Description | ||
| ^^^^^^^^^^^ | ||
|
|
||
| The ``SVIF`` type specifically targets system Verilog designs.This type extends from ``Bundle``.When generating Verilog or VHDL, the behavior of this type is exactly the same as that of ``Bundle``.However, when generating System Verilog and enabling the ``svInterface`` option in SpinalConfig, this type will be generated as an Interface. |
There was a problem hiding this comment.
| The ``SVIF`` type specifically targets system Verilog designs.This type extends from ``Bundle``.When generating Verilog or VHDL, the behavior of this type is exactly the same as that of ``Bundle``.However, when generating System Verilog and enabling the ``svInterface`` option in SpinalConfig, this type will be generated as an Interface. | |
| The ``SVIF`` type specifically targets system Verilog designs. This type extends from ``Bundle``. When generating Verilog or VHDL, the behavior of this type is exactly the same as that of ``Bundle``. However, when generating System Verilog and enabling the ``svInterface`` option in SpinalConfig, this type will be generated as an ``Interface``. |
|
|
||
| The ``SVIF`` type specifically targets system Verilog designs.This type extends from ``Bundle``.When generating Verilog or VHDL, the behavior of this type is exactly the same as that of ``Bundle``.However, when generating System Verilog and enabling the ``svInterface`` option in SpinalConfig, this type will be generated as an Interface. | ||
|
|
||
| This type is still an experimental feature |
There was a problem hiding this comment.
| This type is still an experimental feature | |
| This type is still an experimental feature. |
| .. code-block:: scala | ||
|
|
||
| case class Color(channelWidth: Int) extends SVIF { | ||
| val width = addGeneric("WIDTH", channelWidth)// or addParameter |
There was a problem hiding this comment.
| val width = addGeneric("WIDTH", channelWidth)// or addParameter | |
| val width = addGeneric("WIDTH", channelWidth) // or addParameter |
| case class Color(channelWidth: Int) extends SVIF { | ||
| val width = addGeneric("WIDTH", channelWidth)// or addParameter | ||
| val r, g, b = UInt(channelWidth bits) | ||
| tieGeneric(r, width)// or tieParameter |
There was a problem hiding this comment.
| tieGeneric(r, width)// or tieParameter | |
| tieGeneric(r, width) // or tieParameter |
| Definition Name | ||
| ~~~~~~~~~~~~~~~ | ||
|
|
||
| you can use ``setDefinitionName`` to set the definition name. But remember to use it before any clone of this interface |
There was a problem hiding this comment.
| you can use ``setDefinitionName`` to set the definition name. But remember to use it before any clone of this interface | |
| You can use ``setDefinitionName`` to set the definition name. But remember to use it before any clone of this interface. |
| Not Interface | ||
| ~~~~~~~~~~~~~ | ||
|
|
||
| If you have used a certain interface in multiple places, and at one of those locations ``sigA``, you wish to flatten it instead of generating an interface, you can achieve this by calling ``sigA.notSVIF()`` to fully flatten the signal. If the signal has nested interfaces and you only want to expand the outermost layer, you can use ``sigA.notSVIFthisLevel()``. |
There was a problem hiding this comment.
I'm a bit confuse by "sigA". I can not find it in the spinalhdl code base so I suppose it's some kind of example signal name. Would it not be clearer to call it "mySignal" ?
| .. _SVIF: | ||
|
|
||
| SVIF | ||
| ====== |
There was a problem hiding this comment.
| ====== | |
| ==== |
| def slv = asSlave | ||
| } | ||
|
|
||
| this will generate system verilog code as below: |
There was a problem hiding this comment.
| this will generate system verilog code as below: | |
| This will generate system verilog code as below: |
| Not Interface | ||
| ~~~~~~~~~~~~~ | ||
|
|
||
| If you have used a certain interface in multiple places, and at one of those locations ``sigA``, you wish to flatten it instead of generating an interface, you can achieve this by calling ``sigA.notSVIF()`` to fully flatten the signal. If the signal has nested interfaces and you only want to expand the outermost layer, you can use ``sigA.notSVIFthisLevel()``. |
There was a problem hiding this comment.
| If you have used a certain interface in multiple places, and at one of those locations ``sigA``, you wish to flatten it instead of generating an interface, you can achieve this by calling ``sigA.notSVIF()`` to fully flatten the signal. If the signal has nested interfaces and you only want to expand the outermost layer, you can use ``sigA.notSVIFthisLevel()``. | |
| If you have used a certain interface in multiple places, and at one of those locations ``mySignal``, you wish to flatten it instead of generating an interface, you can achieve this by calling ``mySignal.notSVIF()`` to fully flatten the signal. If the signal has nested interfaces and you only want to expand the outermost layer, you can use ``mySignal.notSVIFthisLevel()``. |
for this pr: SpinalHDL/SpinalHDL#1364