diff --git a/.forgejo/workflows/test.yml b/.forgejo/workflows/test.yml index 6e82abf..088ca7c 100644 --- a/.forgejo/workflows/test.yml +++ b/.forgejo/workflows/test.yml @@ -1,5 +1,3 @@ -# SPDX-License-Identifier: LGPL-3.0-or-later -# See Notices.txt for copyright information on: [push, pull_request] jobs: @@ -9,8 +7,6 @@ jobs: - uses: https://code.forgejo.org/actions/checkout@v3 with: fetch-depth: 0 - - run: | - scripts/check-copyright.sh - run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.80.1 source "$HOME/.cargo/env" diff --git a/.gitignore b/.gitignore index 0655406..ccb5166 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ -# SPDX-License-Identifier: LGPL-3.0-or-later -# See Notices.txt for copyright information /target -.vscode +.vscode \ No newline at end of file diff --git a/README.md b/README.md index 438550e..6e14e9f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,3 @@ - # Fayalite Fayalite is a library for designing digital hardware -- a hardware description language (HDL) embedded in the Rust programming language. Fayalite's semantics are based on [FIRRTL] as interpreted by [LLVM CIRCT](https://circt.llvm.org/docs/Dialects/FIRRTL/FIRRTLAnnotations/). diff --git a/crates/fayalite-proc-macros-impl/src/hdl_bundle.rs b/crates/fayalite-proc-macros-impl/src/hdl_bundle.rs index 30cf90f..7f7d626 100644 --- a/crates/fayalite-proc-macros-impl/src/hdl_bundle.rs +++ b/crates/fayalite-proc-macros-impl/src/hdl_bundle.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information use crate::{ hdl_type_common::{ common_derives, get_target, ItemOptions, MakeHdlTypeExpr, MaybeParsed, ParsedField, diff --git a/crates/fayalite-proc-macros-impl/src/hdl_enum.rs b/crates/fayalite-proc-macros-impl/src/hdl_enum.rs index 50fb138..d7e5b61 100644 --- a/crates/fayalite-proc-macros-impl/src/hdl_enum.rs +++ b/crates/fayalite-proc-macros-impl/src/hdl_enum.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information use crate::{ hdl_type_common::{ common_derives, get_target, ItemOptions, MakeHdlTypeExpr, MaybeParsed, ParsedGenerics, diff --git a/crates/fayalite-proc-macros-impl/src/hdl_type_common.rs b/crates/fayalite-proc-macros-impl/src/hdl_type_common.rs index efbe7f3..e33d0e0 100644 --- a/crates/fayalite-proc-macros-impl/src/hdl_type_common.rs +++ b/crates/fayalite-proc-macros-impl/src/hdl_type_common.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information use crate::{fold::impl_fold, kw, Errors, HdlAttr, PairsIterExt}; use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote_spanned, ToTokens}; diff --git a/crates/fayalite/examples/blinky.rs b/crates/fayalite/examples/blinky.rs index 94c7910..588ca9a 100644 --- a/crates/fayalite/examples/blinky.rs +++ b/crates/fayalite/examples/blinky.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information use clap::Parser; use fayalite::{cli, prelude::*}; diff --git a/crates/fayalite/src/_docs.rs b/crates/fayalite/src/_docs.rs index 5b1888b..4d254a7 100644 --- a/crates/fayalite/src/_docs.rs +++ b/crates/fayalite/src/_docs.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information #![doc = include_str!("../README.md")] //! diff --git a/crates/fayalite/src/_docs/modules.rs b/crates/fayalite/src/_docs/modules.rs index 99b98e8..c392f2e 100644 --- a/crates/fayalite/src/_docs/modules.rs +++ b/crates/fayalite/src/_docs/modules.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # Fayalite Modules //! //! The [`#[hdl_module]`][`crate::hdl_module`] attribute is applied to a Rust diff --git a/crates/fayalite/src/_docs/modules/extern_module.rs b/crates/fayalite/src/_docs/modules/extern_module.rs index c1367d9..bf2034b 100644 --- a/crates/fayalite/src/_docs/modules/extern_module.rs +++ b/crates/fayalite/src/_docs/modules/extern_module.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! These are for when you want to use modules written in //! some other language, such as Verilog. //! diff --git a/crates/fayalite/src/_docs/modules/module_bodies.rs b/crates/fayalite/src/_docs/modules/module_bodies.rs index c12ae21..bd85c61 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # Module Function Bodies //! //! The `#[hdl_module]` attribute lets you have statements/expressions with `#[hdl]` annotations diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_array_expressions.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_array_expressions.rs index c0b15ad..c4bbfa4 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_array_expressions.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_array_expressions.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # `#[hdl]` Array Expressions //! //! `#[hdl]` can be used on Array Expressions to construct an [`Array<[T; N]>`][type@Array] expression: diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_if_statements.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_if_statements.rs index 7d09943..46bb568 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_if_statements.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_if_statements.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # `#[hdl] if` Statements //! //! `#[hdl] if` statements behave similarly to Rust `if` statements, except they end up as muxes diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements.rs index 61d29b5..c4e3e70 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! ## `#[hdl] let` statements pub mod inputs_outputs; diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/inputs_outputs.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/inputs_outputs.rs index 14169d9..bfd7521 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/inputs_outputs.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/inputs_outputs.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! ### Inputs/Outputs //! //! Inputs/Outputs create a Rust variable with type [`Expr`] where `T` is the type of the input/output. diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/instances.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/instances.rs index 75def03..2776754 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/instances.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/instances.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! ### Module Instances //! //! module instances are kinda like the hardware equivalent of calling a function, diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/memories.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/memories.rs index ddd60b9..e491eef 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/memories.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/memories.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # Memories //! //! Memories are optimized for storing large amounts of data. diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/registers.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/registers.rs index 5a81c5b..28db27f 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/registers.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/registers.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! ### Registers //! //! Registers are memory devices that will change their state only on a clock diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/wires.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/wires.rs index 7d92b41..b22e0fd 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/wires.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_let_statements/wires.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! ### Wires //! //! Wires are kinda like variables, but unlike registers, diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_literals.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_literals.rs index 91710e7..a6c9b58 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_literals.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_literals.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # `_hdl`-suffixed literals //! //! You can have integer literals with an arbitrary number of bits like so: diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_match_statements.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_match_statements.rs index 9e6c511..c0d4ea6 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_match_statements.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_match_statements.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # `#[hdl] match` Statements //! //! `#[hdl] match` statements behave similarly to Rust `match` statements, except they end up as muxes diff --git a/crates/fayalite/src/_docs/modules/module_bodies/hdl_struct_variant_expressions.rs b/crates/fayalite/src/_docs/modules/module_bodies/hdl_struct_variant_expressions.rs index 68cd685..9d63895 100644 --- a/crates/fayalite/src/_docs/modules/module_bodies/hdl_struct_variant_expressions.rs +++ b/crates/fayalite/src/_docs/modules/module_bodies/hdl_struct_variant_expressions.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # `#[hdl]` Struct/Variant Expressions //! //! Note: Structs are also known as [Bundles] when used in Fayalite, the Bundle name comes from [FIRRTL]. diff --git a/crates/fayalite/src/_docs/modules/normal_module.rs b/crates/fayalite/src/_docs/modules/normal_module.rs index 1267551..f84678e 100644 --- a/crates/fayalite/src/_docs/modules/normal_module.rs +++ b/crates/fayalite/src/_docs/modules/normal_module.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # Normal Modules //! //! See also: [Extern Modules][`super::extern_module`] diff --git a/crates/fayalite/src/_docs/semantics.rs b/crates/fayalite/src/_docs/semantics.rs index 2282f25..a499e8e 100644 --- a/crates/fayalite/src/_docs/semantics.rs +++ b/crates/fayalite/src/_docs/semantics.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # Fayalite Semantics //! //! Fayalite's semantics are based on [FIRRTL]. Due to their significance, some of the semantics are also documented here. diff --git a/crates/fayalite/src/_docs/semantics/connection_semantics.rs b/crates/fayalite/src/_docs/semantics/connection_semantics.rs index ba2a679..41155bf 100644 --- a/crates/fayalite/src/_docs/semantics/connection_semantics.rs +++ b/crates/fayalite/src/_docs/semantics/connection_semantics.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information //! # Connection Semantics //! //! Fayalite's connection semantics are unlike assignments in software, so be careful! diff --git a/crates/fayalite/src/cli.rs b/crates/fayalite/src/cli.rs index 5071279..f848d36 100644 --- a/crates/fayalite/src/cli.rs +++ b/crates/fayalite/src/cli.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information use crate::{ bundle::{Bundle, BundleType}, firrtl, diff --git a/crates/fayalite/src/expr/target.rs b/crates/fayalite/src/expr/target.rs index 0f85f62..f33b286 100644 --- a/crates/fayalite/src/expr/target.rs +++ b/crates/fayalite/src/expr/target.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information use crate::{ array::Array, bundle::{Bundle, BundleField}, diff --git a/crates/fayalite/src/prelude.rs b/crates/fayalite/src/prelude.rs index 6a74e67..bedece2 100644 --- a/crates/fayalite/src/prelude.rs +++ b/crates/fayalite/src/prelude.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information pub use crate::{ annotations::Annotation, array::{Array, ArrayType}, diff --git a/crates/fayalite/src/util/ready_valid.rs b/crates/fayalite/src/util/ready_valid.rs index ec761c2..a5893cf 100644 --- a/crates/fayalite/src/util/ready_valid.rs +++ b/crates/fayalite/src/util/ready_valid.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information use crate::prelude::*; #[hdl] diff --git a/crates/fayalite/src/util/scoped_ref.rs b/crates/fayalite/src/util/scoped_ref.rs index 7705377..f168853 100644 --- a/crates/fayalite/src/util/scoped_ref.rs +++ b/crates/fayalite/src/util/scoped_ref.rs @@ -1,5 +1,3 @@ -// SPDX-License-Identifier: LGPL-3.0-or-later -// See Notices.txt for copyright information mod safety_boundary { use std::{cell::Cell, ptr::NonNull}; diff --git a/crates/fayalite/visit_types.json b/crates/fayalite/visit_types.json index ad9ed25..1748e47 100644 --- a/crates/fayalite/visit_types.json +++ b/crates/fayalite/visit_types.json @@ -1,8 +1,4 @@ { - "license_header": [ - "SPDX-License-Identifier: LGPL-3.0-or-later", - "See Notices.txt for copyright information" - ], "types": { "Module": { "data": { diff --git a/scripts/check-copyright.sh b/scripts/check-copyright.sh deleted file mode 100755 index 8104f9c..0000000 --- a/scripts/check-copyright.sh +++ /dev/null @@ -1,74 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: LGPL-3.0-or-later -# See Notices.txt for copyright information -set -e - -function fail() -{ - local error="$1" - echo "error: $error" >&2 - exit 1 -} - -function fail_file() -{ - local file="$1" line="$2" error="$3" - fail "$file:$((line + 1)): $error" -} - -function check_file() -{ - local file="$1" regexes=("${@:2}") - local lines - mapfile -t lines < "$file" - local line - for line in "${!regexes[@]}"; do - eval '[[ "${lines[i]}" =~ '"${regexes[i]}"' ]]' || - fail_file "$file" "$line" "doesn't match regex: ${regexes[i]}" - done -} - -POUND_HEADER=('^"# SPDX-License-Identifier: LGPL-3.0-or-later"$' '^"# See Notices.txt for copyright information"$') -SLASH_HEADER=('^"// SPDX-License-Identifier: LGPL-3.0-or-later"$' '^"// See Notices.txt for copyright information"$') -MD_HEADER=('^"