是否可以在 GA144 上运行模拟的 C 代码?

发布于 2024-08-18 23:14:40 字数 132 浏览 11 评论 0原文

该公司拥有一个有趣的CPU,运行速度惊人。可以模拟C还是内存太小?

This company have an interesting CPU that run at an amazing speed. Will it be possible to emulate C or is the memory too small?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

悲歌长辞 2024-08-25 23:14:40

有SEAforth40芯片(GA144芯片之前版本)的C编译器

介绍:
http://www.asu.ru/files/documents/00002990.pdf

There is C translator for SEAforth40 chip (previous version of GA144 chip)

Presentation:
http://www.asu.ru/files/documents/00002990.pdf

罪歌 2024-08-25 23:14:40

粗略地浏览指令集表明“colorForth”可以被认为是一种简单的机器语言。鉴于此,也许可以编写一个 C 编译器来编译 colorForth 作为其目标指令集。

当然,首先在 colorForth 中编写代码可能更容易。

A first cursory glance at the instruction set suggests that "colorForth" can be thought of as a simple machine language. Given that, it may be possible to write a C compiler that compiles to colorForth as its target instruction set.

Of course, it may be easier to write code in colorForth in the first place.

听你说爱我 2024-08-25 23:14:40

看起来,如果有人写了一个可以输出机器码(33条指令,不太复杂)的编译器,就不需要模拟C,直接编译就可以了。

当然,这将是极其有限的,因为看起来每个芯片都有少量的内部 RAM(64 个字并不算多)。其中一个核心有一个 18 位内存地址端口,因此您可以拥有 256MB 的外部 RAM,但它只能由其中一个核心直接访问,然后需要将其传递给另一个核心。

不同的内核可能用于不同的功能,但这会使编译器变得相当复杂。

From the looks of it, if someone writes a compiler which can output the machine code (33 instructions, not too complex), you won't need to emulate C, you could just directly compile it.

Of course, it would be extremely limited, since it looks like each chip gets a tiny amount of internal RAM (64 words isn't a lot to work with). There's an 18-bit memory address port attached to one of the cores, so you can have 256MB of external RAM, but it can only be directly accessed by a single one of the cores, and then it would need to be passed to the other.

It's possible that different cores could be used for different functions, but that would complicate the compiler quite a bit.

鹊巢 2024-08-25 23:14:40

这是可以做到的,但他们的解释器应该处理并行任务、负载分配等。最好选择他们的 Forth 解释器。

It could be done, but their interpreter should handle parallel tasks, load distribution, etc. It will probability be best to just go with their Forth interpreter.

傾旎 2024-08-25 23:14:40

叶绿素有一些普遍感兴趣的想法。我也恰好看起来像C:

我们开发了叶绿素,一种合成辅助编程模型,
GreenArrays GA144 的编译器,一个极其简约的
需要对程序进行分区的低功耗空间架构
分成不超过 256 条指令和 64 个字的片段
数据。该处理器的能效比其同类处理器高 100 倍
竞争对手,但目前只能使用低级编程
基于堆栈的语言。叶绿素编程模型允许
程序员通过指定部分内容来提供人类洞察力
数据和计算的划分。叶绿素编译器依赖于
在综合上,回避了发展经典的需要
优化,考虑到不寻常的情况,这可能具有挑战性
建筑学。为了将综合扩展到实际问题,我们分解了
编译成更小的综合子问题——分区、布局、
和代码生成。我们证明合成的程序不再是
比高度优化的专家编写的程序慢 65% 以上
比启发式、非综合版本生成的程序更快
我们的编译器。

http://www.eecs.berkeley.edu/~mangpo/www /talks/1311_forthday_handout.pdf

http://www.eecs。 berkeley.edu/~nishant/papers/Chlorophyll.pdf

Chlorophyll has some ideas of general interest. I also happens to look similar to C:

We developed Chlorophyll, a synthesis-aided programming model and
compiler for the GreenArrays GA144, an extremely minimalist
low-power spatial architecture that requires partitioning the program
into fragments of no more than 256 instructions and 64 words of
data. This processor is 100-times more energy efficient than its
competitors, but currently can only be programmed using a low-level
stack-based language. The Chlorophyll programming model allows
programmers to provide human insight by specifying partial
partitioning of data and computation. The Chlorophyll compiler relies
on synthesis, sidestepping the need to develop classical
optimizations, which may be challenging given the unusual
architecture. To scale synthesis to real problems, we decompose the
compilation into smaller synthesis subproblems—partitioning, layout,
and code generation. We show that the synthesized programs are no more
than 65% slower than highly optimized expert-written programs and are
faster than programs produced by a heuristic, non-synthesizing version
of our compiler.

http://www.eecs.berkeley.edu/~mangpo/www/talks/1311_forthday_handout.pdf

http://www.eecs.berkeley.edu/~nishant/papers/Chlorophyll.pdf

乖不如嘢 2024-08-25 23:14:40

您需要使用外部存储器,但除此之外,根据此 Greg Bailey 的“nofollow">白皮书:

搭建一个支持C的虚拟机并不难,
仅在美国就有许多人和公司
搭建这样一台机器,完成C语言的“移植”
虚拟机的编译器和库只是一个
重复他们以前做过的事情。一旦这已经
完成后,GreenArray 芯片可以运行任何适合的 C 程序
外部存储器,将满足任何 C 应用程序的要求
由此产生的执行速度满足了要求。

-- 摘自第 4 页

他还在该论文中讨论了 eForth 虚拟机的实现。

You would need to use external memory, but apart from that, it is certainly doable, according to this white paper by Greg Bailey:

It would not be difficult to build a virtual machine supporting C,
and there are many people and companies in the US alone for whom
building such a machine and completing a “port” of the C language
compiler and library to the virtual machine would be simply a
repetition of something they had done before. Once this has been
done, the GreenArray chip can run any C program which fits in the
external memory and will satisfy any C application requirement that
is met by the resulting execution speed.

-- excerpt from page 4

He also discuss their implementation of a eForth virtual machine in that paper.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文