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

Unmatchable constant as case subject #2806

Open
Tracked by #2757
DigitalBrains1 opened this issue Sep 7, 2024 · 0 comments
Open
Tracked by #2757

Unmatchable constant as case subject #2806

DigitalBrains1 opened this issue Sep 7, 2024 · 0 comments

Comments

@DigitalBrains1
Copy link
Member

DigitalBrains1 commented Sep 7, 2024

As we are separating clash-cores from clash-compiler, I tried to support not just Clash master but also Clash 1.8. But there are several cores in clash-cores that fail their test suite on Clash 1.8.1 on several GHC versions.

These cores work fine on Clash master, and with Clash 1.8.1 they also pass the test suite on some GHC's, but on other GHC's, they give the error below. The error below was created with GHC 9.6.6.

These combinations work fine: Clash 1.8.1 and GHC 8.10.7, 9.0.2, 9.2.8.

These combinations error out: Clash 1.8.1 and GHC 9.4.8, 9.6.6, 9.8.2

The tests for XpmCdcArraySingle, XpmCdcPulse, XpmCdcSingle and XpmCdcSyncRst all fail with an error like the following:

        XpmCdcSingle
          VHDL
            clash (gen): FAIL (11.11s)
              Program /home/peter/.cabal/store/ghc-9.6.6/clash-ghc-1.8.1-e-clash-68ff2c36ae3563cc68aeabf6f0365435a854e632e34a6de5521bc73c1c132393/bin/clash
               failed with error-code 1.
              
              Full invocation:
              
                /home/peter/.cabal/store/ghc-9.6.6/clash-ghc-1.8.1-e-clash-68ff2c36ae3563cc68aeabf6f0365435a854e632e34a6de5521bc73c1c132393/bin/clash
                 --vhdl -i/home/peter/src/clash/clash-cores/./test-suite/shouldwork/Xilinx XpmCdcSingle -fclash-hdldir /tmp/clash-test_XpmCdcSingle-1c536e9532a5982f/hdl -odir /tmp/clash-test_XpmCdcSingle-1c536e9532a5982f -hidir /tmp/clash-test_XpmCdcSingle-1c536e9532a5982f -fclash-debug DebugSilent -DCLASH_OPAQUE=OPAQUE
                
              
              Stderr was:
              
                Unmatchable constant as case subject: >=#
                  (word2Int#
                     (popCnt64#
                        (xor64#
                           (or64#
                              (xor64#
                                 (timesWord64#
                                    (xor64#
[...]

This error message goes on for more than 26,000 lines for VHDL and more than 24,000 lines for Verilog.

An easy to work with repository can be found at clash-cores repro-1.8-issues. You can just do cabal run clash-cores-test-suite -- -p XpmCdcSingle.VHDL (although investigating the bug obviously needs more).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant