Skip to content

Commit

Permalink
add maia-sdr v0.1.0 release
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Estévez <[email protected]>
  • Loading branch information
daniestevez committed Feb 9, 2023
1 parent 89a38a8 commit ec35d6b
Show file tree
Hide file tree
Showing 167 changed files with 21,541 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*~
\#*\#
\.\#*
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "maia-hdl/adi-hdl"]
path = maia-hdl/adi-hdl
url = https://github.com/analogdevicesinc/hdl
[submodule "maia-hdl/XilinxUnisimLibrary"]
path = maia-hdl/XilinxUnisimLibrary
url = https://github.com/Xilinx/XilinxUnisimLibrary/
133 changes: 133 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@

# Maia SDR Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[[email protected]](mailto:[email protected]).
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributing to Maia SDR

## DCO

Contributions submitted for inclussion in Maia SDR shall be licensed under the
same licenses of the components affected by the contribution. It is therefore
imperative that code submissions belong to the authors, and that submitters have
the authority to merge that code into the public Maia SDR codebase.

For that purpose, we use the [Developer's Certificate of Origin](DCO.txt). It is
the same document used by other projects. Signing the DCO states that there are
no legal reasons to not merge your code.

To sign the DCO, suffix your git commits with a "Signed-off-by" line. When using
the command line, you can use `git commit -s` to automatically add this line. If
there were multiple authors of the code, or other types of stakeholders, make
sure that all are listed, each with a separate Signed-off-by line.

## Coding guidelines

The usual coding guidelines apply for each language. For Python we follow PEP8,
and for Rust we use `rustfmt` to format the code.

## Git commit messages

We follow standard git commit message guidelines, similar to many other open
source projects. See the coding guidelines for more details. In a nutshell:

* Keep the lines below 72 characters.
* Subject line has the component prepended (e.g., `maia-hdl:`).
* Avoid empty git commit messages.
* The git commit message explains the change, the code only explains the current
state.
34 changes: 34 additions & 0 deletions DCO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Developer Certificate of Origin
Version 1.1

Copyright (C) 2004, 2006 The Linux Foundation and its contributors.

Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.


Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Maia SDR

[Maia SDR](https://maia-sdr.org) is an open-source FPGA-based SDR project focusing on the [ADALM
Pluto](https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/adalm-pluto.html).

It currently provides a firmware image for the Pluto with the following functionality:
* Web-based interface that can be accessed from a smartphone, PC or other device.
* Real-time waterfall display supporting up to 61.44 Msps (limit given by the
AD936x RFIC of the Pluto).
* IQ recording in [SigMF format](https://github.com/gnuradio/SigMF), at up to
61.44 Msps and with a 400 MiB maximum data size (limit given by the Pluto RAM
size). Recordings can be downloaded to a smartphone or other device.

See [maia-sdr.org](https://maia-sdr.org) for more details.

## Firmware images

Firmware images for the ADALM Pluto can be found in the
[plutosdr-fw](https://github.com/maia-sdr/plutosdr-fw) repository. See also the
[installation instructions](https://maia-sdr.org/installation/).

## Support

Support for Maia SDR is handled through
[Github issues](https://github.com/maia-sdr/maia-sdr/issues)
and
[Github discussions](https://github.com/maia-sdr/maia-sdr/discussions).

## Project structure

The project is divided into the following components:

* [maia-hdl](maia-hdl). The FPGA design. It is written in
[Amaranth](https://github.com/amaranth-lang/amaranth). It can be used to build
the Vivado project and bitstream for Maia SDR or as a library in other projects.
* [maia-httpd](maia-httpd). The software application that runs on the Zynq ARM CPU.
It is written in asynchronous Rust and spawns a web server.
* [maia-kmod](maia-kmod). A kernel module used to control some RAM buffers that
are used to exchange data between the FPGA and CPU.
* [maia-wasm](maia-wasm). A web application that is the UI of Maia SDR. IT is
written in Rust with WebAssembly and uses WebGL2 to render the waterfall.

## License

maia-hdl is licensed under the
[MIT license](http://opensource.org/licenses/MIT). maia-httpd and maia-wasm are
licensed under either of the
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
or the MIT license at your option. maia-kmod is licensed under the
[GPL, version 2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html).



23 changes: 23 additions & 0 deletions maia-hdl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
*.v
*.xpr
*.cache
*.gen
*.hw
*.ip_user_files
*.runs
*.srcs
*.sdk
*.jou
*.log
*.Xil
xgui
/ip/*/component.xml
!/projects/*/*.v
!/test_cocotb/*/*.v
/test_cocotb/*/dut.v
/test_cocotb/*/results.xml
/test_cocotb/*/sim_build
*.gtkw
*.vcd
__pycache__
/dist
19 changes: 19 additions & 0 deletions maia-hdl/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2022-2023 Daniel Estevez <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions maia-hdl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.PHONY: clean

clean:
make -C adi-hdl clean
make -C ip clean
make -C projects clean
make -C test_cocotb clean
60 changes: 60 additions & 0 deletions maia-hdl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# maia-hdl

## Installation

It is not necessary to install maia-hdl in order to generate the Vivado IP cores
or projects, or to run the tests and simulations. These can be run as indicated
below.

It is possible to install maia-hdl as a Python package in order to be able to
use it (with `import maia_hdl`) in other Python code and projects. The latest
packaged version of maia-hdl can be installed with
```
pip install maia_hdl
```

The current checkout of this source tree can be installed with
```
pip install .
```

## Building the Vivado IP cores and projects

The build system for the Vivado IP cores and projects is based on Makefiles. The
IP cores can be built by running `make` from the `ip` directory. A specific IP
core can be built by running `make` from its subdirectory inside the `ip`
directory.

The Vivado projects can be built by running `make` from the `projects`
directory. A specific project cna be built by running `make` from its
subdirectory inside the `projects` directory. This will create the Vivado
project and block diagram, run synthesis and place and route, and finally
generate the bitstream.

## Testing

Pure Amaranth tests can be run with
```
python3 -m unittest
```

Mixed Amaranth/Verilog tests use [cocotb](https://www.cocotb.org/) and a Verilog
simulator such as [Icarus Verilog](http://iverilog.icarus.com/). Verilog code is
generated from the Amaranth code, so the simulation involves only Verilog code
and the Python code running from cocotb. The test execution of cocotb is based
on Makefiles. Tests can be run by running `make` from the `test_cocotb`
directory. It is possible to check which tests failed with
```
grep --include=results.xml -r -e failure .
```

## License

Licensed under MIT license ([LICENSE-MIT](LICENSE-MIT) or
http://opensource.org/licenses/MIT).

## Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, shall be licensed as above, without any
additional terms or conditions.
1 change: 1 addition & 0 deletions maia-hdl/XilinxUnisimLibrary
Submodule XilinxUnisimLibrary added at 1c8e05
1 change: 1 addition & 0 deletions maia-hdl/adi-hdl
Submodule adi-hdl added at d09fc9
9 changes: 9 additions & 0 deletions maia-hdl/ip/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
TOPTARGETS := all clean

SUBDIRS := $(filter-out $(wildcard _*/.), $(wildcard */.))

$(TOPTARGETS): $(SUBDIRS)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)

.PHONY: $(TOPTARGETS) $(SUBDIRS)
Loading

0 comments on commit ec35d6b

Please sign in to comment.