From 0a8d73334858b408f4fc4aa62e1c25425440f4b0 Mon Sep 17 00:00:00 2001 From: Douglas Reis Date: Mon, 18 Aug 2025 17:10:10 +0100 Subject: [PATCH 1/3] Add contributing documentation Signed-off-by: Douglas Reis --- CLA | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 56 +++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 CLA create mode 100644 CONTRIBUTING.md diff --git a/CLA b/CLA new file mode 100644 index 0000000..8b628e0 --- /dev/null +++ b/CLA @@ -0,0 +1,87 @@ +lowRISC CIC +Contributor License Agreement ("Agreement") v1.0 + +You accept and agree to the following terms and conditions for Your present and +future Contributions submitted to the Project. Except for the license granted +herein to the Project and recipients of software distributed by the Project, +You reserve all right, title, and interest in and to Your Contributions. + +1. Definitions. + +"You" (or "Your") shall mean the copyright owner or legal entity authorized by +the copyright owner that is making this Agreement with the Project. For legal +entities, the entity making a Contribution and all other entities that control, +are controlled by, or are under common control with that entity are considered +to be a single Contributor. For the purposes of this definition, "control" +means (i) the power, direct or indirect, to cause the direction or management +of such entity, whether by contract or otherwise, or (ii) ownership of fifty +percent (50%) or more of the outstanding shares, or (iii) beneficial ownership +of such entity. + +"Contribution" shall mean any original work of authorship, including any +modifications or additions to an existing work, that is intentionally submitted +by You to the Project for inclusion in, or documentation of, any of the +products owned or managed by the Project (the "Work"). For the purposes of this +definition, "submitted" means any form of electronic, verbal, or written +communication sent to the Project or its representatives, including but not +limited to communication on electronic mailing lists, source code control +systems, and issue tracking systems that are managed by, or on behalf of, the +Project for the purpose of discussing and improving the Work, but excluding +communication that is conspicuously marked or otherwise designated in writing +by You as "Not a Contribution." + +2. Grant of Copyright License. Subject to the terms and conditions of this +Agreement, You hereby grant to the Project and to recipients of software +distributed by the Project a perpetual, worldwide, non-exclusive, no-charge, +royalty-free, irrevocable copyright license to reproduce, prepare derivative +works of, publicly display, publicly perform, sublicense, and distribute Your +Contributions and such derivative works. + +3. Grant of Patent License. Subject to the terms and conditions of this +Agreement, You hereby grant to the Project and to recipients of the Work +distributed by the Project a perpetual, worldwide, non-exclusive, no-charge, +royalty-free, irrevocable (except as stated in this section) patent license to +make, have made, use, offer to sell, sell, import, and otherwise transfer the +Work, where such license applies only to those patent claims licensable by You +that are necessarily infringed by Your Contribution(s) alone or by combination +of Your Contribution(s) with the Work to which such Contribution(s) was +submitted. If any entity institutes patent litigation against You or any other +entity (including a cross-claim or counterclaim in a lawsuit) alleging that +your Contribution, or the Work to which you have contributed, constitutes +direct or contributory patent infringement, then any patent licenses granted to +that entity under this Agreement for that Contribution or Work shall terminate +as of the date such litigation is filed. + +4. You represent that you are legally entitled to grant the above license. If +your employer(s) has rights to intellectual property that you create that +includes your Contributions, you represent that you have received permission to +make Contributions on behalf of that employer, that your employer has waived +such rights for your Contributions to the Project, or that your employer has +executed a separate Corporate CLA with the Project. + +5. You represent that each of Your Contributions is Your original creation (see +section 7 for submissions on behalf of others). You represent that Your +Contribution submissions include complete details of any third-party license or +other restriction (including, but not limited to, related patents and +trademarks) of which you are personally aware and which are associated with any +part of Your Contributions. + +6. You are not expected to provide support for Your Contributions, except to +the extent You desire to provide support. You may provide support for free, for +a fee, or not at all. Unless required by applicable law or agreed to in +writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES +OR CONDITIONS OF ANY KIND, either express or implied, including, without +limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, +MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. + +7. Should You wish to submit work that is not Your original creation, You may +submit it to the Project separately from any Contribution, identifying the +complete details of its source and of any license or other restriction +(including, but not limited to, related patents, trademarks, and license +agreements) of which you are personally aware, and conspicuously marking the +work as "Submitted on behalf of a third-party: [named here]". + +8. You agree to notify the Project of any facts or circumstances of which you +become aware that would make these representations inaccurate in any respect. + +Please sign: __________________________________ Date: ________________ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..8657522 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,56 @@ +# Contributing code to the Benevis repository + + +## Contributor License Agreement + +Contributions to Benevis must be accompanied by sign-off text that indicates +acceptance of the Contributor License Agreement (see [CLA](CLA) for full +text), which is closely derived from the Apache Individual Contributor License +Agreement. The sign-off text must be included once per commit, in the commit +message. The sign-off can be automatically inserted using a command such as +`git commit -s`, which will generate the text in the form: +`Signed-off-by: Random J Developer ` + +By adding this sign-off, you are certifying: + +_By signing-off on this submission, I agree to be bound by the terms of the +Contributor License Agreement located at the root of the project repository, +and I agree that this submission constitutes a "Contribution" under that +Agreement._ + +Please note that this project and any contributions to it are public and that +a record of all contributions (including any personal information submitted +with it, including a sign-off) is maintained indefinitely and may be +redistributed consistent with this project or the open source license(s) +involved. + +## Quick guidelines + +* Keep a clean commit history. This means no merge commits, and no long series + of "fixup" patches (rebase or squash as appropriate). Structure work as a + series of logically ordered, atomic patches. `git rebase -i` is your friend. +* Changes should be made via pull request, with review. A pull request will be + committed by a "committer" once it has had an explicit positive review. +* When changes are restricted to a specific area, you are recommended to add a + tag to the beginning of the first line of the commit message in square + brackets. e.g. "[rdl2ot] Fix bug #15". +* Code review is not design review and doesn't remove the need for discussing + implementation options. If you would like to make a large-scale change or + discuss multiple implementation options, discuss on the mailing list. +* Create pull requests from a fork rather than making new branches in + `github.com/lowrisc/Benevis`. +* Do not attempt to commit code with a non-Apache license without discussing + first. +* If a relevant bug or tracking issue exists, reference it in the pull request + and commits. + +For a detailed why and how please refer to one of the multiple [resources](https://chris.beams.io/posts/git-commit/) regarding git commit messages. + +If you use `vi` for your commit message, consider to put the following snippet inside your `~/.vimrc`: + +``` +autocmd Filetype gitcommit setlocal spell textwidth=72 +``` From 534c2108c483d5429b7935d0f69e06bddc4c101e Mon Sep 17 00:00:00 2001 From: Douglas Reis Date: Mon, 18 Aug 2025 14:20:03 +0100 Subject: [PATCH 2/3] Add license header to files Signed-off-by: Douglas Reis --- .gitignore | 4 ++++ README.md | 5 +++++ flake.nix | 4 ++++ pyproject.toml | 4 ++++ rdl2ot/README.md | 5 +++++ rdl2ot/pyproject.toml | 4 ++++ rdlexporter/README.md | 5 +++++ rdlexporter/pyproject.toml | 4 ++++ 8 files changed, 35 insertions(+) diff --git a/.gitignore b/.gitignore index b7faf40..a5cab5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + # Byte-compiled / optimized / DLL files __pycache__/ *.py[codz] diff --git a/README.md b/README.md index 560a041..a31a4b9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ # BenevisRDL + + This repository will house PeakRDL plugins, named after Ben Nevis, the UK's tallest peak. ## Installing dependencies diff --git a/flake.nix b/flake.nix index 1a7547e..8518497 100644 --- a/flake.nix +++ b/flake.nix @@ -1,3 +1,7 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + { description = "Python env for rdl2ot"; diff --git a/pyproject.toml b/pyproject.toml index 90f0151..0f841d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + [project] name = "benevisrdl" version = "0.1.0" diff --git a/rdl2ot/README.md b/rdl2ot/README.md index 6b4c168..e34d917 100644 --- a/rdl2ot/README.md +++ b/rdl2ot/README.md @@ -1,4 +1,9 @@ # rdl2ot cli tool + + A PeakRDL extension to generate OpenTitan register block SystemVerilog from SystemRDL files. ## Using as a standalone tool diff --git a/rdl2ot/pyproject.toml b/rdl2ot/pyproject.toml index 974219f..d549f45 100644 --- a/rdl2ot/pyproject.toml +++ b/rdl2ot/pyproject.toml @@ -1,3 +1,7 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + [project] name = "rdl2ot" version = "0.1.0" diff --git a/rdlexporter/README.md b/rdlexporter/README.md index 94d3d6a..b120f76 100644 --- a/rdlexporter/README.md +++ b/rdlexporter/README.md @@ -1,4 +1,9 @@ # rdlexporter + + A library to generate SystemRDL files from the Hierarchical Register Model. How to use it: diff --git a/rdlexporter/pyproject.toml b/rdlexporter/pyproject.toml index dba1f48..1915ead 100644 --- a/rdlexporter/pyproject.toml +++ b/rdlexporter/pyproject.toml @@ -1,3 +1,7 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + [project] name = "rdlexporter" version = "0.1.0" From 291525e00fce0b5f0ecb8fd43efebd8d54666d99 Mon Sep 17 00:00:00 2001 From: Douglas Reis Date: Mon, 18 Aug 2025 15:01:04 +0100 Subject: [PATCH 3/3] Add license header linting job to CI Signed-off-by: Douglas Reis --- .github/workflows/ci.yml | 8 ++ LICENSE | 202 +-------------------------------------- LICENSES/Apache-2.0.txt | 201 ++++++++++++++++++++++++++++++++++++++ REUSE.toml | 20 ++++ flake.nix | 2 +- pyproject.toml | 1 + uv.lock | 98 ++++++++++++++++++- 7 files changed, 327 insertions(+), 205 deletions(-) mode change 100644 => 120000 LICENSE create mode 100644 LICENSES/Apache-2.0.txt create mode 100644 REUSE.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7363075..a7b4fbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,7 @@ +# Copyright lowRISC contributors. +# Licensed under the Apache License, Version 2.0, see LICENSE for details. +# SPDX-License-Identifier: Apache-2.0 + name: CI on: @@ -21,6 +25,10 @@ jobs: run: | uv sync --all-extras + - name: Run reuse lint + run: | + uv run reuse lint + - name: Linting run: | uv run ruff check diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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 - - http://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. diff --git a/LICENSE b/LICENSE new file mode 120000 index 0000000..5431dc1 --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +LICENSES/Apache-2.0.txt \ No newline at end of file diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSES/Apache-2.0.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 0000000..86d93b6 --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,20 @@ +# SPDX-FileCopyrightText: lowRISC contributors. +# SPDX-License-Identifier: Apache-2.0 + +version = 1 + +[[annotations]] +path = [ + # Auto generated lock files + "*.lock", + # Files that can't take a header + ".python-version", + "CLA", + + #Test snapshots that are autognerated. + "**/snapshots/*.rdl", + "**/snapshots/*.sv", +] +precedence = "aggregate" +SPDX-FileCopyrightText = "lowRISC contributors." +SPDX-License-Identifier = "Apache-2.0" diff --git a/flake.nix b/flake.nix index 8518497..d71251b 100644 --- a/flake.nix +++ b/flake.nix @@ -60,7 +60,7 @@ env = pythonSet.mkVirtualEnv "python-env" workspace.deps.default; in { devShells.x86_64-linux.default = pkgs.mkShell { - packages = [env pkgs.uv]; + packages = [env pkgs.uv pkgs.reuse]; buildInputs = [peakrdl]; }; formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.alejandra; diff --git a/pyproject.toml b/pyproject.toml index 0f841d6..6545b82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,6 +16,7 @@ dependencies = [ linting = [ "pyright>=1.1.403", "ruff>=0.9.6", + "reuse>=5.0.2", ] dev = [ "pytest>=8.4.1", diff --git a/uv.lock b/uv.lock index fbb9d69..5e65f90 100644 --- a/uv.lock +++ b/uv.lock @@ -1,5 +1,4 @@ version = 1 -revision = 1 requires-python = ">=3.10" [manifest] @@ -18,6 +17,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/89/03/a851e84fcbb85214dc637b6378121ef9a0dd61b4c65264675d8a5c9b1ae7/antlr4_python3_runtime-4.13.2-py3-none-any.whl", hash = "sha256:fe3835eb8d33daece0e799090eda89719dbccee7aa39ef94eed3818cafa5a7e8", size = 144462 }, ] +[[package]] +name = "attrs" +version = "25.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/b0/1367933a8532ee6ff8d63537de4f1177af4bff9f3e829baf7331f595bb24/attrs-25.3.0.tar.gz", hash = "sha256:75d7cefc7fb576747b2c81b4442d4d4a1ce0900973527c011d1030fd3bf4af1b", size = 812032 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/06/bb80f5f86020c4551da315d78b3ab75e8228f89f0162f2c3a819e407941a/attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3", size = 63815 }, +] + [[package]] name = "backports-tarfile" version = "1.2.0" @@ -36,6 +44,7 @@ source = { virtual = "." } ci = [ { name = "pyright" }, { name = "pytest" }, + { name = "reuse" }, { name = "ruff" }, { name = "twine" }, { name = "uv-build" }, @@ -47,6 +56,7 @@ dev = [ ] linting = [ { name = "pyright" }, + { name = "reuse" }, { name = "ruff" }, ] @@ -55,11 +65,32 @@ requires-dist = [ { name = "benevisrdl", extras = ["linting", "dev"], marker = "extra == 'ci'" }, { name = "pyright", marker = "extra == 'linting'", specifier = ">=1.1.403" }, { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.4.1" }, + { name = "reuse", marker = "extra == 'linting'", specifier = ">=5.0.2" }, { name = "ruff", marker = "extra == 'linting'", specifier = ">=0.9.6" }, { name = "twine", marker = "extra == 'dev'", specifier = ">=6.1.0" }, { name = "uv-build", marker = "extra == 'dev'", specifier = ">=0.8.4" }, ] -provides-extras = ["linting", "dev", "ci"] + +[[package]] +name = "binaryornot" +version = "0.4.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "chardet" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a7/fe/7ebfec74d49f97fc55cd38240c7a7d08134002b1e14be8c3897c0dd5e49b/binaryornot-0.4.4.tar.gz", hash = "sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061", size = 371054 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/7e/f7b6f453e6481d1e233540262ccbfcf89adcd43606f44a028d7f5fae5eb2/binaryornot-0.4.4-py2.py3-none-any.whl", hash = "sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4", size = 9006 }, +] + +[[package]] +name = "boolean-py" +version = "5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c4/cf/85379f13b76f3a69bca86b60237978af17d6aa0bc5998978c3b8cf05abb2/boolean_py-5.0.tar.gz", hash = "sha256:60cbc4bad079753721d32649545505362c754e121570ada4658b852a3a318d95", size = 37047 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e5/ca/78d423b324b8d77900030fa59c4aa9054261ef0925631cd2501dd015b7b7/boolean_py-5.0-py3-none-any.whl", hash = "sha256:ef28a70bd43115208441b53a045d1549e2f0ec6e3d08a9d142cbc41c1938e8d9", size = 26577 }, +] [[package]] name = "certifi" @@ -111,6 +142,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f1/47/d7145bf2dc04684935d57d67dff9d6d795b2ba2796806bb109864be3a151/cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9", size = 488469 }, ] +[[package]] +name = "chardet" +version = "5.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f3/0d/f7b6ab21ec75897ed80c17d79b15951a719226b9fababf1e40ea74d69079/chardet-5.2.0.tar.gz", hash = "sha256:1b3b6ff479a8c414bc3fa2c0852995695c4a026dcd6d0633b2dd092ca39c1cf7", size = 2069618 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/38/6f/f5fbc992a329ee4e0f288c1fe0e2ad9485ed064cac731ed2fe47dcc38cbf/chardet-5.2.0-py3-none-any.whl", hash = "sha256:e1cf59446890a00105fe7b7912492ea04b6e6f06d4b742b2c788469e34c82970", size = 199385 }, +] + [[package]] name = "charset-normalizer" version = "3.4.2" @@ -177,7 +217,7 @@ name = "click" version = "8.2.1" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "colorama", marker = "platform_system == 'Windows'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/60/6c/8ca2efa64cf75a977a0d7fac081354553ebe483345c734fb6b6515d96bbc/click-8.2.1.tar.gz", hash = "sha256:27c491cc05d968d271d5a1db13e3b5a184636d9d930f148c50b038f0d0646202", size = 286342 } wheels = [ @@ -401,6 +441,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d3/32/da7f44bcb1105d3e88a0b74ebdca50c59121d2ddf71c9e34ba47df7f3a56/keyring-25.6.0-py3-none-any.whl", hash = "sha256:552a3f7af126ece7ed5c89753650eec89c7eaae8617d0aa4d9ad2b75111266bd", size = 39085 }, ] +[[package]] +name = "license-expression" +version = "30.4.4" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "boolean-py" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/40/71/d89bb0e71b1415453980fd32315f2a037aad9f7f70f695c7cec7035feb13/license_expression-30.4.4.tar.gz", hash = "sha256:73448f0aacd8d0808895bdc4b2c8e01a8d67646e4188f887375398c761f340fd", size = 186402 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/af/40/791891d4c0c4dab4c5e187c17261cedc26285fd41541577f900470a45a4d/license_expression-30.4.4-py3-none-any.whl", hash = "sha256:421788fdcadb41f049d2dc934ce666626265aeccefddd25e162a26f23bcbf8a4", size = 120615 }, +] + [[package]] name = "markdown" version = "3.8.2" @@ -714,6 +766,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/29/16/c8a903f4c4dffe7a12843191437d7cd8e32751d5de349d45d3fe69544e87/pytest-8.4.1-py3-none-any.whl", hash = "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", size = 365474 }, ] +[[package]] +name = "python-debian" +version = "1.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "charset-normalizer" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bf/4b/3c4cf635311b6203f17c2d693dc15e898969983dd3f729bee3c428aa60d4/python-debian-1.0.1.tar.gz", hash = "sha256:3ada9b83a3d671b58081782c0969cffa0102f6ce433fbbc7cf21275b8b5cc771", size = 127249 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/15/e8096189b18dda72e4923622abc10b021ecff723b397e22eff29fb86637b/python_debian-1.0.1-py3-none-any.whl", hash = "sha256:8f137c230c1d9279c2ac892b35915068b2aca090c9fd3da5671ff87af32af12c", size = 137453 }, +] + [[package]] name = "python-markdown-math" version = "0.9" @@ -804,6 +868,25 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/3f/51/d4db610ef29373b879047326cbf6fa98b6c1969d6f6dc423279de2b1be2c/requests_toolbelt-1.0.0-py2.py3-none-any.whl", hash = "sha256:cccfdd665f0a24fcf4726e690f65639d272bb0637b9b92dfd91a5568ccf6bd06", size = 54481 }, ] +[[package]] +name = "reuse" +version = "5.0.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "binaryornot" }, + { name = "boolean-py" }, + { name = "click" }, + { name = "jinja2" }, + { name = "license-expression" }, + { name = "python-debian" }, + { name = "tomlkit" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/08/43/35421efe0e69823787b331362e11cc16bb697cd6f19cbed284d421615f14/reuse-5.0.2.tar.gz", hash = "sha256:878016ae5dd29c10bad4606d6676c12a268c12aa9fcfea66403598e16eed085c", size = 358798 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0a/2f/73de654df9e7e5f67d742c1d949b5c0c7c1203e84b2272d9e34a91faaf5c/reuse-5.0.2-cp313-cp313-manylinux_2_40_x86_64.whl", hash = "sha256:7a680f00324e87a72061677a892d8cbabfddf7adcf7a5376aeeed2d78995bbbb", size = 184309 }, +] + [[package]] name = "rfc3986" version = "2.0.0" @@ -935,6 +1018,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257 }, ] +[[package]] +name = "tomlkit" +version = "0.13.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/cc/18/0bbf3884e9eaa38819ebe46a7bd25dcd56b67434402b66a58c4b8e552575/tomlkit-0.13.3.tar.gz", hash = "sha256:430cf247ee57df2b94ee3fbe588e71d362a941ebb545dec29b53961d61add2a1", size = 185207 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/75/8539d011f6be8e29f339c42e633aae3cb73bffa95dd0f9adec09b9c58e85/tomlkit-0.13.3-py3-none-any.whl", hash = "sha256:c89c649d79ee40629a9fda55f8ace8c6a1b42deb912b2a8fd8d942ddadb606b0", size = 38901 }, +] + [[package]] name = "twine" version = "6.1.0"