-
Notifications
You must be signed in to change notification settings - Fork 383
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
Generating resources.rst from Google Spreadsheet #255
Open
glatosinski
wants to merge
13
commits into
google:main
Choose a base branch
from
antmicro:189-resources-from-spreadsheet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fe8bfb6
docs: generate-resources: Added initial resources generator from spre…
glatosinski 79268a5
docs: generate-resources: Changed using Spreadsheet API to using expo…
glatosinski a423522
docs: generate-resources: Simplified calls to spreadsheet
glatosinski 0f7c7f4
docs: generate-resources: Added parsing courses and LinkedIn links
glatosinski 1df201a
docs: generate-resources: Added pandas to requirements.txt
glatosinski 8b9ca96
docs: generate-resources: added starting spreadsheet from A1, fixed a…
glatosinski 42034ef
docs: generate-resources: added sample generated resources.rst
glatosinski 084b0c2
docs: generate-resources: added odfpy for parsing ODS files
glatosinski c5371b8
generate-resources: used Jinja template to form resources.rst
glatosinski 5a151a7
generate-resources: updated resources.rst
glatosinski c4ed34e
generate-resources: moved the RST template to a separate file
glatosinski 5d374bc
generate-resources: renamed generate-resources-rst.py to generate_res…
glatosinski 064b239
generate-resources: fixed path to skywater_pdk
glatosinski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
glossary | ||
|
||
contributing | ||
resources | ||
partners | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
Further Resources | ||
================= | ||
|
||
|
||
News Articles | ||
------------- | ||
|
||
* `Open Source Process Design Kit from Google, SkyWater Technologies and Partners Released <https://ef.link/GUAxX>`__ | ||
* `Free chips courtesy of Google, SkyWater, eFabless <https://ef.link/yML5f>`__ | ||
* `Design an Open-Source SoC with Google SkyWater PDK, Get It Manufactured for Free <https://ef.link/JOlP9>`__ | ||
* `CREATING A CUSTOM ASIC WITH THE FIRST OPEN SOURCE PDK <https://ef.link/SbTsr>`__ | ||
* `Google, SkyWater Release Production Dev Kit, Offer Open Hardware Projects Free 130nm Manufacturing <https://ef.link/78ajq>`__ | ||
* `Produce your own physical chips. For free. In the Open. <https://ef.link/VlLNt>`__ | ||
|
||
|
||
Conferences | ||
----------- | ||
|
||
ICCAD 2020 | ||
~~~~~~~~~~ | ||
|
||
**Conference Dates:** 2nd November 2020 to 5th November 2020 | ||
|
||
* `https://iccad.com/event_details?id=305-8-D <https://iccad.com/event_details?id=305-8-D>`__ | ||
|
||
WOSET 2020 | ||
~~~~~~~~~~ | ||
|
||
* `https://woset-workshop.github.io/WOSET2020.html <https://woset-workshop.github.io/WOSET2020.html>`__ | ||
* `https://woset-workshop.github.io/PDFs/2020/a03.pdf <https://woset-workshop.github.io/PDFs/2020/a03.pdf>`__ | ||
* `https://woset-workshop.github.io/PDFs/2020/a04.pdf <https://woset-workshop.github.io/PDFs/2020/a04.pdf>`__ | ||
* `https://woset-workshop.github.io/PDFs/2020/a23.pdf <https://woset-workshop.github.io/PDFs/2020/a23.pdf>`__ | ||
* `https://woset-workshop.github.io/PDFs/2020/a21.pdf <https://woset-workshop.github.io/PDFs/2020/a21.pdf>`__ | ||
|
||
VLSI SoC Conference 2020 | ||
~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* `https://ef.link/KLO5s <https://ef.link/KLO5s>`__ | ||
|
||
|
||
Talk Series | ||
----------- | ||
|
||
FOSSi Foundation Dialup Talk Series | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Free and Open Source Silicon and EDA tools. It features selected speakers from the rapidly developing FOSSi ecosystem. | ||
|
||
**Page**: https://fossi-foundation.org/dial-up/ | ||
|
||
Fully open source manufacturable PDK for a 130nm process | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
**Presenter**: Tim Ansell | ||
**Details**: Google Kick-off Presentation of Open Source Foundry | ||
**Video**: `[FOSSi Dial-Up] Tim Ansell - Skywater PDK: Fully open source manufacturable PDK for a 130nm process <https://youtu.be/EczW2IWdnOM>`__ | ||
**Video**: `Open Source manufacturable PDK for Skywater 130nm process node (Google slides) <https://j.mp/du20-sky130>`__ | ||
|
||
The striVe RISC-V SoC Family on SkyWater 130nm | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
**Presenter**: Mohamed Kassem | ||
**Video**: `[FOSSi Dial-Up] Mohamed Kassem - The striVe RISC-V SoC Family on SkyWater 130nm <https://youtu.be/HvWveK2fZt0>`__ | ||
**Video**: `The striVe RISC-V SoC Family on Skywater 130nm (PPTX) <https://ef.link/fossi-pptx>`__ | ||
**Video**: `The striVe RISC-V SoC Family on Skywater 130nm (PDF) <https://ef.link/fossi-pdf>`__ | ||
|
||
OpenLane, A Digital ASIC Flow for SkyWater 130nm Open PDK | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
**Presenter**: Mohamed Shalan | ||
**Video**: `[FOSSi Dial-Up] Mohamed Shalan - OpenLane, A Digital ASIC Flow for SkyWater 130nm Open PDK <https://youtu.be/Vhyv0eq_mLU>`__ | ||
**Video**: `OpenLane, A Digital ASIC Flow for Skywater 130nm Open PDK <https://ef.link/cygME>`__ | ||
|
||
Designing new 130nm cells for SkyWater 130nm | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
**Presenter**: James Stine | ||
**Video**: `[FOSSi Dial-Up] James Stine - Designing new 130nm cells for SkyWater 130nm <https://youtu.be/Svus4uQ_CAA>`__ | ||
**Video**: `Engineering System on Chip (SoC) Flows for SkyWater 130nm Open PDK <https://ef.link/uUArY>`__ | ||
|
||
OpenRAM on SkyWater 130nm | ||
^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
**Presenter**: Matt Guthaus | ||
**Video**: `[FOSSi Dial-Up] Matt Guthaus - OpenRAM on SkyWater 130nm <https://youtu.be/9Lw83kFtnc4>`__ | ||
**Video**: `OpenRAM on SkyWater 130nm <https://ef.link/edstV>`__ | ||
|
||
The Amp Hour Podcast | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
Fabless Chip Design with Mohamed Kassem | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
**Presenter**: Mohamed Kassem | ||
**Video**: `#503 – Fabless Chip Design with Mohamed Kassem <https://ef.link/amp-hour>`__ | ||
|
||
|
||
LinkedIn Posts | ||
-------------- | ||
|
||
* `Mohamed Kassem <https://www.linkedin.com/in/mkkassem/detail/recent-activity/shares/>`__ | ||
* `Mike Wishart <https://www.linkedin.com/in/mike-wishart-81480612/detail/recent-activity/shares/>`__ | ||
* `Efabless Corporation <https://www.linkedin.com/company/efabless-com>`__ | ||
|
||
|
||
Courses | ||
------- | ||
|
||
* `VLSI Systems Design course main page <https://inst.eecs.berkeley.edu/~cs250/fa20/>`__ | ||
* `Lab - Intro to OpenLane and Skywater 130 <https://inst.eecs.berkeley.edu/~cs250/fa20/labs/lab1/>`__ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
112 changes: 112 additions & 0 deletions
112
scripts/python-skywater-pdk/skywater_pdk/generate_resources_rst.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
# | ||
# Copyright 2020 SkyWater PDK Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import sys | ||
import os | ||
import argparse | ||
from pathlib import Path | ||
import pandas as pd | ||
import errno | ||
from jinja2 import Template | ||
import importlib.resources as resources | ||
|
||
sys.path.insert(0, os.path.abspath(__file__ + '/../../')) | ||
|
||
from skywater_pdk import templates | ||
|
||
|
||
def parse_entries(filepath, sheet_name, cols=None): | ||
""" | ||
Loads resources from spreadsheet to pandas frames. | ||
|
||
Parameters | ||
---------- | ||
filepath: | ||
path or URL to spreadsheet file (ODS requires odfpy package, XLSX | ||
requires xlrd package) | ||
sheet_name: name of the sheet to extract data from | ||
cols: range of columns to extract from the sheet | ||
""" | ||
values = pd.read_excel( | ||
filepath, | ||
sheet_name=sheet_name, | ||
header=0, | ||
usecols=cols | ||
) | ||
values = values.where(values.notnull(), None) | ||
return values | ||
|
||
|
||
def main(argv): | ||
parser = argparse.ArgumentParser(prog=argv[0]) | ||
parser.add_argument( | ||
'output', | ||
help='The path to output RST file', | ||
type=Path | ||
) | ||
parser.add_argument( | ||
'--spreadsheet-file', | ||
help='The path to input spreadsheet file', | ||
type=Path | ||
) | ||
parser.add_argument( | ||
'--google-spreadsheet-id', | ||
help='Google Spreadsheet ID of the document to process', | ||
action='store_true' | ||
) | ||
|
||
args = parser.parse_args(argv[1:]) | ||
|
||
input_file = None | ||
if args.spreadsheet_file: | ||
input_file = args.spreadsheet_file | ||
if args.google_spreadsheet_id: | ||
input_file = f'https://docs.google.com/spreadsheets/d/{args.google_spreadsheet_id}/export?format=ods' # noqa: E501 | ||
|
||
if input_file is None: | ||
print('Input file is not provided') | ||
return errno.ENOENT | ||
|
||
news_articles = parse_entries(input_file, 'News Articles') | ||
talk_series = parse_entries(input_file, 'Talk Series') | ||
conferences = parse_entries(input_file, 'Conferences') | ||
linkedin = parse_entries(input_file, 'LinkedIn Posts') | ||
courses = parse_entries(input_file, 'Courses') | ||
|
||
with resources.path(templates, 'resources.template.rst') as resourcepath: | ||
with open(resourcepath, 'r') as resourcetemplate: | ||
resources_rst_template = resourcetemplate.read() | ||
|
||
tm = Template(resources_rst_template) | ||
resources_rst_content = tm.render( | ||
news_articles=news_articles, | ||
talk_series=talk_series, | ||
conferences=conferences, | ||
linkedin=linkedin, | ||
courses=courses | ||
) | ||
|
||
with open(args.output, 'w') as out: | ||
out.write(resources_rst_content) | ||
|
||
return 0 | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main(sys.argv)) |
Empty file.
98 changes: 98 additions & 0 deletions
98
scripts/python-skywater-pdk/skywater_pdk/templates/resources.template.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
Further Resources | ||
================= | ||
|
||
|
||
News Articles | ||
------------- | ||
|
||
{% for _, row in news_articles.iterrows() -%} | ||
* `{{ row["Article"] }} <{{ row["Link"] }}>`__ | ||
{% endfor %} | ||
|
||
Conferences | ||
----------- | ||
{% for _, row in conferences.iterrows() -%} | ||
|
||
{% if row["Conference"] %} | ||
{{ row["Conference"] }} | ||
{{ '~' * row["Conference"]|length }} | ||
|
||
{% endif -%} | ||
{% if row["Description"] -%} | ||
{{ row["Description"] }} | ||
|
||
{% endif -%} | ||
{% if row["Related link"] -%} | ||
* `{{ row["Related link"] }} <{{ row["Related link"] }}>`__ | ||
{% endif -%} | ||
{% endfor %} | ||
|
||
Talk Series | ||
----------- | ||
{% for _, row in talk_series.iterrows() -%} | ||
{% if row["Talk series"] %} | ||
{{ row["Talk series"] }} | ||
{{ '~' * row["Talk series"]|length }} | ||
{% if row["Description"] %} | ||
{{ row["Description"] }} | ||
{% endif -%} | ||
{% if row["Page"] %} | ||
**Page**: {{ row["Page"] }} | ||
{% endif -%} | ||
{% endif %} | ||
{{ row["Title"] }} | ||
{{ '^' * row["Title"]|length }} | ||
|
||
{% if row["Presenter"] -%} | ||
**Presenter**: {{ row["Presenter"] }} | ||
{% endif -%} | ||
{% if row["Talk details"] -%} | ||
**Details**: {{ row["Talk details"] }} | ||
{% endif -%} | ||
{% if row["Video link"] -%} | ||
{% if row["Video"] -%} | ||
**Video**: `{{ row["Video"] }} <{{ row["Video link"] }}>`__ | ||
{% else -%} | ||
**Video**: `{{ row["Video link"] }} <{{ row["Video link"] }}>`__ | ||
{% endif -%} | ||
{% endif -%} | ||
{% if row["Slides PPTX link"] -%} | ||
{% if row["Slides PPTX"] -%} | ||
**Video**: `{{ row["Slides PPTX"] }} <{{ row["Slides PPTX link"] }}>`__ | ||
{% else -%} | ||
**Video**: `{{ row["Slides PPTX link"] }} <{{ row["Slides PPTX link"] }}>`__ | ||
{% endif -%} | ||
{% endif -%} | ||
{% if row["Slides PDF link"] -%} | ||
{% if row["Slides PDF"] -%} | ||
**Video**: `{{ row["Slides PDF"] }} <{{ row["Slides PDF link"] }}>`__ | ||
{% else -%} | ||
**Video**: `{{ row["Slides PDF link"] }} <{{ row["Slides PDF link"] }}>`__ | ||
{% endif -%} | ||
{% endif -%} | ||
{% endfor %} | ||
|
||
LinkedIn Posts | ||
-------------- | ||
|
||
{% for _, row in linkedin.iterrows() -%} | ||
* `{{ row["Title"] }} <{{ row["Link"] }}>`__ | ||
{% endfor %} | ||
|
||
Courses | ||
------- | ||
|
||
{% for _, row in courses.iterrows() -%} | ||
{% if row["Courses"] %} | ||
{{ row["Courses"] }} | ||
{{ '~' * row["Courses"]|length }} | ||
{% endif -%} | ||
{% if row["Link"] -%} | ||
{% if row["Link title"] -%} | ||
* `{{ row["Link title"] }} <{{ row["Link"] }}>`__ | ||
{% else -%} | ||
* `{{ row["Link"] }} <{{ row["Link"] }}>`__ | ||
{% endif -%} | ||
{% endif -%} | ||
{% endfor %} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pandas seems a rather heavy dependency here? As pandas is a binary dependency it should probably also be in the
environment.yml
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used pandas to simplify accessing row fields. If pandas is too heavy I can replace it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put
pandas
inrequirements.txt
in case someone would like to install the requiredpip
packages for skywater-pdk without usingconda
environment.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also used pandas to read Google spreadsheet files directly from URL