File tree 3 files changed +14
-15
lines changed
3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -196,11 +196,7 @@ blackboxObject
196
196
-- ^ templateD
197
197
-> Value
198
198
blackboxObject bbname type_ templateD =
199
- #if MIN_VERSION_aeson(2,0,0)
200
199
Object (KM. fromList [(" BlackBox" , Object (KM. fromList [
201
- #else
202
- Object (fromList [(" BlackBox" , Object (fromList [
203
- #endif
204
200
(" name" , String $ Text. pack bbname)
205
201
, (" kind" , " Declaration" )
206
202
, (" type" , String $ Text. pack type_)
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ flag pedantic
44
44
45
45
custom-setup
46
46
-- ghc-options: -Wall -Werror
47
- setup-depends : aeson,
47
+ setup-depends : aeson >= 2.0.0 ,
48
48
base >= 4.10 && < 5 ,
49
49
bytestring,
50
50
Cabal,
Original file line number Diff line number Diff line change @@ -47,6 +47,17 @@ arrowsR (t0:ts) t = arrow t0 (arrowsR ts t)
47
47
applyE :: Foldable t => ExpQ -> t Name -> ExpQ
48
48
applyE = foldl (\ f x -> [| $ f $ (varE x) | ])
49
49
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
50
61
--------------------------------------
51
62
---- CODE GENERATION -----------------
52
63
--------------------------------------
@@ -56,16 +67,8 @@ applyE = foldl (\f x -> [| $f $(varE x) |])
56
67
-- to 16.)
57
68
coSimGen :: Q [Dec ]
58
69
coSimGen = 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
69
72
70
73
concat <$> (sequence [coSimGen' clks args | clks <- [0 .. m], args <- [1 .. n]])
71
74
You can’t perform that action at this time.
0 commit comments