File tree Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -196,11 +196,7 @@ blackboxObject
196196 -- ^ templateD
197197 -> Value
198198blackboxObject bbname type_ templateD =
199- #if MIN_VERSION_aeson(2,0,0)
200199 Object (KM. fromList [(" BlackBox" , Object (KM. fromList [
201- #else
202- Object (fromList [(" BlackBox" , Object (fromList [
203- #endif
204200 (" name" , String $ Text. pack bbname)
205201 , (" kind" , " Declaration" )
206202 , (" type" , String $ Text. pack type_)
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ flag pedantic
4444
4545custom-setup
4646-- ghc-options: -Wall -Werror
47- setup-depends : aeson,
47+ setup-depends : aeson >= 2.0.0 ,
4848 base >= 4.10 && < 5 ,
4949 bytestring,
5050 Cabal,
Original file line number Diff line number Diff line change @@ -47,6 +47,17 @@ arrowsR (t0:ts) t = arrow t0 (arrowsR ts t)
4747applyE :: Foldable t => ExpQ -> t Name -> ExpQ
4848applyE = foldl (\ f x -> [| $ f $ (varE x) | ])
4949
50+ maxNumberOfClocks :: IO Int
51+ maxNumberOfArgs :: IO Int
52+ #ifdef CABAL
53+ -- We're running in a CABAL environment, so we know this environment
54+ -- variable is set:
55+ maxNumberOfClocks = read <$> runIO (getEnv " COSIM_MAX_NUMBER_OF_CLOCKS" )
56+ maxNumberOfArgs = read <$> runIO (getEnv " COSIM_MAX_NUMBER_OF_ARGUMENTS" )
57+ #else
58+ maxNumberOfClocks = pure 1
59+ maxNumberOfArgs = pure 16
60+ #endif
5061--------------------------------------
5162---- CODE GENERATION -----------------
5263--------------------------------------
@@ -56,16 +67,8 @@ applyE = foldl (\f x -> [| $f $(varE x) |])
5667-- to 16.)
5768coSimGen :: Q [Dec ]
5869coSimGen = do
59- #ifdef CABAL
60- -- We're running in a CABAL environment, so we know this environment
61- -- variable is set:
62- m <- read <$> runIO (getEnv " COSIM_MAX_NUMBER_OF_CLOCKS" )
63- n <- read <$> runIO (getEnv " COSIM_MAX_NUMBER_OF_ARGUMENTS" )
64- #else
65- let m = 1
66- let n = 16
67- #endif
68-
70+ m <- maxNumberOfClocks
71+ n <- maxNumberOfArgs
6972
7073 concat <$> (sequence [coSimGen' clks args | clks <- [0 .. m], args <- [1 .. n]])
7174
You can’t perform that action at this time.
0 commit comments