词条 | StreamIt |
释义 | StreamIt麻省理工学院(MIT,注意StreamIt的后三个字母)开发的一个面向多核的流语言编译程序。 常多应用于多媒体领域。 一个简单的示例A Minimal Programvoid -> void pipeline Minimal{ add IntSource; add IntPrinter; } void -> int filter IntSource { int x; init { x = 0;} work push 1 { push(x++); } } int -> void filter IntPrinter { work pop 1 { print(pop()); } } 下面是斐波那契数列的产生,用StreamIt实现void->void pipeline Fib { add feedbackloop { join roundrobin(0, 1); body PeekAdd(); loop Identity<int>(); split duplicate; enqueue 0; enqueue 1; }; add IntPrinter(); } int->int filter PeekAdd { work push 1 pop 1 peek 2 { push(peek(1) + pop()); } } int->void filter IntPrinter { work pop 1 { println(pop()); } } StreamIt编译命令及语法StreamIt程序以.str结尾,编译程序命令 strc *.str 或者 strc *.str -library(调用JAVA库) 运行已编译好的程序用命令 ./a.out 目前一般linux平台上run 由于StreamIt编译器将.str代码转换成中间代码.java 所以StreamIt有许多规则同JAVA类似 比如程序hello.str中最外的pipeline命名必须为hello 身为流语言的StreamIt结构相当清晰 dotty命令可以为证 查看右图所示的.dot图可用命令 dotty stream-graph-simple.dot StreamIt语法可查看cookbook 建议在MIT网站上从例子中自己挖掘 附图一张 如何查找StreamIt资料StreamIt并未普及 了解这个语言的人相当有限 编译器可在下面给出的扩展阅读中的网站中找,是MIT的官方页面。 另外,在google中收索StreamIt 国防科大 会有一些相关的文献 在google中输入StreamIt cookbook 会有在CSDN上的资料。 |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。