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

Drop support for GHC versions older than 9.6 #26

Merged
merged 4 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .ci/build_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ if grep -q "${ambiguous_warn}" haddock_log; then
fi

# Copy documention to hadocs/
ln -s "$(dirname "$(tail -n1 haddock_log)")" hadocs/
ln -s "$(readlink -f "$(tail -n1 haddock_log)")" hadocs/clash-cores
12 changes: 0 additions & 12 deletions .ci/cabal.project.local
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ package *
-- Dynamic executables save oozles of space when archiving it on CI
executable-dynamic: True

package clash-prelude
flags: -workaround-ghc-mmap-crash

package clash-lib
flags: -workaround-ghc-mmap-crash

package clash-ghc
flags: -workaround-ghc-mmap-crash

package clash-cores
ghc-options: -Werror
tests: True
Expand All @@ -25,6 +16,3 @@ package clash-cores
-- Cabal-the-library in combination with custom setup where the library path
-- is not added to the RPATH
executable-dynamic: False

package clash-testsuite
flags: -workaround-ghc-mmap-crash
22 changes: 10 additions & 12 deletions .ci/gitlab/branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@ tests-always:
strategy: depend
variables:
CLASH_BRANCH: "$CLASH_BRANCH"
CLASH_DOCKER_TAG: "$CLASH_DOCKER_TAG"
parallel:
matrix:
- GHC_VERSION: 9.8.2

- GHC_VERSION: 9.0.2
WORKAROUND_GHC_MMAP_CRASH: "yes"

- GHC_VERSION: 8.10.7
WORKAROUND_GHC_MMAP_CRASH: "yes"
- GHC_VERSION: ["9.6.6", "9.10.1"]

tests-release:
stage: test
Expand All @@ -34,10 +29,13 @@ tests-release:
strategy: depend
variables:
CLASH_BRANCH: "$CLASH_BRANCH"
CLASH_DOCKER_TAG: "$CLASH_DOCKER_TAG"
parallel:
matrix:
- GHC_VERSION: [9.6.6, 9.4.8, 9.2.8]
- GHC_VERSION: ["9.8.4"]

# Test GHC versions on master that our release version does
# not support. In case there is no such GHC, set "matrix" to [] .
tests-master:
stage: test
rules:
Expand All @@ -48,19 +46,19 @@ tests-master:
strategy: depend
variables:
CLASH_BRANCH: "$CLASH_BRANCH"
CLASH_DOCKER_TAG: "$CLASH_DOCKER_TAG"
parallel:
matrix:
- GHC_VERSION: 9.10.1
matrix: []

stack-build:
extends: .common-local
image: fpco/stack-build:lts-22.33
image: fpco/stack-build:lts-23.6
needs: []
stage: test
rules:
- if: $CLASH_BRANCH == "release"
variables:
CACHE_FALLBACK_KEY: $CI_JOB_NAME-master-$CI_JOB_IMAGE-1-3-non_protected
CACHE_FALLBACK_KEY: $CI_JOB_NAME-clash-$CLASH_BRANCH-main-$CI_JOB_IMAGE-$CACHE_BUST_TOKEN-non_protected
before_script:
- apt-get update
- apt-get install -y zstd
Expand Down
1 change: 0 additions & 1 deletion .ci/gitlab/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ default:
timeout: 10 minutes
stage: build
variables:
CLASH_DOCKER_TAG: 20240905
CACHE_BUST_TOKEN: 1
# Note that we copy+paste the image name into CACHE_FALLBACK_KEY. If we don't,
# $GHC_VERSION gets inserted at verbatim, instead of resolving to some ghc version.
Expand Down
11 changes: 0 additions & 11 deletions .ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@ cabal v2-update | tee cabal_update_output
if [ ! -f cabal.project.local ]; then
cp .ci/cabal.project.local .

set +u
if [[ "$WORKAROUND_GHC_MMAP_CRASH" == "yes" ]]; then
sed -i 's/-workaround-ghc-mmap-crash/+workaround-ghc-mmap-crash/g' cabal.project.local
fi
set -u

# Fix index-state to prevent rebuilds if Hackage changes between build -> test.
# Note we can't simply set it to a timestamp of "now", as Cabal will error out
# when its index state is older than what's mentioned in cabal.project(.local).
Expand All @@ -45,11 +39,6 @@ cat cabal.project.local
rm -f $HOME/.cabal/config
cabal user-config init
sed -i "s/-- ghc-options:/ghc-options: -j$THREADS/g" $HOME/.cabal/config
set +u
if [[ "$WORKAROUND_GHC_MMAP_CRASH" == "yes" ]]; then
sed -i "s/ghc-options:/ghc-options: +RTS -xm20000000 -RTS -with-rtsopts=-xm20000000/g" $HOME/.cabal/config
fi
set -u
sed -i "s/^[- ]*jobs:.*/jobs: $CABAL_JOBS/g" $HOME/.cabal/config
sed -i "/remote-repo-cache:.*/d" $HOME/.cabal/config
cat $HOME/.cabal/config
5 changes: 4 additions & 1 deletion .gitlab-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@ branches:
strategy: depend
parallel:
matrix:
- CLASH_BRANCH: [release, master]
- CLASH_BRANCH: release
CLASH_DOCKER_TAG: 20250102
- CLASH_BRANCH: master
CLASH_DOCKER_TAG: 20250101
8 changes: 4 additions & 4 deletions cabal.project-1.8
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: v1.8.1
tag: v1.8.2
subdir: tests

constraints:
clash-prelude == 1.8.1,
clash-lib == 1.8.1,
clash-ghc == 1.8.1
clash-prelude == 1.8.2,
clash-lib == 1.8.2,
clash-ghc == 1.8.2
2 changes: 1 addition & 1 deletion cabal.project-common
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
index-state: 2024-12-04T12:55:18Z
index-state: 2025-01-29T13:43:13Z

packages:
clash-cores.cabal
Expand Down
25 changes: 8 additions & 17 deletions clash-cores.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ common basic-config
TypeFamilies
TypeOperators

-- See https://github.com/clash-lang/clash-compiler/pull/2511
if impl(ghc >= 9.4)
CPP-Options: -DCLASH_OPAQUE=OPAQUE
else
CPP-Options: -DCLASH_OPAQUE=NOINLINE

ghc-options:
-Wall -Wcompat

Expand Down Expand Up @@ -111,8 +105,8 @@ common basic-config
-fplugin GHC.TypeLits.KnownNat.Solver

build-depends:
base >= 4.10 && < 5,
constraints,
base >= 4.18 && < 5,
constraints >= 0.9 && < 1.0,
containers >=0.5 && <0.8,
ghc-typelits-extra >= 0.3.2,
ghc-typelits-knownnat >= 0.6,
Expand All @@ -121,7 +115,7 @@ common basic-config
lens,
QuickCheck,
string-interpolate ^>= 0.3,
template-haskell,
template-haskell >= 2.12.0.0 && < 2.23,

if flag(clash-18)
build-depends:
Expand Down Expand Up @@ -199,17 +193,14 @@ library
-fno-worker-wrapper

build-depends:
unordered-containers,
ghc-prim >= 0.3.1.0 && < 1.0,
lens,
mtl >= 2.1.1 && < 2.4,
pretty-show,
prettyprinter >= 1.2.0.1 && < 1.8,
prettyprinter >= 1.7 && < 1.8,
prettyprinter-interp ^>= 0.2,
reducers >= 3.12.2 && < 4.0,
text >= 1.2.2 && < 2.2,
constraints >= 0.9 && < 1.0,
template-haskell >= 2.12.0.0 && < 2.23,
unordered-containers,

test-suite unit-tests
import: basic-config
Expand Down Expand Up @@ -244,12 +235,12 @@ test-suite unit-tests
clash-cores,
clash-prelude-hedgehog,
deepseq,
tasty >= 1.2 && < 1.6,
hedgehog,
tasty >= 1.2 && < 1.6,
tasty-hedgehog >= 1.2.0,
tasty-hunit,
tasty-quickcheck,
tasty-th,
hedgehog,
tasty-hedgehog >= 1.2.0,

test-suite doctests
type: exitcode-stdio-1.0
Expand Down
6 changes: 0 additions & 6 deletions hdl-tests/cores-hdl-tests.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,3 @@ executable cores-hdl-tests
else
build-depends:
singletons < 3.0

-- See https://github.com/clash-lang/clash-compiler/pull/2511
if impl(ghc >= 9.4)
CPP-Options: -DCLASH_OPAQUE=OPAQUE
else
CPP-Options: -DCLASH_OPAQUE=NOINLINE
8 changes: 2 additions & 6 deletions hdl-tests/shouldwork/Xilinx/DcFifo/Basic.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE CPP #-}

module Basic where

import Clash.Explicit.Prelude
Expand Down Expand Up @@ -50,8 +48,7 @@ topEntity clk rst writeData rEnable =
, dcOverflow=True
, dcUnderflow=True
}
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE topEntity #-}
{-# OPAQUE topEntity #-}

testBench ::
Signal XilinxSystem Bool
Expand Down Expand Up @@ -82,8 +79,7 @@ testBench = done
(fDone <$> fsmOut)
clk = tbClockGen (not <$> done)
en = enableGen
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE testBench #-}
{-# OPAQUE testBench #-}

data FsmOut = FsmOut
{ fDone :: Bool
Expand Down
28 changes: 9 additions & 19 deletions hdl-tests/shouldwork/Xilinx/DcFifo/Lfsr.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Lfsr where
Expand Down Expand Up @@ -37,8 +36,7 @@ lfsrF clk rst ena seed = msb <$> r
five, three, two, zero :: Unsigned 16
(five, three, two, zero) = (5, 3, 2, 0)
lfsrFeedback = s ! five `xor` s ! three `xor` s ! two `xor` s ! zero
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE lfsrF #-}
{-# OPAQUE lfsrF #-}

fifoSampler ::
KnownDomain dom =>
Expand All @@ -60,8 +58,7 @@ fifoSampler clk rst ena stalls inps =
where
maybeData = readLastCycle `orNothing` readData
readNow = not stall && not fifoEmpty
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE fifoSampler #-}
{-# OPAQUE fifoSampler #-}

-- | Drives Xilinx FIFO with an ascending sequence of 'BitVector's. Stalls
-- intermittently based on stall input.
Expand Down Expand Up @@ -163,41 +160,34 @@ fifoVerifier clk rst ena actual = done0
done0 =
assert clk rst "Doesn't time out" stuck (pure False) $
assert clk rst "fifoVerifier" actual expected0 done
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE fifoVerifier #-}
{-# OPAQUE fifoVerifier #-}

topEntity_17_2 :: ConfiguredFifo (BitVector 16) Dom17 Dom2
topEntity_17_2 = dcFifo defConfig
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE topEntity_17_2 #-}
{-# OPAQUE topEntity_17_2 #-}
{-# ANN topEntity_17_2 (defSyn "topEntity_17_2") #-}

testBench_17_2 :: Signal Dom17 Bool
testBench_17_2 = mkTestBench topEntity_17_2
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE testBench_17_2 #-}
{-# OPAQUE testBench_17_2 #-}
{-# ANN testBench_17_2 (TestBench 'topEntity_17_2) #-}

topEntity_2_17 :: ConfiguredFifo (BitVector 16) Dom2 Dom17
topEntity_2_17 = dcFifo defConfig
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE topEntity_2_17 #-}
{-# OPAQUE topEntity_2_17 #-}
{-# ANN topEntity_2_17 (defSyn "topEntity_2_17") #-}

testBench_2_17 :: Signal Dom2 Bool
testBench_2_17 = mkTestBench topEntity_2_17
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE testBench_2_17 #-}
{-# OPAQUE testBench_2_17 #-}
{-# ANN testBench_2_17 (TestBench 'topEntity_2_17) #-}

topEntity_2_2 :: ConfiguredFifo (Unsigned 16) Dom2 Dom2
topEntity_2_2 = dcFifo defConfig
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE topEntity_2_2 #-}
{-# OPAQUE topEntity_2_2 #-}
{-# ANN topEntity_2_2 (defSyn "topEntity_2_2") #-}

testBench_2_2 :: Signal Dom2 Bool
testBench_2_2 = mkTestBench topEntity_2_2
-- See: https://github.com/clash-lang/clash-compiler/pull/2511
{-# CLASH_OPAQUE testBench_2_2 #-}
{-# OPAQUE testBench_2_2 #-}
{-# ANN testBench_2_2 (TestBench 'topEntity_2_2) #-}
6 changes: 2 additions & 4 deletions hdl-tests/shouldwork/Xilinx/DnaPortE2.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{-# LANGUAGE CPP #-}

module DnaPortE2 where

import Clash.Explicit.Prelude
Expand All @@ -11,7 +9,7 @@ topEntity ::
Reset XilinxSystem ->
Signal XilinxSystem (Maybe (BitVector 96))
topEntity clk rst = readDnaPortE2 clk rst enableGen simDna2
{-# CLASH_OPAQUE topEntity #-}
{-# OPAQUE topEntity #-}

testBench :: Signal XilinxSystem Bool
testBench = done
Expand All @@ -22,4 +20,4 @@ testBench = done
done = outputVerifier' clk rst expected (topEntity clk rst)
clk = tbClockGen (not <$> done)
rst = noReset
{-# CLASH_OPAQUE testBench #-}
{-# OPAQUE testBench #-}
Loading