There are some macros that we would like to be available for every module
compiled in our Hawk hardware specification system.

for example, the construct "step" takes a signal and maps a state
transformer across it through time.   here is a fragement of our
P6-like Reorder buffer spec:

  rob n wires
    = unbundle4 $ runST (
      do { q <- Q.new n
         ; rat <- RAT.new
         ; regfile <- RF.new
         ; step(wires)
             { let (fetched,computed)  = wires
             ; update q computed
             ; instrs <- insert rat q regfile fetched
             ; (retired,missed) <- retire rat q regfile
             ; inCase missed $ do { Q.clear q
                                  ; RAT.clear rat
                                  }
             ; capacity <- Q.space q
             ; let ready = if missed then [] else instrs
             ; return (retired,ready,capacity,missed)
             }
         }
     )
      where
      inCase x y = if x then y else return ()

when signals are simulated as infinite lists, then we can implement step
as:
     #define step(s) flip mapM (s) $ \() -> do


In Hugs, we use the -F flag to call GHC's preprocessor with the macros
file included.  We would like to do the same with GHC so that the same 
specifications can be compiled with GHC and interpreted with Hugs.


byron

On Tue, 5 May 1998, Sigbjorn Finne wrote:

> 
> Byron Cook writes:
> > Hi, 
> > 
> > Is there a ghc flag that will let me include a file before "hc" is
> > involked?
> > 
> 
> No, afraid not. Aesthetic considerations aside, why do you not want to
> have #includes appear in a source file?
> 
> --Sigbjorn
> 

Reply via email to