Skip to content

Commit

Permalink
squishy: big-renovation-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lethalbit committed Nov 8, 2024
1 parent 269ee52 commit 9da2117
Show file tree
Hide file tree
Showing 140 changed files with 4,336 additions and 5,261 deletions.
138 changes: 27 additions & 111 deletions contrib/squishy-completion.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
_squishy_command() {
local -a commands=(
'applet[Squishy applet subsystem]'
'cache[Squishy applet cache managment]'
'provision[Squishy hardware provisioning]'
)
_values 'squishy commands' : $commands
Expand All @@ -15,7 +14,6 @@ _squishy_command() {
_squishy_applet_command() {
local -a commands=(
'analyzer[Squishy SCSI analyzer]'
'taperipper[UEFI Boot from 9-track tape]'
)
_values 'squishy applets' : $commands
}
Expand All @@ -31,17 +29,6 @@ _squishy_applet_analyzer() {
_arguments -s : $arguments
}

_squishy_applet_taperipper() {
local arguments

arguments=(
'(-h --help)'{-h,--help}'[Show help message and exit]'

)

_arguments -s : $arguments
}

_squishy_applet() {
local arguments
local platforms=`python -m squishy applet -h | tail -n +4 | grep -m1 -e '\-\-platform\s{' | sed 's/,\s-p\s.*$//' | sed 's/--platform\s{\([^}]*\)}/\1/'`
Expand All @@ -50,31 +37,22 @@ _squishy_applet() {
'(-h --help)'{-h,--help}'[Show help message and exit]'
'(-p --platforms)'{-p=,--platforms=}"[Target hardware platform]:platform:(${(s/,/)platforms})"

'--skip-cache[Skip bitstream cache lookup]'
'(-b --build-dir)'{-b,--build-dir}"[Output directory for build products]:dir:_directories"
'--loud[Enables output from PnR and synthesis]'
'--build-only[Only build the applet]'

'--use-router2[Use nextpnrs router2 rather than router1]'
'--tmp-ripup[Use timing driven ripup]'
'--detailed-timing-report[Output a detailed timing report]'
'--routed-svg[Save an svg of the routed output]:svg:_files -g "*.svg"'
'--routed-json[Save routed json netlist]:json:_files -g "*.json"'
'--pnr-seed[Specify PNR seed]:seed:_numbers -l 0 "PNR_SEED"'

'(-Y --noconfirm)'{-Y,--noconfirm}'[Do not ask for confirmation if the target applet is in preview]'
'(-F --flash)'{-f,--flash}'[Flash the applet into persistent storage raather then doing an ephemeral load if supported]'

'--no-abc9[Disable ABC9 durring synthesis]'
'(-B --build-only)'{-B,--build-only}'[Only build and pack the applet, skip device programming]'
'(-b --build-dir)'{-b,--build-dir}"[Output directory for build products]:dir:_directories"
'(-C --skip-cache)'{-C,--skip-cache}'[Skip artifact cache lookup and squesequent insertion when build is completed]'
'--build-verbose[Enable verbose tool output during build]'

'--enable-webusb[Enable the experimental WebUSB support]'
'--webusb-url=[WebUSB URL to encode]:url:_urls'
'--no-abc9[Disable use of abc9, will likely result in worse applet performance]'
'--no-aggressive-mapping[Disable multiple abc9 passes, speeds up build time in exchange for worse performance]'

'(-U --enable-uart)'{-U,--enable-uart}'[Enable debug UART]'
'(-B --baud)'{-B,--baud}'=[Baud rate to run the debug UART at]:baud:_numbers -d 9600'
'(-D --data-bits)'{-D,--data-bits}'=[Data bits to use for the debug UART]:data:_numbers -d 8'
'(-c --parity)'{-c,--parity}'=[Parity mode to use for the debug UART]:parity:(none mark spaceeven odd)'
'--detailed-report[Output a detailed timing report]'
'--routed-netlist[Save routed json netlist]:json:_files -g "*.json"'
'--pnr-seed[Specify PNR seed]:seed:_numbers -l 0 "PNR_SEED"'

'--scsi-did=[The SCSI ID to use]:scsi_id:_numbers -l 0 -m 7 "SCSI ID"'
'--scsi-arbitrating[Enable SCSI bus arbitration]'
'--dont-compress[Disable bitstream compression if supported on the platform]'

'(-): :->applet'
'(-)*:: :->applet_args'
Expand All @@ -92,9 +70,6 @@ _squishy_applet() {
(analyzer)
_squishy_applet_analyzer && ret=0
;;
(taperipper)
_squishy_applet_taperipper && ret=0
;;
esac
;;
esac
Expand All @@ -109,22 +84,24 @@ _squishy_provision() {
'(-h --help)'{-h,--help}'[Show help message and exit]'
'(-p --platforms)'{-p=,--platforms=}"[Target hardware platform]:platform:(${(s/,/)platforms})"

'--skip-cache[Skip bitstream cache lookup]'
'(-Y --noconfirm)'{-Y,--noconfirm}'[Do not ask for confirmation if the target applet is in preview]'
'(-F --flash)'{-f,--flash}'[Flash the applet into persistent storage raather then doing an ephemeral load if supported]'

'(-B --build-only)'{-B,--build-only}'[Only build and pack the applet, skip device programming]'
'(-b --build-dir)'{-b,--build-dir}"[Output directory for build products]:dir:_directories"
'--loud[Enables output from PnR and synthesis]'
'--build-only[Only build the applet]'

'--use-router2[Use nextpnrs router2 rather than router1]'
'--tmp-ripup[Use timing driven ripup]'
'--detailed-timing-report[Output a detailed timing report]'
'--routed-svg[Save an svg of the routed output]:svg:_files -g "*.svg"'
'--routed-json[Save routed json netlist]:json:_files -g "*.json"'
'--build-verbose[Enable verbose tool output during build]'

'--no-abc9[Disable use of abc9, will likely result in worse applet performance]'
'--no-aggressive-mapping[Disable multiple abc9 passes, speeds up build time in exchange for worse performance]'

'--detailed-report[Output a detailed timing report]'
'--routed-netlist[Save routed json netlist]:json:_files -g "*.json"'
'--pnr-seed[Specify PNR seed]:seed:_numbers -l 0 "PNR_SEED"'

'--no-abc9[Disable ABC9 durring synthesis]'
'--dont-compress[Disable bitstream compression if supported on the platform]'

'(-S --serial-number)'{-S,--serial-number}'[Specify Serial Number to use]'
'(-W --whole-device)'{-W,--whole-device}'=[Generate a whole device provisioning image for factory progrssming]'
'(-S --serial-number)'{-S,--serial-number}'[Specify serial number to use]'
'(-W --whole-device)'{-W,--whole-device}'=[Generate a whole device provisioning image for factory programming]'
)

_arguments -s : $arguments && return
Expand All @@ -133,65 +110,6 @@ _squishy_provision() {
return 0
}

_squishy_cache_command() {
local -a commands=(
'list[Show cache status]'
'clear[Clear cache]'
)
_values 'squishy cache' : $commands
}

_squishy_cache_list() {
local arguments
arguments=(
'(-h --help)'{-h,--help}'[Show help message and exit]'
'--list-cache-items[List each item in the cache (WARNING: CAN BE LARGE)]'
)

_arguments -s : $arguments
}

_squishy_cache_clear() {
local arguments
arguments=(
'(-h --help)'{-h,--help}'[Show help message and exit]'

)

_arguments -s : $arguments
}

_squishy_cache() {
local arguments
integer ret=1

arguments=(
'(-h --help)'{-h,--help}'[Show help and exit]'

'(-): :->action'
'(-)*:: :->action_args'
)

_arguments -s : $arguments && return

case $state in
(action)
_squishy_cache_command && ret=0
;;
(action_args)
curcontext=${curcontext%:*:*}:squishy-$words[1]:
case $words[1] in
(list)
_squishy_cache_list && ret=0
;;
(clear)
_squishy_cache_clear && ret=0
;;
esac
;;
esac
return $ret
}

_squishy() {
local arguments context curcontext=$curcontext state state_descr line
Expand All @@ -201,6 +119,7 @@ _squishy() {
'(-h --help)'{-h,--help}'[show version and help then exit]'
'(-d --device)'{-d,--device}'=[specify device serial number]'
'(-v --verbose)'{-v,--verbose}'[verbose logging]'
'(-V --version)'{-V,--version}'[show version and exit]'
'(-): :->command'
'(-)*:: :->arguments'
)
Expand All @@ -217,9 +136,6 @@ _squishy() {
(applet)
_squishy_applet && ret=0
;;
(cache)
_squishy_cache && ret=0
;;
(provision)
_squishy_provision && ret=0
esac
Expand Down
8 changes: 8 additions & 0 deletions docs/_static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ code.literal {
border-radius: 5px;
}

div.sidebar-container {
width: 25em;
}

div.toc-drawer {
width: 20em;
}

svg.WaveDrom {
padding: 10px;
border-radius: 5px;
Expand Down
8 changes: 0 additions & 8 deletions docs/applets/api/cli.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/applets/api/device.md

This file was deleted.

7 changes: 2 additions & 5 deletions docs/applets/index.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Squishy Applets
# Applets

```{toctree}
:hidden:
analyzer
taperipper
api/index
```

```{todo}
Expand All @@ -16,13 +14,12 @@ Flesh this section out
Squishy allows for the development of modular pieces of combined code and [Torii HDL] gateware called an applet. It gives Squishy it's functionality and allows for the extension of said functionality and/or entirely new custom functionality.


There are currently two built-in applets, the [analyzer], and [taperipper]applets. With more built-in applets are planned for the future.
There is currently one built-in applet, the [analyzer], with more built-in applets are planned for the future.

Squishy allows you to run your own custom applets, any python packages in the `SQUISHY_APPLETS` directory are attempted to be loaded as an applet, and then exposed to the user to allow them to invoke.

For more details on custom applets, see the [Custom Applet] tutorial for a walkthrough of developing your own Squishy applet.

[Custom Applet]: ../tutorials/applets/index.md
[analyzer]: ./analyzer.md
[taperipper]: ./taperipper.md
[Torii HDL]: https://github.com/shrine-maiden-heavy-industries/torii-hdl
7 changes: 0 additions & 7 deletions docs/applets/taperipper.md

This file was deleted.

25 changes: 13 additions & 12 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@
'.md': 'markdown',
}

pygments_style = 'monokai'
autodoc_member_order = 'bysource'
graphviz_output_format = 'svg'
todo_include_todos = True
pygments_style = 'monokai'
autodoc_member_order = 'bysource'
autodoc_docstring_signature = False
graphviz_output_format = 'svg'
todo_include_todos = True

intersphinx_mapping = {
'python' : ('https://docs.python.org/3', None),
Expand All @@ -43,12 +44,13 @@
'construct': ('https://construct.readthedocs.io/en/latest', None),
}

napoleon_google_docstring = False
napoleon_numpy_docstring = True
napoleon_use_ivar = True
napoleon_custom_sections = [
'Platform overrides'
]
napoleon_google_docstring = True
napoleon_numpy_docstring = True
napoleon_use_ivar = True
napoleon_use_admonition_for_notes = True
napoleon_use_admonition_for_examples = True
napoleon_use_admonition_for_references = True


myst_heading_anchors = 3

Expand Down Expand Up @@ -79,8 +81,7 @@
ogp_image = f'{html_baseurl}/_images/og-image.png'

autosectionlabel_prefix_document = True
# Disable CDN so we use the local copy
mermaid_version = ''


offline_skin_js_path = '_static/js/wavedrom.skin.js'
offline_wavedrom_js_path = '_static/js/wavedrom.min.js'
Expand Down
6 changes: 3 additions & 3 deletions docs/hardware/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ There are two main ways to get squishy hardware, buying it, or building it.
### Buying Hardware

```{note}
As of 2024-03-10, Squishy hardware is not available for sale, however, once engineering and validation of Revision 2 is completed, rev2 units are expected to be available to purchase.
As of 2024-11-07, Squishy hardware is not available for sale, however, once engineering and validation of Revision 2 is completed, rev2 units are expected to be available to purchase.
```

### Building Hardware
Expand All @@ -48,11 +48,11 @@ If you buy a pre-built Squishy, it will already be provisioned, but in case some

### Work-In-Progress Hardware

The hardware is always a work in progress, you can view a live rendering of the WIP hardware in your web browser [here](https://kicanvas.org/?github=https%3A%2F%2Fgithub.com%2Fsquishy-scsi%2Fhardware%2Ftree%2Fmain%2Fboards%2Fsquishy), thanks to [KiCanvas].
The hardware is always a work in progress, you can view a live rendering of the WIP hardware in your web browser [here](https://kicanvas.org/?github=https://github.com/squishy-scsi/hardware/blob/main/boards/squishy/main-unit/squishy-main.kicad_pro), thanks to [KiCanvas].


[provisioning]: ../tutorials/provisioning.md
[`rev1`]: ./rev1.md
[`rev2`]: ./rev2.md
[here]: https://kicanvas.org/?github=https%3A%2F%2Fgithub.com%2Fsquishy-scsi%2Fhardware%2Ftree%2Fmain%2Fboards%2Fsquishy
[here]: https://kicanvas.org/?github=https://github.com/squishy-scsi/hardware/blob/main/boards/squishy/main-unit/squishy-main.kicad_pro
[KiCanvas]: https://kicanvas.org
3 changes: 1 addition & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Squishy is not a *specialized* device targeting only a single aspect of the SCSI

## What Squishy Is

Squishy is a platform, it allows you to accomplish almost any goal you wish to that involves a SCSI bus. It can do things as mundane as emulating a SCSI hard drive, but also you can use it to [sniff, analyze, and replay SCSI bus traffic], or even [boot a modern system from 9-track tape].
Squishy is a platform, it allows you to accomplish almost any goal you wish to that involves a SCSI bus. It can do things as mundane as emulating a SCSI hard drive, but also you can use it to [sniff, analyze, and replay SCSI bus traffic], or even boot a modern system from 9-track tape.

You can think of Squishy as being "Software Defined SCSI", much like how a Software Defined Radio works with a hardware transceiver and a software ecosystem, Squishy provides the same, but for SCSI.

Expand Down Expand Up @@ -99,7 +99,6 @@ There are also [GitHub Discussions] enabled on the repository if you have any qu
Squishy does not have an official discord, nor any endorsed discord servers, for an explanation as to why, see the [F.A.Q.]
```
[sniff, analyze, and replay SCSI bus traffic]: ./applets/analyzer.md
[boot a modern system from 9-track tape]: ./applets/taperipper.md
[gateware]: ./library/gateware/index.md
[python]: ./library/python/index.md
[hardware]: ./hardware/index.md
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `squishy.applets.SquishyApplet`
# Squishy Applet

```{toctree}
:hidden:
Expand Down
16 changes: 16 additions & 0 deletions docs/library/applet/device.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Squishy Device

```{toctree}
:hidden:
```

```{todo}
Flesh this out
```

```{eval-rst}
.. autoclass:: squishy.device.SquishyDevice
:members:
```
Loading

0 comments on commit 9da2117

Please sign in to comment.