完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
亲爱的朋友们,
我听说我们甚至可以通过FPGA实现微控制器。 例如,我们可以用FPGA实现AVR micro。 我的问题是:我们怎样才能使用它? 假设我们已经用C语言编写了代码,现在我们改变了主意,决定用FPGA实现这个微控制器。 (例如,在opencores站点中有一些微型ip核心。)。 那么我们应该怎样处理之前编写的代码(用C语言编写)? 我希望我能够说出我的问题。 问候, Ghasem 以上来自于谷歌翻译 以下为原文 Dear friends, I have heard that we can implement even a micro controller by FPGA. For example, we can implement an AVR micro with an FPGA. My question is: how can we use it? suppose we have written our code in C, and now we have changed our mind and decided to implement that micro by an FPGA. (for example there are some micro ip-cores in opencores site.). So what should we do with the codes written before (in C language)? I hope I have been able to say my problem. Regards, Ghasem |
|
相关推荐
3个回答
|
|
嗨Ghasem,
简单地说:将已编译的代码存储在连接到处理器IP的ROM中,然后按下重置按钮。 实际上,微控制器只是一个裸处理器核心,因为你在opencores上发现了很多。 对于一个完整的系统,您需要内存基础设施和一些外围设备,如UART,GPIO等,以获得有用的东西。 如果您打算用C编写代码,那么您需要使System和Compiler工具兼容。 (例如,提供正确的启动代码,为IO基地址使用正确的内存布局,中断等) 但即使可能需要做很多工作,也可以这样做。 如果您想用具有完全代码兼容性的FPGA替换现有控制器,显然您必须根据控制器数据表中给出的规范设计FPGA逻辑。 这可能并不总是在FPGA中获得高性能系统的最佳选择,但它减少了调整软件开发工具的痛苦工作。 无论如何:这取决于您的设计目标。 有一个很好的综合 Eilert 以上来自于谷歌翻译 以下为原文 Hi Ghasem, simply said: store the compiled code in a ROM that's connected to the processor IP and push the reset button. Actually a microcontroller is a little more thn just a bare processor core as you find so many on opencores. For a complete system you need the memory infrastructure and some sorts of peripherals like UART, GPIO etc. to get something useful. If you intend to write your code in C then you need to make the System and the Compiler tools compatible. (e.g. provide correct startup code, use the right memory layout for the IO base addresses, interrupts etc.) But it's possible to do this, even if it might be a lot of work. If you want to replace an existing controller with an FPGA with full code compability, obviously yoou have to design the FPGA logic according to the specifications given in the controllers datasheet. This might not always be the best choice to get a performant system in the FPGA, but it reduces the painful work of adapting the software development tools. In any way: It depends on your design goals. Have a nice synthesis Eilert |
|
|
|
gh43m写道:
亲爱的朋友们, 我听说我们甚至可以通过FPGA实现微控制器。 例如,我们可以用FPGA实现AVR micro。 我的问题是:我们怎样才能使用它? 您可以像使用任何独立的微控制器一样使用它。 假设我们已经用C语言编写了代码,现在我们改变了主意,决定用FPGA实现这个微控制器。 (例如,在opencores站点中有一些微型ip核心。)。 那么我们应该怎样处理之前编写的代码(用C语言编写)? 重新编译C源以定位您在FPGA中实现的任何处理器,注意您必须确保外围设备位于相同存储器位置以及时序和中断以及所有其他内容相同的现实。 这也假设您放入FPGA的处理器的编译器实际存在且稳定可靠。 换句话说,它根本不是微不足道的。 而且,除非你有一个Real Good Fscking Reason用于嵌入处理器和FPGA,所以考虑一下根本不做。 ----------------------------是的,我这样做是为了谋生。 以上来自于谷歌翻译 以下为原文 gh43m wrote:You would use it like you'd use any standalone microcontroller. suppose we have written our code in C, and now we have changed our mind and decided to implement that micro by an FPGA. (for example there are some micro ip-cores in opencores site.). So what should we do with the codes written before (in C language)?Recompile the C sources to target whatever processor you've implemented in your FPGA, minding the reality that you have to make sure peripherals are at the same memory locations and that timing and interrupts and all of the other stuff is the same. This also assumes that a compiler for the processor you've put in the FPGA actually exists and is stable and reliable. In other words, it's not at all trivial. And, unless you have a Real Good Fscking Reason for embedding a processor an FPGA, consider just not doing it at all. ----------------------------Yes, I do this for a living. |
|
|
|
考虑到8位微控制器,如经典的8051架构,如果你计划在FPGA上实现相同的架构(假设内部外设的存储器布局如定时器,GPIO,控制器等与拱门上的相同。你是
实现),代码应该直接工作,无需任何更改。 根据eilert的建议,您的代码将驻留在EEPROM中。 在继续执行代码之前,还必须对微控制器的启动代码进行编程。 以上来自于谷歌翻译 以下为原文 Considering an 8 bit microcontroller such as the classic 8051 architechture, if you plan on implementing the same architechture on FPGA (assuming the memory layout of the internal peripherals scuh as timer, GPIO, controllers etc. is same as that on the arch. you are implementing), the code should work straight away without needing any changes. And as suggested by eilert, your code will be residing in a EEPROM. The startup code for micrcontroller also has to be programmed before proceeding with executing your code. |
|
1 条评论
|
|
只有小组成员才能发言,加入小组>>
2420 浏览 7 评论
2823 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2294 浏览 9 评论
3374 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2461 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
1180浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
587浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
452浏览 1评论
2005浏览 0评论
731浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-24 00:04 , Processed in 1.526271 second(s), Total 93, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号