mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Docs: Render cell titles
Also put property lists *after* cell description.
This commit is contained in:
parent
7216f07691
commit
927dc445dd
|
@ -4,8 +4,6 @@
|
||||||
Binary operators
|
Binary operators
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
.. TODO:: display cell titles
|
|
||||||
|
|
||||||
All binary RTL cells have two input ports ``A`` and ``B`` and one output port
|
All binary RTL cells have two input ports ``A`` and ``B`` and one output port
|
||||||
``Y``. They also have the following parameters:
|
``Y``. They also have the following parameters:
|
||||||
|
|
||||||
|
|
|
@ -305,15 +305,8 @@ class YosysCellDocumenter(YosysCellGroupDocumenter):
|
||||||
val = ' '.join(val)
|
val = ' '.join(val)
|
||||||
if val:
|
if val:
|
||||||
self.add_line(f' :{attr}: {val}', sourcename)
|
self.add_line(f' :{attr}: {val}', sourcename)
|
||||||
|
|
||||||
self.add_line('\n', sourcename)
|
|
||||||
|
|
||||||
# fields
|
self.add_line('\n', sourcename)
|
||||||
field_attrs = ["properties", ]
|
|
||||||
for field in field_attrs:
|
|
||||||
attr = getattr(cell, field, [])
|
|
||||||
for val in attr:
|
|
||||||
self.add_line(f' :{field} {val}:', sourcename)
|
|
||||||
|
|
||||||
if self.options.noindex:
|
if self.options.noindex:
|
||||||
self.add_line(' :noindex:', sourcename)
|
self.add_line(' :noindex:', sourcename)
|
||||||
|
@ -331,6 +324,14 @@ class YosysCellDocumenter(YosysCellGroupDocumenter):
|
||||||
for line, src in zip(more_content.data, more_content.items):
|
for line, src in zip(more_content.data, more_content.items):
|
||||||
self.add_line(line, src[0], src[1])
|
self.add_line(line, src[0], src[1])
|
||||||
|
|
||||||
|
# fields
|
||||||
|
self.add_line('\n', sourcename)
|
||||||
|
field_attrs = ["properties", ]
|
||||||
|
for field in field_attrs:
|
||||||
|
attr = getattr(self.object, field, [])
|
||||||
|
for val in attr:
|
||||||
|
self.add_line(f':{field} {val}:', sourcename)
|
||||||
|
|
||||||
def get_object_members(
|
def get_object_members(
|
||||||
self,
|
self,
|
||||||
want_all: bool
|
want_all: bool
|
||||||
|
|
|
@ -209,6 +209,14 @@ class CellNode(TocNode):
|
||||||
self.env.docname,
|
self.env.docname,
|
||||||
idx,
|
idx,
|
||||||
0))
|
0))
|
||||||
|
|
||||||
|
def transform_content(self, contentnode: addnodes.desc_content) -> None:
|
||||||
|
# Add the cell title to the body
|
||||||
|
if 'title' in self.options:
|
||||||
|
titlenode = nodes.paragraph()
|
||||||
|
titlenode += nodes.strong()
|
||||||
|
titlenode[-1] += nodes.Text(self.options['title'])
|
||||||
|
contentnode.insert(0, titlenode)
|
||||||
|
|
||||||
class CellSourceNode(TocNode):
|
class CellSourceNode(TocNode):
|
||||||
"""A custom code block for including cell source."""
|
"""A custom code block for including cell source."""
|
||||||
|
|
Loading…
Reference in a new issue