From 8ed8429ec9709ab235d7c382ede57b6bbd55c674 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Thu, 20 Mar 2025 08:26:43 -0400 Subject: [PATCH 1/3] Typofix: Bluespec, not C99. Refs #36. The non-public `Copilot.Compiler.Bluespec.External` module lives under a `shared/` directory so that it be imported by both the library code and the test suite code. This is a questionable design, as if the test suite needs to use the code, then it should be exposed by the library. The comments in `Copilot.Compiler.Bluespec.External` mistakenly reference the C99 backend instead of the Bluespec backend, which will make it confusing for users when this module is exposed as part of the public interface. This commit fixes the comments to reference the Bluespec backend instead. --- shared/Copilot/Compile/Bluespec/External.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/Copilot/Compile/Bluespec/External.hs b/shared/Copilot/Compile/Bluespec/External.hs index 12bc404..6d42105 100644 --- a/shared/Copilot/Compile/Bluespec/External.hs +++ b/shared/Copilot/Compile/Bluespec/External.hs @@ -22,7 +22,7 @@ data External = forall a. External -- | Collect all external variables from the streams and triggers. -- -- Although Copilot specifications can contain also properties and theorems, --- the C99 backend currently only generates code for streams and triggers. +-- the Bluespec backend currently only generates code for streams and triggers. gatherExts :: [Stream] -> [Trigger] -> [External] gatherExts streams triggers = streamsExts `extUnion` triggersExts where From 968ad2ea619f71250fbedd77431f89862ecb6d4e Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Thu, 20 Mar 2025 08:25:24 -0400 Subject: [PATCH 2/3] Expose Copilot.Compile.Bluespec.External. Refs #36. The non-public `Copilot.Compiler.Bluespec.External` module lives under a `shared/` directory so that it be imported by both the library code and the test suite code. This is a questionable design, as if the test suite needs to use the code, then it should be exposed by the library. This commit moves `Copilot.Compiler.Bluespec.External` from `shared/` to `src/`, exposes the module as part of the public API, and removes the `shared/` directory. As a result, the test suite can now import `Copilot.Compiler.Bluespec.External` like it does other parts of the `copilot-bluespec` API. --- copilot-bluespec.cabal | 8 +++----- {shared => src}/Copilot/Compile/Bluespec/External.hs | 0 2 files changed, 3 insertions(+), 5 deletions(-) rename {shared => src}/Copilot/Compile/Bluespec/External.hs (100%) diff --git a/copilot-bluespec.cabal b/copilot-bluespec.cabal index 32ce9b5..0a172e3 100644 --- a/copilot-bluespec.cabal +++ b/copilot-bluespec.cabal @@ -36,7 +36,7 @@ source-repository head library default-language : Haskell2010 - hs-source-dirs : src, shared + hs-source-dirs : src ghc-options : -Wall build-depends : base >= 4.9 && < 5 @@ -48,12 +48,12 @@ library , language-bluespec >= 0.1 && < 0.2 exposed-modules : Copilot.Compile.Bluespec + , Copilot.Compile.Bluespec.External other-modules : Copilot.Compile.Bluespec.CodeGen , Copilot.Compile.Bluespec.Compile , Copilot.Compile.Bluespec.Error , Copilot.Compile.Bluespec.Expr - , Copilot.Compile.Bluespec.External , Copilot.Compile.Bluespec.FloatingPoint , Copilot.Compile.Bluespec.Name , Copilot.Compile.Bluespec.Representation @@ -70,8 +70,6 @@ test-suite tests other-modules: Test.Copilot.Compile.Bluespec - Copilot.Compile.Bluespec.External - build-depends: base , directory @@ -91,7 +89,7 @@ test-suite tests , copilot-bluespec hs-source-dirs: - tests, shared + tests default-language: Haskell2010 diff --git a/shared/Copilot/Compile/Bluespec/External.hs b/src/Copilot/Compile/Bluespec/External.hs similarity index 100% rename from shared/Copilot/Compile/Bluespec/External.hs rename to src/Copilot/Compile/Bluespec/External.hs From 091a7db9d48f0c8a847e89cc8429e93f41256a05 Mon Sep 17 00:00:00 2001 From: Ryan Scott Date: Thu, 20 Mar 2025 08:27:36 -0400 Subject: [PATCH 3/3] Document changes in CHANGELOG. Refs #36. --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 0fdc0d1..dd07bfb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2025-03-20 + * Expose Copilot.Compile.Bluespec.External. (#36) + 2025-03-10 * Version bump (4.3). (#34)