小型 RISC 模拟器 [英] Small RISC emulator

查看:30
本文介绍了小型 RISC 模拟器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找将 VM 构建到游戏中,并且想知道是否有人知道任何非常简单的 VM(我认为 RISC/PIC 接近我想要的),这些 VM 通常用于嵌入式项目,例如控制机器人、电机、传感器等.如果我自己动手,我主要担心的是必须编写一个编译器/汇编器.我很高兴使用已经存在的工具,或者以最简单的形式使用可以为其编译的 C 编译器:-p.

I'm looking to build a VM into a game and was wondering if anyone knew of any really simple VM's (I was thinking RISC/PIC was close to what I wanted) that are usually used for embedded projects such as controlling robots, motors, sensors, etc. My main concern is having to write a compiler/assembler if I roll my own. I'd be nice to use the tools that are already out there or in its simplest form just a C compiler that can compile for it :-p.

我真的不想在这里重新发明轮子,但我还需要在虚拟世界中运行数千个这样的设备,因此它们必须尽可能简单和快速.正如一个人已经提到的那样,我也不关心现实世界的问题,例如时间和公共汽车以及所有有趣的东西.我认为他们的虚拟时钟将仅限于非常慢的东西.最终我可能不得不研究原生编译以使它们运行得更快,但现在我只是将原型放在一起以获得一般的概念证明.

I really don't want to re-invent the wheel here but I also need thousands of these running around a virtual world so they have to be as simple and as fast as possible. As one person has already mentioned I also don't care about real world issues such a timing and buses and all that fun stuff. I think their virtual clocks will be limited to somthing quite slow; and eventually I'll probably have to look into native compiling to make them run even faster but for now I'm just putting together prototypes to get a general proof of concept.

作为输入,我计划安装在圆柱体周围的距离、光线、材料和触摸传感器(16 个,也许是 32 个),然后只需 2 个电机用于定向输出,以控制每侧的一种轮子.基本上处理不会太费力,世界会很简单,这样机器就不必在简单的任务上投入大量的处理能力.

As input, I'm planning on distance, light, material and touch sensors mounted around the cylindrical body (16, maybe 32 of them), then simply 2 motors for directional output to control a sort of wheel on each side. essentially the processing won't be too strenuous and the world will be simple enough so that the machine's don't have to throw lots of processing power at simple tasks.

在内存方面,我希望他们能够存储足够的数据,以便在不干预构建地图和收集统计数据的情况下单独放置几天.我不喜欢 8bit 会因为处理或内存而减少它,但 16bit 肯定会是一个竞争者.32 位和 64 位只会推动它,而且它们的每个内存不可能超过 1mb - 可能更接近 256-512k.(比尔一说 640k 就足够了,为什么我不能!!)

In terms of memory, I'd like them to be able to store enough data to be left alone for a couple of days without intervention for building maps and gathering stats. I don't like 8bit would cut it for processing or memory but 16bit would definitely be a contender. 32 and 64bit would just be pushing it and there's no way they'll have any more than 1mb each of memory - probably closer to 256-512k. (Bill one said 640k would be enough so why can't I!!)

推荐答案

如果你想要一些植根于现实世界的东西,最常用的嵌入式 RISC 微控制器之一就是 PIC 系列.google 提供了几个模拟器,但我不认为大多数人都可以使用源代码.

if you want something rooted in the real world, one of the most-used embedded RISC microcontrollers is the PIC family. google gives several emulators, but i don't think the source is available for most.

另一种可能性是 QEMU,它已经模拟了几个 ARM 品种.

another possibility is QEMU, which already emulates several ARM varieties.

当然,如果您对模拟真实世界的设备不感兴趣,那么您自己动手做会更容易、性能更好.只包含您需要的内容,而不会陷入状态标志、溢出位、有限总线宽度、RAM 时序等的混乱中.

and, of course, if you're not interested in emulating a real-world device, far easier and better performance would be to roll your own. with only what you need, and not getting into the mess of state flags, overflow bits, limited bus width, RAM timings, etc.

这篇关于小型 RISC 模拟器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆