Skip to content

Commit

Permalink
Merge branch 'master' into krys/scy_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
clairexen authored Jul 18, 2023
2 parents 36e7a72 + 8c4e2da commit 4cddd7a
Show file tree
Hide file tree
Showing 15 changed files with 225 additions and 162 deletions.
5 changes: 5 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@

version: 2

build:
os: ubuntu-22.04
tools:
python: '3.11'

formats:
- pdf

Expand Down
43 changes: 43 additions & 0 deletions docs/source/_templates/page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{#

See https://github.com/pradyunsg/furo/blob/main/src/furo/theme/furo/page.html for the original
block this is overwriting.

The part that is customized is between the "begin of custom part" and "end of custom part"
comments below. It uses the same styles as the existing right sidebar code.

#}
{% extends "furo/page.html" %}
{% block right_sidebar %}
<div class="toc-sticky toc-scroll">
{# begin of custom part #}
<div class="toc-title-container">
<span class="toc-title">
YosysHQ
</span>
</div>
<div class="toc-tree-container yosyshq-links" style="padding-bottom: 0">
<div class="toc-tree">
<ul>
<li></li>
<li><a class="reference external" href="https://yosyshq.readthedocs.io">Docs</a></li>
<li><a class="reference external" href="https://blog.yosyshq.com">Blog</a></li>
<li><a class="reference external" href="https://www.yosyshq.com">Website</a></li>
</ul>
</div>
</div>
{# end of custom part #}
{% if not furo_hide_toc %}
<div class="toc-title-container">
<span class="toc-title">
{{ _("On this page") }}
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
{{ toc }}
</div>
</div>
{% endif %}
</div>
{% endblock %}
41 changes: 30 additions & 11 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,47 @@
#!/usr/bin/env python3
import sys
import os

sys.path.append(os.path.abspath(f"{__file__}/../../../sbysrc"))

project = 'YosysHQ SBY'
author = 'YosysHQ GmbH'
copyright ='2021 YosysHQ GmbH'
copyright = '2023 YosysHQ GmbH'

# select HTML theme
html_theme = 'press'

templates_path = ["_templates"]
html_theme = "furo"
html_logo = '../static/logo.png'
html_favicon = '../static/favico.png'
html_css_files = ['yosyshq.css', 'custom.css']
html_sidebars = {'**': ['util/searchbox.html', 'util/sidetoc.html']}
html_css_files = ['custom.css']

# These folders are copied to the documentation's HTML output
html_static_path = ['../static', "../images"]
html_static_path = ['../static']

# code blocks style
# code blocks style
pygments_style = 'colorful'
highlight_language = 'systemverilog'

html_theme_options = {
'external_links' : [
('YosysHQ Docs', 'https://yosyshq.readthedocs.io'),
('Blog', 'https://blog.yosyshq.com'),
('Website', 'https://www.yosyshq.com'),
],
"sidebar_hide_name": True,

"light_css_variables": {
"color-brand-primary": "#d6368f",
"color-brand-content": "#4b72b8",
"color-api-name": "#8857a3",
"color-api-pre-name": "#4b72b8",
"color-link": "#8857a3",
},

"dark_css_variables": {
"color-brand-primary": "#e488bb",
"color-brand-content": "#98bdff",
"color-api-name": "#8857a3",
"color-api-pre-name": "#4b72b8",
"color-link": "#be95d5",
},
}

extensions = ['sphinx.ext.autosectionlabel']
extensions += ['sphinxarg.ext']
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ formal tasks:

install.rst
quickstart.rst
usage.rst
reference.rst
autotune.rst
verilog.rst
Expand Down
3 changes: 2 additions & 1 deletion docs/source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
sphinx-press-theme
furo
sphinx-argparse
11 changes: 11 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Using `sby`
===========

Once SBY is installed and available on the command line as `sby`, either built from source or using
one of the available CAD suites, it can be called as follows. Note that this information is also
available via `sby --help`. For more information on installation, see :ref:`install-doc`.

.. argparse::
:module: sby_cmdline
:func: parser_func
:prog: sby
19 changes: 18 additions & 1 deletion docs/static/custom.css
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
/* empty */
/* Don't hide the right sidebar as we're placing our fixed links there */
aside.no-toc {
display: block !important;
}

/* Colorful headings */
h1 {
color: var(--color-brand-primary);
}

h2, h3, h4, h5, h6 {
color: var(--color-brand-content);
}

/* Use a different color for external links */
a.external {
color: var(--color-brand-primary) !important;
}
64 changes: 0 additions & 64 deletions docs/static/yosyshq.css

This file was deleted.

78 changes: 3 additions & 75 deletions sbysrc/sby.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,88 +17,16 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#

import argparse, json, os, sys, shutil, tempfile, re
import json, os, sys, shutil, tempfile, re
##yosys-sys-path##
from sby_cmdline import parser_func
from sby_core import SbyConfig, SbyTask, SbyAbort, SbyTaskloop, process_filename, dress_message
from sby_jobserver import SbyJobClient, process_jobserver_environment
import time, platform, click

process_jobserver_environment() # needs to be called early

class DictAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
assert isinstance(getattr(namespace, self.dest), dict), f"Use ArgumentParser.set_defaults() to initialize {self.dest} to dict()"
name = option_string.lstrip(parser.prefix_chars).replace("-", "_")
getattr(namespace, self.dest)[name] = values

parser = argparse.ArgumentParser(prog="sby",
usage="%(prog)s [options] [<jobname>.sby [tasknames] | <dirname>]")
parser.set_defaults(exe_paths=dict())

parser.add_argument("-d", metavar="<dirname>", dest="workdir",
help="set workdir name. default: <jobname> or <jobname>_<taskname>. When there is more than one task, use --prefix instead")
parser.add_argument("--prefix", metavar="<dirname>", dest="workdir_prefix",
help="set the workdir name prefix. `_<taskname>` will be appended to the path for each task")
parser.add_argument("-f", action="store_true", dest="force",
help="remove workdir if it already exists")
parser.add_argument("-b", action="store_true", dest="backup",
help="backup workdir if it already exists")
parser.add_argument("-t", action="store_true", dest="tmpdir",
help="run in a temporary workdir (remove when finished)")
parser.add_argument("-T", metavar="<taskname>", action="append", dest="tasknames", default=list(),
help="add taskname (useful when sby file is read from stdin)")
parser.add_argument("-E", action="store_true", dest="throw_err",
help="throw an exception (incl stack trace) for most errors")
parser.add_argument("-j", metavar="<N>", type=int, dest="jobcount",
help="maximum number of processes to run in parallel")
parser.add_argument("--sequential", action="store_true", dest="sequential",
help="run tasks in sequence, not in parallel")

parser.add_argument("--autotune", action="store_true", dest="autotune",
help="automatically find a well performing engine and engine configuration for each task")
parser.add_argument("--autotune-config", dest="autotune_config",
help="read an autotune configuration file (overrides the sby file's autotune options)")

parser.add_argument("--yosys", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths")
parser.add_argument("--abc", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths")
parser.add_argument("--smtbmc", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths")
parser.add_argument("--witness", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths")
parser.add_argument("--suprove", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths")
parser.add_argument("--aigbmc", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths")
parser.add_argument("--avy", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths")
parser.add_argument("--btormc", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths")
parser.add_argument("--pono", metavar="<path_to_executable>",
action=DictAction, dest="exe_paths",
help="configure which executable to use for the respective tool")
parser.add_argument("--dumpcfg", action="store_true", dest="dump_cfg",
help="print the pre-processed configuration file")
parser.add_argument("--dumptags", action="store_true", dest="dump_tags",
help="print the list of task tags")
parser.add_argument("--dumptasks", action="store_true", dest="dump_tasks",
help="print the list of tasks")
parser.add_argument("--dumpdefaults", action="store_true", dest="dump_defaults",
help="print the list of default tasks")
parser.add_argument("--dumptaskinfo", action="store_true", dest="dump_taskinfo",
help="output a summary of tasks as JSON")
parser.add_argument("--dumpfiles", action="store_true", dest="dump_files",
help="print the list of source files")
parser.add_argument("--setup", action="store_true", dest="setupmode",
help="set up the working directory and exit")

parser.add_argument("--init-config-file", dest="init_config_file",
help="create a default .sby config file")
parser.add_argument("sbyfile", metavar="<jobname>.sby | <dirname>", nargs="?",
help=".sby file OR directory containing config.sby file")
parser.add_argument("arg_tasknames", metavar="tasknames", nargs="*",
help="tasks to run (only valid when <jobname>.sby is used)")
parser = parser_func()

args = parser.parse_args()

Expand Down
2 changes: 1 addition & 1 deletion sbysrc/sby_autotune.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def run(self):

self.build_candidates()
if not self.active_candidates:
self.error("no supported engines found for the current configuration and design")
self.task.error("no supported engines found for the current configuration and design")
self.log(f"testing {len(self.active_candidates)} engine configurations...")

self.start_engines()
Expand Down
Loading

0 comments on commit 4cddd7a

Please sign in to comment.