vak: (Улыбка)
[personal profile] vak
"Compiling from Haste to CDFG: a front end for an asynchronous circuit synthesis system" (PDF).

Вычисление факториала на языке Haste выглядит следующим образом:
int = type [0..2^32-1] &

fact : main proc (in?chan int & out!chan int).
  begin x,y :var int ff
  |
    forever do
      in ? x
    ; y := 1
    ; do x > 1 then
        y := y * x
      ; x := x - 1
      od
    ; out ! y
  od
end

Эта функция превращается в такую асинхронную схему:


Дальнейшее преобразование в Верилог и синтез делаются элементарно.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org