Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add license header to top of all code files #762

Merged
merged 18 commits into from
Dec 23, 2020
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions .github/workflows/check_license.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash

# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

set -e

echo
echo "==========================="
echo "Check SPDX identifier"
echo "==========================="
echo

ERROR_FILES=""
FILES_TO_CHECK=`find . \
-type f \( -name '*.sh' -o -name '*.py' -o -name 'Makefile' -o -name '*.v' \) \
\( -not -path "*/.*/*" \) \
\( -not -path "*/build/*" \) \
\( -not -path "*/env/*" \) \
\( -not -path "*/src/*" \) \
\( -not -path "*/third_party/*" \) \
\( -not -path "*/*/__init__.py" \) \
\( -not -path "./miniconda.sh" \) | sort`

for file in $FILES_TO_CHECK; do
echo "Checking $file"
grep -q "SPDX-License-Identifier" $file || ERROR_FILES="$ERROR_FILES $file"
done

if [ ! -z "$ERROR_FILES" ]; then
for file in $ERROR_FILES; do
echo "ERROR: $file does not have license information."
done
exit 1
fi

THIRD_PARTY_DIRS=$(shopt -s nullglob; echo third_party/{cores,tools,tests}/*)
ERROR_NO_LICENSE=""

if [ -z "$THIRD_PARTY_DIRS" ]; then
exit 0
fi

echo
echo "==========================="
echo "Check third party LICENSE"
echo "==========================="
echo

function check_if_submodule {
for submodule in `git submodule --quiet foreach 'echo $sm_path'`; do
if [ "$1" == "$submodule" ]; then
return 1
fi
done
}

for dir in $THIRD_PARTY_DIRS; do
# Checks if we are not in a submodule
if check_if_submodule $dir; then
echo "Checking $dir"
[ -f $dir/LICENSE ] || ERROR_NO_LICENSE="$ERROR_NO_LICENSE $dir"
fi
done

if [ ! -z "$ERROR_NO_LICENSE" ]; then
for dir in $ERROR_NO_LICENSE; do
echo "ERROR: $dir does not have the LICENSE file."
done
exit 1
fi
8 changes: 7 additions & 1 deletion .github/workflows/sv-tests-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ on:

jobs:
Test:
name: "Python PEP8 checks"
name: "Code Quality Checks"
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: 3.7
Expand All @@ -25,6 +27,10 @@ jobs:
- name: Test
run:
test $(git status --porcelain | wc -l) -eq 0 || { git diff; false; }
- name: License
run:
./.github/workflows/check_license.sh

Run:
strategy:
fail-fast: false
Expand Down
15 changes: 15 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# This is the list of sv-tests's significant contributors.
mithro marked this conversation as resolved.
Show resolved Hide resolved
#
# This does not necessarily list everyone who has contributed code,
# especially since many employees of one corporation may be contributing.
# To see the full list of contributors, see the revision history in
# source control.
Antmicro
Google LLC

Ahmad Hegazy
Fabian Schuiki
Mike Popoloski
Naoya Hatta
Wilson Snyder
Zachary Snow
2 changes: 1 addition & 1 deletion COPYING → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2019 The Symbiflow Authors
Copyright (C) 2020 The Symbiflow Authors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
tgorochowik marked this conversation as resolved.
Show resolved Hide resolved
#
# SPDX-License-Identifier: ISC

all: report

OUT_DIR ?= ./out/
Expand Down
9 changes: 9 additions & 0 deletions generators/ariane
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
tgorochowik marked this conversation as resolved.
Show resolved Hide resolved
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
tgorochowik marked this conversation as resolved.
Show resolved Hide resolved
#
# SPDX-License-Identifier: ISC

import sys
import os
Expand Down
9 changes: 9 additions & 0 deletions generators/black-parrot
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import re
Expand Down
9 changes: 9 additions & 0 deletions generators/easyUVM
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions generators/fx68k
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions generators/ivtest
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import re
import os
Expand Down
9 changes: 9 additions & 0 deletions generators/path_generator
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions generators/rsd
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions generators/scr1
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions generators/swerv
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions generators/taiga
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions generators/template_generator
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions generators/yosys_hana
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
14 changes: 14 additions & 0 deletions third_party/tests/utd-sv/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Copyright 2019 University of Texas at Dallas
Copyright 2019 William P. Swartz Jr.

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.
11 changes: 11 additions & 0 deletions tools/BaseRunner.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#!/bin/false python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import psutil
import resource
import shutil
Expand Down
9 changes: 9 additions & 0 deletions tools/check-runners
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import sys
Expand Down
9 changes: 9 additions & 0 deletions tools/feature-analyzer
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import re
import os
Expand Down
11 changes: 11 additions & 0 deletions tools/logparser.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import re


Expand Down
9 changes: 9 additions & 0 deletions tools/runner
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC

import os
import re
Expand Down
Loading