Compare commits

...

30 Commits

Author SHA1 Message Date
Robert Mibus
fb2a484401
Merge 5802609aae into af55dff1ff 2024-06-12 15:33:06 +00:00
Tim 'mithro' Ansell
af55dff1ff Merge pull request #828 from antmicro/fix-docs
docs: install and load sphinxcontrib.jquery and add build section to
readthedocs.yaml
2024-03-17 14:25:23 -05:00
Tim 'mithro' Ansell
a23c3e7439
Merge pull request #826 from mithro/master
Add the `build` definition to `.readthedocs.yml`.
2024-03-17 14:22:14 -05:00
Karol Gugala
8e9aa0a6df docs: install and load sphinxcontrib.jquery
As per: https://github.com/readthedocs/sphinx_rtd_theme/issues/1452

Signed-off-by: Karol Gugala <kgugala@antmicro.com>
2024-03-17 20:02:56 +01:00
Tim 'mithro' Ansell
9161e0d4d2 Add the build definition to .readthedocs.yml.
Fixes https://github.com/im-tomu/fomu-workshop/issues/825.

Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
2024-03-17 13:35:09 -05:00
Tim 'mithro' Ansell
6cac9edd73
Merge pull request #824 from mithro/master
Remove Python version restriction.
2024-03-17 13:10:14 -05:00
Tim 'mithro' Ansell
c64c430220 Remove Python version restriction.
Signed-off-by: Tim 'mithro' Ansell <me@mith.ro>
2024-03-17 12:59:31 -05:00
dependabot[bot]
1e3b07a5ff
build(deps): bump litex/deps/litedram from 83a29b1 to e446c06 (#790)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `83a29b1` to `e446c06`.
- [Commits](83a29b190d...e446c06339)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-05 15:06:19 +02:00
dependabot[bot]
e9caeaa2d6
build(deps): bump litex/deps/litedram from e452da7 to 83a29b1 (#788)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `e452da7` to `83a29b1`.
- [Commits](e452da7a00...83a29b190d)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-29 16:30:01 +02:00
dependabot[bot]
8c74c1794b
build(deps): bump litex/deps/litedram from 6c8df7c to e452da7 (#774)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `6c8df7c` to `e452da7`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](6c8df7cc7b...e452da7a00)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-18 12:31:26 +02:00
dependabot[bot]
e5df6205d6
build(deps): bump litex/deps/litedram from 455305a to 6c8df7c (#755)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `455305a` to `6c8df7c`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](455305a3ed...6c8df7cc7b)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-25 03:23:36 +01:00
dependabot[bot]
17686f47c2
build(deps): bump litex/deps/litedram from f94366c to 455305a (#753)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `f94366c` to `455305a`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](f94366c769...455305a3ed)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-07 23:08:39 +01:00
Tim 'mithro' Ansell
c4a1ad340a
Merge pull request #751 from umarcor/umarcor/shields
readme: update shield syntax (badges/shields#8671)
2023-01-24 18:48:32 -08:00
Unai Martinez-Corral
42ab262c8f readme: update shield syntax (badges/shields#8671) 2023-01-24 22:00:37 +01:00
dependabot[bot]
b89da5d482
build(deps): bump litex/deps/migen from f3e9145 to ccaee68 (#749)
Bumps [litex/deps/migen](https://github.com/m-labs/migen) from `f3e9145` to `ccaee68`.
- [Release notes](https://github.com/m-labs/migen/releases)
- [Commits](f3e9145c98...ccaee68e14)

---
updated-dependencies:
- dependency-name: litex/deps/migen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 21:13:02 +01:00
dependabot[bot]
59f176d9d3
build(deps): bump litex/deps/litedram from d95c1fc to f94366c (#747)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `d95c1fc` to `f94366c`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](d95c1fc583...f94366c769)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-24 21:12:53 +01:00
dependabot[bot]
6664de33b1
build(deps): bump litex/deps/migen from 12eb563 to f3e9145 (#744)
Bumps [litex/deps/migen](https://github.com/m-labs/migen) from `12eb563` to `f3e9145`.
- [Release notes](https://github.com/m-labs/migen/releases)
- [Commits](12eb563e89...f3e9145c98)

---
updated-dependencies:
- dependency-name: litex/deps/migen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-18 17:14:03 +01:00
dependabot[bot]
c97f5913cf
build(deps): bump litex/deps/litedram from 8339f54 to d95c1fc (#745)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `8339f54` to `d95c1fc`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](8339f54322...d95c1fc583)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-18 17:13:50 +01:00
dependabot[bot]
6ec201c8d5
build(deps): bump litex/deps/litedram from 3b2bcf9 to 8339f54 (#740)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `3b2bcf9` to `8339f54`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](3b2bcf91ed...8339f54322)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-09 14:43:18 +01:00
dependabot[bot]
e924772c2a
build(deps): bump litex/deps/migen from 42eef58 to 12eb563 (#735)
Bumps [litex/deps/migen](https://github.com/m-labs/migen) from `42eef58` to `12eb563`.
- [Release notes](https://github.com/m-labs/migen/releases)
- [Commits](42eef5869b...12eb563e89)

---
updated-dependencies:
- dependency-name: litex/deps/migen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-19 14:42:28 +01:00
dependabot[bot]
e8a3e64737
build(deps): bump litex/deps/litedram from 1f1ab2d to 3b2bcf9 (#732)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `1f1ab2d` to `3b2bcf9`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](1f1ab2d3ea...3b2bcf91ed)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 15:25:17 +01:00
dependabot[bot]
1bf8ac0d1e
build(deps): bump litex/deps/migen from 639e66f to 42eef58 (#733)
Bumps [litex/deps/migen](https://github.com/m-labs/migen) from `639e66f` to `42eef58`.
- [Release notes](https://github.com/m-labs/migen/releases)
- [Commits](639e66f4f4...42eef5869b)

---
updated-dependencies:
- dependency-name: litex/deps/migen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-12 15:25:08 +01:00
dependabot[bot]
44b487440f
build(deps): bump litex/deps/litedram from c770dd6 to 1f1ab2d (#728)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `c770dd6` to `1f1ab2d`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](c770dd62ed...1f1ab2d3ea)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 13:19:22 +01:00
dependabot[bot]
1018c59002
build(deps): bump litex/deps/litedram from d1529d7 to c770dd6 (#720)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `d1529d7` to `c770dd6`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](d1529d7508...c770dd62ed)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-31 15:16:11 +01:00
dependabot[bot]
e7a978f098
build(deps): bump litex/deps/litedram from ae0763e to d1529d7 (#716)
Bumps [litex/deps/litedram](https://github.com/enjoy-digital/litedram) from `ae0763e` to `d1529d7`.
- [Release notes](https://github.com/enjoy-digital/litedram/releases)
- [Commits](ae0763e252...d1529d7508)

---
updated-dependencies:
- dependency-name: litex/deps/litedram
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-18 11:42:52 +02:00
dependabot[bot]
a6bca4e9dd
build(deps): bump litex/deps/litedram from 3d066c8 to ae0763e (#705)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-19 19:22:24 +01:00
Robert Mibus
5802609aae Improve rot13 comments further 2020-07-26 12:18:32 +10:00
Robert Mibus
6297c5bc8b Mention the ROT13 example in the docs 2020-07-25 15:36:45 +10:00
Robert Mibus
5a3c933cf3 Add some comments to the ROT13 example 2020-07-25 13:42:39 +10:00
Robert Mibus
fd8739d517 Add a ROT13 workshop example 2020-07-25 13:02:22 +10:00
9 changed files with 126 additions and 5 deletions

View File

@ -5,6 +5,12 @@
# Required
version: 2
build:
os: ubuntu-lts-latest
tools:
# Need to use mambaforge as miniconda runs out of memory on rtd.
python: mambaforge-latest
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

View File

@ -7,9 +7,9 @@
-->
<a title="Nightly build" href="https://im-tomu.github.io/fomu-workshop"><img src="https://img.shields.io/website.svg?label=im-tomu.github.io%2Ffomu-workshop&longCache=true&style=flat-square&url=http%3A%2F%2Fim-tomu.github.io%2Ffomu-workshop%2Findex.html&logo=GitHub&logoColor=fff"></a><!--
-->
<a title="'test' workflow status" href="https://github.com/im-tomu/fomu-workshop/actions?query=workflow%3Atest"><img alt="'test' workflow status" src="https://img.shields.io/github/workflow/status/im-tomu/fomu-workshop/test?longCache=true&style=flat-square&label=test&logo=Github%20Actions&logoColor=fff"></a><!--
<a title="'test' workflow status" href="https://github.com/im-tomu/fomu-workshop/actions/workflows/test.yml"><img alt="'test' workflow status" src="https://img.shields.io/github/actions/workflow/status/im-tomu/fomu-workshop/test.yml?branch=master&longCache=true&style=flat-square&label=test&logo=Github%20Actions&logoColor=fff"></a><!--
-->
<a title="'doc' workflow status" href="https://github.com/im-tomu/fomu-workshop/actions?query=workflow%3Adoc"><img alt="'doc' workflow status" src="https://img.shields.io/github/workflow/status/im-tomu/fomu-workshop/doc?longCache=true&style=flat-square&label=doc&logo=Github%20Actions&logoColor=fff"></a><!--
<a title="'doc' workflow status" href="https://github.com/im-tomu/fomu-workshop/actions/workflows/doc.yml"><img alt="'doc' workflow status" src="https://img.shields.io/github/actions/workflow/status/im-tomu/fomu-workshop/doc.yml?branch=master&longCache=true&style=flat-square&label=doc&logo=Github%20Actions&logoColor=fff"></a><!--
-->
</p>

View File

@ -38,6 +38,7 @@ author = 'Tomu Project Authors'
# ones.
extensions = [
# 'sphinx.ext.intersphinx',
'sphinxcontrib.jquery',
'sphinx.ext.todo',
'sphinx.ext.githubpages',
'sphinx.ext.extlinks',

View File

@ -4,7 +4,7 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.7
- python
- pip
- pycairo
- pango

View File

@ -198,3 +198,10 @@ your ``build/csr.csv`` says) and see them take effect immediately.
You can see that it takes very little code to take a Signal from HDL and
expose it on the Wishbone bus.
Tying Signals together
^^^^^^^^^^^^^^^^^^^^^^
See ``workshop_rot13.py`` for another example, where two CSRs are connected
(one as an input, one as an output) in order to create a one-character ROT13
encoder/decoder.

View File

@ -1,5 +1,6 @@
sphinx>=4.5.0
sphinx-autobuild
sphinxcontrib-jquery
# Better looking Sphinx theme
# sphinx_materialdesign_theme

@ -1 +1 @@
Subproject commit 3d066c87f948e3f8584dfa0244d0930161f71e62
Subproject commit e446c063397079bbf558601d7bb2deddb501a620

@ -1 +1 @@
Subproject commit 639e66f4f453438e83d86dc13491b9403bbd8ec6
Subproject commit ccaee68e14d3636e1d8fb2e0864dd89b1b1f7384

106
litex/workshop_rot13.py Executable file
View File

@ -0,0 +1,106 @@
#!/usr/bin/env python3
# This variable defines all the external programs that this module
# relies on. lxbuildenv reads this variable in order to ensure
# the build will finish without exiting due to missing third-party
# programs.
LX_DEPENDENCIES = ["icestorm", "yosys", "nextpnr-ice40"]
#LX_CONFIG = "skip-git" # This can be useful for workshops
# Import lxbuildenv to integrate the deps/ directory
import os,os.path,shutil,sys,subprocess
sys.path.insert(0, os.path.dirname(__file__))
import lxbuildenv
# Disable pylint's E1101, which breaks completely on migen
#pylint:disable=E1101
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.soc.integration.soc_core import SoCCore
from litex.soc.integration.builder import Builder
from litex.soc.interconnect.csr import AutoCSR, CSRStatus, CSRStorage, CSRField
from litex_boards.partner.targets.fomu import BaseSoC, add_dfu_suffix
from valentyusb.usbcore import io as usbio
from valentyusb.usbcore.cpu import dummyusb
import argparse
# ROT13 input CSR. Doesn't need to do anything special.
class FomuROT13In(Module, AutoCSR):
def __init__(self):
# 8-Bit CSR (one ASCII character)
self.csr = CSRStorage(8)
# ROT13 output CSR, plus the wiring to automatically create the output from
# the input CSR.
class FomuROT13Out(Module, AutoCSR):
def __init__(self, rot13_in):
# Set up an 8-bit CSR (one ASCII character)
self.csr = CSRStorage(8)
# ROT13 is described fully here - https://en.wikipedia.org/wiki/ROT13
#
# In short, for letters of the English alphabet, they're "rotated" 13
# places along ("A" becomes "N", "B" becomes "O"); at the end of the
# alphabet you wrap back around ("Z" becomes "M"). Anything not in
# the English alphabet (numbers, special characters) is left
# untouched.
#
# Conveniently (due to the wrap-around property) we can just
# *subtract* 13 to get the same result as the wrap-around.
#
# This means we care about three cases:
# 1. It's "A" through "M": Add 13, to make the letters "N" through "Z".
# (Likewise for lowercase "a" through "m").
# 2. It's "N" through "Z": Remove 13, to make the letters "A" through "M".
# (Likewise for lowercase "n" through "z").
# 3. It's something else, so leave it alone.
#
# In all three cases, we want to wire up the "output" signal (self.csr.storage)
# to be equal to something based on the input signal (rot13_in.csr.storage).
self.sync += If( # A-M, a-m
(rot13_in.csr.storage >= ord('A')) & (rot13_in.csr.storage <= ord('M')) | (rot13_in.csr.storage >= ord('a')) & (rot13_in.csr.storage <= ord('m')),
self.csr.storage.eq(rot13_in.csr.storage + 13)
).Elif( # N-Z, n-z
(rot13_in.csr.storage >= ord('N')) & (rot13_in.csr.storage <= ord('Z')) | (rot13_in.csr.storage >= ord('n')) & (rot13_in.csr.storage <= ord('z')),
self.csr.storage.eq(rot13_in.csr.storage - 13)
).Else(
self.csr.storage.eq(rot13_in.csr.storage)
)
def main():
parser = argparse.ArgumentParser(
description="Build Fomu Main Gateware")
parser.add_argument(
"--seed", default=0, help="seed to use in nextpnr"
)
parser.add_argument(
"--placer", default="heap", choices=["sa", "heap"], help="which placer to use in nextpnr"
)
parser.add_argument(
"--board", choices=["evt", "pvt", "hacker"], required=True,
help="build for a particular hardware board"
)
args = parser.parse_args()
soc = BaseSoC(args.board, pnr_seed=args.seed, pnr_placer=args.placer, usb_bridge=True)
# Create a CSR-based ROT13 input and output, export the CSRs
rot13_in = FomuROT13In()
soc.submodules.fomu_rot13_in = rot13_in
soc.submodules.fomu_rot13_out = FomuROT13Out(rot13_in)
soc.add_csr("fomu_rot13_in")
soc.add_csr("fomu_rot13_out")
builder = Builder(soc,
output_dir="build", csr_csv="build/csr.csv",
compile_software=False)
vns = builder.build()
soc.do_exit(vns)
add_dfu_suffix(os.path.join('build', 'gateware', 'top.bin'))
if __name__ == "__main__":
main()