Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Github Action for committing and pushing changes to submodules #256

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0ca0b29
Proto of cell README generator
wgryncewicz Nov 19, 2020
9fcefb0
cell_list generator and lib README patcher
wgryncewicz Nov 19, 2020
c74b4d8
Cell_list now appends links to cell readmes
wgryncewicz Nov 19, 2020
5eb305b
Docs: generate cells documentation in CI
kgugala Nov 20, 2020
9db2820
netlistsvg-generate removed - belongs to another branch
wgryncewicz Nov 25, 2020
b366982
Cell readme generator updated, includes GDS2 layouts
wgryncewicz Nov 25, 2020
10c5e8f
Cell list generator includes cell links in table
wgryncewicz Nov 25, 2020
ab19ce3
Merge branch 'cell_doc_tree' of github.com:antmicro/skywater-pdk into…
wgryncewicz Nov 25, 2020
1f3fcbb
Removed redundant cell_list Sphinx extension script
wgryncewicz Nov 25, 2020
ed83490
Rename cell readme generator script
wgryncewicz Nov 25, 2020
3f498d9
Rename cell list generator script
wgryncewicz Nov 25, 2020
98da26c
Added committing changes made to submodules
glatosinski Nov 23, 2020
550cab4
github-actions: cleaned up generate-rst, added using conda
glatosinski Nov 25, 2020
058f1d0
github-actions: added docutils to requirements.txt
glatosinski Nov 25, 2020
3ecbc35
github-actions: added activating conda environment
glatosinski Nov 25, 2020
43ea361
github-actions: fixed name for cell_readme_generate
glatosinski Nov 25, 2020
c594c49
github-actions: added ignoring failing commits in submodules
glatosinski Nov 25, 2020
6a50169
github-actions: updated script names in generate-rst
glatosinski Nov 25, 2020
4dbb833
github-actions: cleaned up generate-rst
glatosinski Nov 26, 2020
cc86239
github-actions: silenced git commands
glatosinski Nov 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cell readme generator updated, includes GDS2 layouts
  • Loading branch information
wgryncewicz committed Nov 25, 2020
commit b3669825e422e38500a153dad60a3d60cf8edbea
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@
# SPDX-License-Identifier: Apache-2.0

''' This is a prototype of cell documentation generation script.
WORK IN PROGRESS
'''


import csv
import json
import os
Expand All @@ -24,40 +22,105 @@
import subprocess
import textwrap


readme_template ="""\
{header}
{headerUL}

**{description}**

*This is a stub of cell description file*

- **Cell name**: {name}
- **Type**: {deftype}
- **Verilog name**: {verilog_name}
- **Library**: {library}
- **Inputs**: {inputs}
- **Outputs**: {outputs}

Symbols
-------

.. list-table::

* - .. figure:: {symbol1}
-
- .. figure:: {symbol2}

Schematic
---------

.. figure:: {schematic}
:align: center

GDSII Layouts
-------------

"""

figure_template ="""

.. figure:: {fig}
:align: center
:width: 50%

{name}
"""

def write_readme(cellpath, define_data):
''' Generates README for a given cell.

Args:
cellpath - path to a cell [str of pathlib.Path]
define_data - cell data from json [dic]

'''
netlist_json = os.path.join(cellpath, define_data['file_prefix']+'.json')
assert os.path.exists(netlist_json), netlist_json
outpath = os.path.join(cellpath, 'README.rst')

header = define_data['name'] + ' cell description'
headline = '-' * len(header)

prefix = define_data['file_prefix']

sym1 = prefix + '.symbol.svg'
sym2 = prefix + '.pp.symbol.svg'
sche = prefix + '.schematic.svg'
header = prefix
symbol1 = prefix + '.symbol.svg'
symbol2 = prefix + '.pp.symbol.svg'
schematic = prefix + '.schematic.svg'
inputs = []
outputs = []
for p in define_data['ports']:
try:
if p[0]=='signal' and p[2]=='input':
inputs.append(p[1])
if p[0]=='signal' and p[2]=='output':
outputs.append(p[1])
except:
pass
gdssvg = []
svglist = list(pathlib.Path(cellpath).glob('*.svg'))
for s in svglist:
gdsfile = pathlib.Path(os.path.join(cellpath, s.stem +'.gds'))
if gdsfile.is_file():
gdssvg.append(s)


with open(outpath, 'w') as f:
f.write (f'{header}\n')
f.write (f'{headline}\n')
f.write ('\nThis is a stub of cell descrition file.\n\n')

f.write (f" * Name: {define_data['name']}\n")
f.write (f" * Type: {define_data['type']}\n")
f.write (f" * Verilog name: {define_data['verilog_name']}\n")
desc = textwrap.indent(define_data['description'], ' ').lstrip(),
f.write (f" * Description: {desc}\n")

f.write ('\nSome sample images:\n')

f.write (f'\n.. image:: {sym1}\n :align: center\n :alt: Symbol\n')
f.write (f'\n.. image:: {sym2}\n :align: center\n :alt: SymbolPP\n')
f.write (f'\n.. image:: {sche}\n :align: center\n :alt: Schematic\n')

f.write (readme_template.format (
header = header,
headerUL = '=' * len(header),
description = define_data['description'].rstrip('.'),
name = ':cell:`' + prefix +'`',
deftype = define_data['type'],
verilog_name = define_data['verilog_name'],
library = define_data['library'],
inputs = f'{len(inputs)} (' + ', '.join(inputs) + ')',
outputs = f'{len(outputs)} (' + ', '.join(outputs) + ')',
symbol1 = symbol1,
symbol2 = symbol2,
schematic = schematic,
))
for gs in sorted(gdssvg):
f.write (figure_template.format (
fig = gs.name,
name = gs.stem
))

def process(cellpath):
''' Processes cell indicated by path.
Expand Down