[<<][meta][>>][..]
Sun Jan 8 13:13:07 EST 2012

SM updates

Maybe best to move nodes/src/sm to meta/sm..

Some impedance matching problems:

- SM assumes fixed block sizes and doesn't pass lenght in sm_tick()
  routine.  This might be good for allowing optimization, but is it
  really necessary?

- SM still assumes float array state.  Make this abstract: only bytes.


Code now generates with info from types.  After some foefelare I found
out that simpler type annotations are also possible.  That made it
quite straightforward.  The bindings on the structVar line are used
for type equations only.

  pdModule
    (update :: (s,i) -> m (s,o)) 
    (init   :: m s) 
    = do
      _def "sm_state_size" $ pdInt (4 * ns)
      _def "sm_nb_init"    $ pdInt ns
      _def "sm_nb_in"      $ pdInt ni
      _def "sm_nb_out"     $ pdInt no
      _def "sm_blocksize"  $ pdInt 64
      _def "sm_init"       $ pdInit init
      _def "sm_tick"       $ pdUpdate update
        where
          -- Relate syntax type and s
          (_, stx, _ :: s) = structVar undefined undefined
          -- Type-indexed info.
          ns = structSize stx (undefined :: s)
          ni = structSize stx (undefined :: i)
          no = structSize stx (undefined :: o)


It runs in the SM C test suite.  That's a nice mile stone.  More later.



[Reply][About]
[<<][meta][>>][..]