mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-24 01:25:33 +00:00
Docs: Improve cell_help usage
- Drop `cell_code` and instead map code lookups to the `cell_help` dict. - Add helper functions to struct for checking and getting the right cell. - Add `CellType` for cell to `write_cell_rst` function declaration in preparation for use in future. - Iterate over `yosys_celltypes.cell_types` when exporting cell rst files, reporting errors for any cells defined in `cell_types` but not `cell_help_messages`.
This commit is contained in:
parent
40ba92e956
commit
21747c468c
2 changed files with 43 additions and 30 deletions
|
@ -22,18 +22,14 @@ class SimHelper:
|
|||
"name", "title", "ports", "source", "desc", "code", "ver",
|
||||
]
|
||||
# generate C++ struct
|
||||
val = "tempCell = {\n"
|
||||
val = f"cell_help[{json.dumps(self.name)}] = "
|
||||
val += "{\n"
|
||||
for field in printed_fields:
|
||||
field_val = getattr(self, field)
|
||||
if isinstance(field_val, list):
|
||||
field_val = "\n".join(field_val)
|
||||
val += f' {json.dumps(field_val)},\n'
|
||||
val += "};\n"
|
||||
|
||||
# map name to struct
|
||||
val += f'cell_help[{json.dumps(self.name)}] = tempCell;'
|
||||
val += "\n"
|
||||
val += f'cell_code[{json.dumps(self.name + "+")}] = tempCell;'
|
||||
return val
|
||||
|
||||
def simcells_reparse(cell: SimHelper):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue