-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from RapidSilicon/compile
Setup Repository: CI and Build Scripts
- Loading branch information
Showing
11 changed files
with
349 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
> **Describe the bug** | ||
> A clear and concise description of what the bug is. | ||
<!-- Uncomment relevant options --> | ||
<!-- Which part of the project is buggy --> | ||
<!-- - [ ] Documentation --> | ||
<!-- - [ ] Submodule --> | ||
<!-- - [ ] etc --> | ||
> **To Reproduce** | ||
> Steps to reproduce the behavior: | ||
> 1. Clone repository and checkout commit id: <The problem commit id> | ||
> 2. Execute a test case or your own example: <more details> | ||
> 3. See error | ||
> **Expected behavior** | ||
> A clear and concise description of what you expected to happen. | ||
> **Screenshots** | ||
> If applicable, add screenshots to help explain your problem. | ||
> **Enviornment (please complete the following information):** | ||
<!-- Uncomment relevant options --> | ||
> - OS: | ||
<!-- - [ ] CentOS 7 --> | ||
<!-- - [ ] Ubuntu 18.04 --> | ||
<!-- - [ ] Others. If so, please specify: --> | ||
> - Tool: | ||
<!-- - [ ] Synopsys IC Compiler: <version> --> | ||
<!-- - [ ] Others. If so, please specify: --> | ||
> - Version: | ||
<!-- - [ ] Current master --> | ||
<!-- - [ ] Others. If so, please specify Github commit id: --> | ||
> **Additional context** | ||
> Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "gitsubmodule" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
time: "00:00" | ||
timezone: "America/Denver" | ||
#assignees: | ||
# - "username" | ||
#labels: need to add the required label to the repo first! | ||
# - "submodule-updates" | ||
# must use the full team name, including the organization, as if you were @mentioning the team | ||
reviewers: | ||
- "taoli4rs" | ||
- "tangxifan" | ||
# Allow dependabot to open up to 10 open pull requests. Default is 5. | ||
# open-pull-requests-limit: 10 | ||
allow: | ||
- dependency-name: "OpenFPGA" | ||
- dependency-name: "OpenSTA" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# See https://github.com/actions/labeler#common-examples for defining patterns. | ||
# The globs use "minimatch" syntax found at https://github.com/isaacs/minimatch | ||
# | ||
# WARNING: Due to this file being yaml, any string starting with `*` must be | ||
# wrapped in quotes. | ||
|
||
# Third-party tools | ||
# TODO | ||
|
||
# General areas | ||
documentation: | ||
- docs/* | ||
- docs/**/* | ||
- "*README*" | ||
- "*.md" | ||
- "*.rst" | ||
- ".readthedocs.yml" | ||
github: | ||
- .github/* | ||
- .github/**/* | ||
docker: | ||
- Dockerfile | ||
- "*docker*" | ||
build: | ||
- Makefile | ||
- "*.make" | ||
- CMakeLists.txt | ||
- cmake | ||
IPs: | ||
- ips/** | ||
Architecture: | ||
- arch/** | ||
yosys: | ||
- yosys/** | ||
verification: | ||
- dv/** | ||
PDK: | ||
- pdk/** | ||
Netlist: | ||
- rtl/** | ||
|
||
# Tag pull requests with the languages used to make it easy to see what is | ||
# being used. | ||
lang-hdl: | ||
- "*.v" | ||
- "*.sv" | ||
lang-cpp: | ||
- "*.c*" | ||
- "*.h" | ||
lang-perl: | ||
- "*.pl" | ||
- "*perl*" | ||
lang-python: | ||
- "*.py" | ||
lang-shell: | ||
- "*.sh" | ||
lang-netlist: | ||
- "*.blif" | ||
- "*.eblif" | ||
- "*.edif" | ||
- "*.vqm" | ||
lang-make: | ||
- "*.make" | ||
- Makefile | ||
- CMakeLists.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
> ### Motivate of the pull request | ||
> - [ ] To address an existing issue. If so, please provide a link to the issue: <issue id> | ||
> - [ ] Breaking new feature. If so, please describe details in the description part. | ||
> ### Describe the technical details | ||
> #### What is currently done? (Provide issue link if applicable) | ||
> <!-- Please provide a list of limitations if not specified in any issue --> | ||
> <!-- Below is a template, uncomment upon your needs --> | ||
> <!-- Currently, the project has the following limitations: --> | ||
> <!-- - [ ] technical details about limitation --> | ||
> <!-- - [ ] more limitations --> | ||
> | ||
> #### What does this pull request change? | ||
> <!-- Please provide a list of highlights of your changes. --> | ||
> <!-- Below is a template, uncomment upon your needs --> | ||
> <!-- This PR improves in the following aspects: --> | ||
> <!-- - [ ] details about the technical highlight --> | ||
> <!-- - [ ] <more technical highlights --> | ||
> ### Which part of the code base require a change | ||
> <!-- In general, modification on existing submodules are not acceptable. You should push changes to upstream. --> | ||
> - [ ] Build compatibility | ||
> - [ ] Documentation | ||
> - [ ] Regression tests | ||
> - [ ] Continous Integration (CI) scripts | ||
> ### Impact of the pull request | ||
> - [ ] Require a change on Quality of Results (QoR) | ||
> - [ ] Break back-compatibility. If so, please list who may be influenced. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Build Compatibility | ||
|
||
# Only run for pull requests as we care contribution to the master | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
compilation: | ||
runs-on: ubuntu-latest | ||
# Branch on different OS and settings | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- name: "Build Compatibility: GCC-8 (Ubuntu 18.04)" | ||
cc: gcc-8 | ||
cxx: g++-8 | ||
- name: "Build Compatibility: GCC-9 (Ubuntu 18.04)" | ||
cc: gcc-9 | ||
cxx: g++-9 | ||
# Define the steps to run the build job | ||
env: | ||
CC: ${{ matrix.config.cc }} | ||
CXX: ${{ matrix.config.cxx }} | ||
steps: | ||
- name: Cancel previous | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Runner workspace path | ||
run: | | ||
echo "Cleaning up previous run" | ||
rm -rf "${{ github.workspace }}" | ||
mkdir -p "${{ github.workspace }}" | ||
- name: Checkout repo | ||
uses: actions/checkout@v2.4.0 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo .github/workflows/install_dependencies_build.sh | ||
- name: Checkout submodule | ||
run: | | ||
make checkout | ||
- name: Build | ||
run: | | ||
make compile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apt-get update && apt-get install -y \ | ||
autoconf \ | ||
automake \ | ||
bison \ | ||
ccache \ | ||
cmake \ | ||
ctags \ | ||
curl \ | ||
doxygen \ | ||
flex \ | ||
fontconfig \ | ||
gdb \ | ||
git \ | ||
gperf \ | ||
iverilog \ | ||
libc6-dev \ | ||
libcairo2-dev \ | ||
libevent-dev \ | ||
libffi-dev \ | ||
libfontconfig1-dev \ | ||
liblist-moreutils-perl \ | ||
libncurses5-dev \ | ||
libreadline-dev \ | ||
libx11-dev \ | ||
libxft-dev \ | ||
libxml++2.6-dev \ | ||
make \ | ||
perl \ | ||
pkg-config \ | ||
python3 \ | ||
python3-setuptools \ | ||
python3-lxml \ | ||
python3-pip \ | ||
qt5-default \ | ||
tcllib \ | ||
tcl8.6-dev \ | ||
texinfo \ | ||
time \ | ||
valgrind \ | ||
wget \ | ||
zip \ | ||
g++-8 \ | ||
g++-9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: "Pull Request Labeler" | ||
on: | ||
- pull_request_target | ||
|
||
jobs: | ||
triage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/labeler@main | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[submodule "OpenFPGA"] | ||
path = OpenFPGA | ||
url = git@github.com:lnis-uofu/OpenFPGA.git | ||
url = https://github.com/lnis-uofu/OpenFPGA.git | ||
[submodule "OpenSTA"] | ||
path = OpenSTA | ||
url = git@github.com:The-OpenROAD-Project/OpenSTA.git | ||
url = https://github.com/The-OpenROAD-Project/OpenSTA.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cmake_minimum_required(VERSION 2.8.12) | ||
|
||
# | ||
# Sub-projects | ||
# | ||
add_subdirectory(OpenFPGA) | ||
add_subdirectory(OpenSTA) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# | ||
# Top Makefile | ||
# ============ | ||
# | ||
# This is the top-level makefile of the project | ||
# | ||
SUBMODULE = | ||
PYTHON_EXEC ?= python3 | ||
|
||
ifeq ($(origin CMAKE_COMMAND),undefined) | ||
CMAKE_COMMAND := cmake | ||
else | ||
CMAKE_COMMAND := ${CMAKE_COMMAND} | ||
endif | ||
|
||
.SILENT: | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
export COMMENT_EXTRACT | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@${PYTHON_EXEC} -c "$$COMMENT_EXTRACT" | ||
|
||
.PHONY: all checkout compile | ||
|
||
checkout: | ||
# This command will checkout all the submodules when no other options are provided | ||
# Available variables | ||
# | ||
# - SUBMODULE: Specify the submodule to checkout. For example, SUBMODULE=OpenFPGA | ||
git submodule init ${SUBMODULE} | ||
git submodule update --init --recursive ${SUBMODULE} | ||
|
||
compile: | ||
# This command will compile the codebase | ||
mkdir -p build && cd build && $(CMAKE_COMMAND) ${CMAKE_FLAGS} .. | ||
cd build && $(MAKE) | ||
|
||
all: checkout compile | ||
# This is a shortcut command to checkout all the submodules and compile the codebase | ||
|
||
# Functions to extract comments from Makefiles | ||
define COMMENT_EXTRACT | ||
import re | ||
with open ('Makefile', 'r' ) as f: | ||
matches = re.finditer('^([a-zA-Z-_]*):.*\n#(.*)', f.read(), flags=re.M) | ||
for _, match in enumerate(matches, start=1): | ||
header, content = match[1], match[2] | ||
print(f" {header:10} {content}") | ||
endef |