Skip to content

Commit

Permalink
Merge branch 'standardsemiconductor:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
harryprayiv authored Oct 3, 2023
2 parents 1f057e4 + f6aae55 commit df6afac
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 36 deletions.
113 changes: 86 additions & 27 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://github.com/haskell/actions/tree/main/setup#model-cabal-workflow-with-caching
name: Haskell CI

on:
push:
branches: [ main ]
Expand All @@ -9,52 +9,111 @@ on:
# run at the start of every day
- cron: '0 0 * * *'

permissions:
contents: read

jobs:
build:
runs-on: ${{ matrix.os }}
name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
ghc: ['8.8', '8.10.4', '9.0']
cabal: ['3.2', '3.4']
ghc-version: ['9.0']
os: [ubuntu-20.04]
exclude:
# GHC 9.0 only Cabal 3.4
- ghc: '9.0'
cabal: '3.2'
name: ${{ matrix.os }} GHC ${{ matrix.ghc }} Cabal ${{ matrix.cabal }}

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true

- name: Free up environment resources
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Setup Haskell
uses: haskell/actions/setup@v1
- name: Set up GHC ${{ matrix.ghc-version }}
uses: haskell/actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
ghc-version: ${{ matrix.ghc-version }}

- name: Configure lion
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Configure lion-formal
working-directory: lion-formal
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Install dependencies
- name: Configure lion-soc
working-directory: lion-soc
run: |
cabal update
cabal build --only-dependencies
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Configure lion-metric
working-directory: lion-metric
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Restore cached dependencies
uses: actions/cache/restore@v3
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-

- name: Install lion dependencies
run: cabal build all --only-dependencies

- name: Install lion-formal dependencies
working-directory: lion-formal
run: cabal build all --only-dependencies

- name: Install lion-soc dependencies
working-directory: lion-soc
run: cabal build all --only-dependencies

- name: Install lion-metric dependencies
working-directory: lion-metric
run: cabal build all --only-dependencies

- name: Save cached dependencies
uses: actions/cache/save@v3
if: ${{ steps.cache.outputs.cache-primary-key != steps.cache.outputs.cache-matched-key }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Build
run: cabal build
run: cabal build all

# - name: Run tests
# run: cabal test all

- name: Check cabal file
run: cabal check

- name: Build documentation
run: cabal haddock all

- name: Install icestorm prerequisites
run: |
sudo apt-get update
sudo apt-get install build-essential clang bison flex libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot pkg-config python python3 libftdi-dev qt5-default python3-dev libboost-all-dev cmake libeigen3-dev
- name: Checkout icestorm
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: YosysHQ/icestorm
path: icestorm
Expand All @@ -66,7 +125,7 @@ jobs:
sudo make install
- name: Checkout nextpnr
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: YosysHQ/nextpnr
ref: master
Expand All @@ -81,7 +140,7 @@ jobs:
sudo make install
- name: Checkout yosys
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: YosysHQ/yosys
ref: master
Expand All @@ -94,7 +153,7 @@ jobs:
sudo make install
- name: Checkout SymbiYosys
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: YosysHQ/SymbiYosys
ref: master
Expand All @@ -107,7 +166,7 @@ jobs:
sudo make install
- name: Checkout Boolector
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: boolector/boolector
ref: master
Expand All @@ -124,7 +183,7 @@ jobs:
sudo cp deps/btor2tools/bin/btorsim /usr/local/bin
- name: Checkout riscv-gnu-toolchain
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: riscv/riscv-gnu-toolchain
ref: master
Expand All @@ -135,7 +194,7 @@ jobs:
run: |
sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev texinfo libtool patchutils bc zlib1g-dev libexpat-dev
./configure --prefix=$HOME/opt/riscv
sudo make
sudo make -j$(nproc)
echo "$HOME/opt/riscv/bin" >> $GITHUB_PATH
- name: Formal Verification
Expand Down
4 changes: 2 additions & 2 deletions lion-formal/lion-formal.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bug-reports: https://github.com/standardsemiconductor/lion/issues
license: BSD-3-Clause
author: dopamane
maintainer: dopamane <[email protected]>
copyright: (c) 2021-2022 David Cox
copyright: (c) 2021-2023 David Cox
category: Hardware
extra-source-files: CHANGELOG.md

Expand Down Expand Up @@ -39,7 +39,7 @@ library

executable formal
main-is: Main.hs
build-depends: base >= 4.13 && < 4.16
build-depends: base
, clash-ghc
, directory
, shake
Expand Down
2 changes: 1 addition & 1 deletion lion-metric/lion-metric.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bug-reports: https://github.com/standardsemiconductor/lion/issues
license: BSD-3-Clause
author: dopamane
maintainer: dopamane <[email protected]>
copyright: (c) 2021-2022 David Cox
copyright: (c) 2021-2023 David Cox
category: Hardware

library
Expand Down
9 changes: 5 additions & 4 deletions lion-soc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
```

## Usage
1. Ensure the VELDT is ON and in the FLASH mode.
2. `cabal run soc -- prog`
3. Cycle power switch, set mode switch to FPGA.
4. `cabal run com` to open serial port, then press any key to display the Lion SoC name. The Lion Soc will echo any further input. Press <kbd>Ctrl-c</kbd> to end the program. The default port for `com` is `/dev/ttyUSB0`. If you require a different port, specify it as an argument: `cabal run com -- path/to/port`. Other serial port programs will work as well; be sure to specify 8 data bits, 1 stop bit, no flow control, and a baud rate of 19200.
1. `cabal build`
2. Ensure the VELDT is ON and in the FLASH mode.
3. `cabal run soc -- prog`
4. Cycle power switch, set mode switch to FPGA.
5. `cabal run com` to open serial port, then press any key to display the Lion SoC name. The Lion Soc will echo any further input. Press <kbd>Ctrl-c</kbd> to end the program. The default port for `com` is `/dev/ttyUSB0`. If you require a different port, specify it as an argument: `cabal run com -- path/to/port`. Other serial port programs will work as well; be sure to specify 8 data bits, 1 stop bit, no flow control, and a baud rate of 19200.
```
__ _ ____ _____
/ / (_)__ ___ / __/__ / ___/
Expand Down
2 changes: 1 addition & 1 deletion lion-soc/lion-soc.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ bug-reports: https://github.com/standardsemiconductor/lion/issues
license: BSD-3-Clause
author: dopamane
maintainer: dopamane <[email protected]>
copyright: (c) 2021-2022 David Cox
copyright: (c) 2021-2023 David Cox
category: Hardware
extra-source-files: CHANGELOG.md

Expand Down
2 changes: 1 addition & 1 deletion lion.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: BSD-3-Clause
license-file: LICENSE
author: dopamane <[email protected]>
maintainer: dopamane <[email protected]>
copyright: (c) 2021-2022 David Cox
copyright: (c) 2021-2023 David Cox
category: Hardware
extra-source-files:
CHANGELOG.md
Expand Down

0 comments on commit df6afac

Please sign in to comment.