电子发烧友App

硬声App

0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示
电子发烧友网>电子资料下载>电子资料>面向linux的精简平均的Atmel AVR模拟器

面向linux的精简平均的Atmel AVR模拟器

2022-04-19 | zip | 3.73 MB | 次下载 | 免费

资料介绍

授权协议 GPL-3.0 License
开发语言 C/C++
软件类型 开源软件

软件简介

simavr - a lean and mean Atmel AVR simulator for linux

simavr is a new AVR simulator for linux, or any platform that uses avr-gcc. It uses avr-gcc's own register definition to simplify creating new targets for supported AVR devices. The core was made to be small and compact, and hackable so allow quick prototyping of an AVR project. The AVR core is now stable for use with parts with <= 128KB flash, and with preliminary support for the bigger parts. The simulator loads ELF files directly, and there is even a way to specify simulation parameters directly in the emulated code using an .elf section. You can also load multipart HEX files.

Installation

On OSX, we recommend using homebrew:

brew tap osx-cross/avr
brew install --HEAD simavr

On Ubuntu, SimAVR is available in the Bionic package source:

apt-get install simavr

(Note that the command is made available under the name simavr not run_avr.)

Otherwise, make is enough to just start using bin/simavr. To install the simavr command system-wide, make install RELEASE=1.

Supported IOs

  • eeprom
  • watchdog
  • IO ports (including pin interrupts)
  • Timers, 8 &16 (Normal, CTC and Fast PWM, the overflow interrupt too)
  • The UART, including tx & rx interrupts (there is a loopback/local echo test mode too)
  • SPI, master/slave including the interrupt
  • i2c Master & Slave
  • External Interrupts, INT0 and so on.
  • ADC
  • Self-programming (ie bootloaders!)

Emulated Cores (very easy to add new ones!)

  • ATMega2560
  • AT90USB162 (with USB!)
  • ATMega1281
  • ATMega1280
  • ATMega128
  • ATMega128rf1
  • ATMega16M1
  • ATMega169
  • ATMega162
  • ATMega164/324/644
  • ATMega48/88/168/328
  • ATMega8/16/32
  • ATTiny25/45/85
  • ATTIny44/84
  • ATTiny2313/2313v
  • ATTiny13/13a

Extras:

  • fully working gdb support including some pretty cool “passive modes”.
  • There is also very easy support for “VCD” (Value Change Dump) that can be visualized graphically as “waveforms” with tools like gtkwave (see below).
  • There are a few examples of real life firmwares running on simavr, including OpenGL rendering of the display…
  • There is support for Arduino, but no IDE integration

Documentation And Further Information

Contributing

Patches are always welcome! Please submit your changes via Github pull requests.

VCD Support -- built in logic analyzer

simavr can output most of its pins, firmware variables, interrupts and a few other things as signals to be dumped into a file that can be plotted using gtkwave for further, precise analysis. A firmware can contain instructions for simavr to know what to trace, and the file is automatically generated. Example:

const struct avr_mmcu_vcd_trace_t _mytrace[]  _MMCU_ = {
	{ AVR_MCU_VCD_SYMBOL("UDR0"), .what = (void*)&UDR0, },
	{ AVR_MCU_VCD_SYMBOL("UDRE0"), .mask = (1 << UDRE0), .what = (void*)&UCSR0A, },
};

Will tell simavr to generate a trace everytime the UDR0 register changes and everytime the interrupt is raised (in UCSR0A). The MMCU tag tells gcc that it needs compiling, but it won't be linked in your program, so it takes literally zero bytes, this is a code section that is private to simavr, it's free! A program running with these instructions and writing to the serial port will generate a file that will display:

$ ./simavr/run_avr tests/atmega88_example.axf
AVR_MMCU_TAG_VCD_TRACE 00c6:00 - UDR0
AVR_MMCU_TAG_VCD_TRACE 00c0:20 - UDRE0
Loaded 1780 .text
Loaded 114 .data
Loaded 4 .eeprom
Starting atmega88 - flashend 1fff ramend 04ff e2end 01ff
atmega88 init
avr_eeprom_ioctl: AVR_IOCTL_EEPROM_SET Loaded 4 at offset 0
Creating VCD trace file 'gtkwave_trace.vcd'
Read from eeprom 0xdeadbeef -- should be 0xdeadbeef..
Read from eeprom 0xcafef00d -- should be 0xcafef00d..
simavr: sleeping with interrupts off, quitting gracefully

And when the file is loaded in gtkwave, you see: poYBAGJcv_qAXlimAACd2-0E9NM762.png

You get a very precise timing breakdown of any change that you add to the trace, down to the AVR cycle.

Example:

simavr is really made to be the center for emulating your own AVR projects, not just a debugger, but also the emulating the peripherals you will use in your firmware, so you can test and develop offline, and now and then try it on the hardware.

You can also use simavr to do test units on your shipping firmware to validate it before you ship a new version, to prevent regressions or mistakes.

simavr has a few 'complete projects/ that demonstrate this, most of them were made using real hardware at some point, and the firmware binary is exactly the one that ran on the hardware. The key here is to emulate the parts or peripherals that are hooked to the AVR. Of course, you don't have to emulate the full hardware, you just need to generate the proper stimulus so that the AVR is fooled.

HD44780 LCD Board Demo

pYYBAGJcv_2ADivsAAAGKtME7NE078.png

This example board hooks up an Atmega48 to an emulated HD44780 LCD and display a running counter in the 'lcd'. Everything is emulated, the firmware runs exactly like this on a real hardware.

pYYBAGJcwACABe_uAADtH2jU2tk371.png

And this is a gtkwave trace of what the firmware is doing. You can zoom in, measure, etc in gtkwave, select trades to see etc.

Quite a few other examples are available!

 

下载该资料的人也在下载 下载该资料的人还在阅读
更多 >

评论

查看更多

下载排行

本周

  1. 1山景DSP芯片AP8248A2数据手册
  2. 1.06 MB  |  532次下载  |  免费
  3. 2RK3399完整板原理图(支持平板,盒子VR)
  4. 3.28 MB  |  339次下载  |  免费
  5. 3TC358743XBG评估板参考手册
  6. 1.36 MB  |  330次下载  |  免费
  7. 4DFM软件使用教程
  8. 0.84 MB  |  295次下载  |  免费
  9. 5元宇宙深度解析—未来的未来-风口还是泡沫
  10. 6.40 MB  |  227次下载  |  免费
  11. 6迪文DGUS开发指南
  12. 31.67 MB  |  194次下载  |  免费
  13. 7元宇宙底层硬件系列报告
  14. 13.42 MB  |  182次下载  |  免费
  15. 8FP5207XR-G1中文应用手册
  16. 1.09 MB  |  178次下载  |  免费

本月

  1. 1OrCAD10.5下载OrCAD10.5中文版软件
  2. 0.00 MB  |  234315次下载  |  免费
  3. 2555集成电路应用800例(新编版)
  4. 0.00 MB  |  33566次下载  |  免费
  5. 3接口电路图大全
  6. 未知  |  30323次下载  |  免费
  7. 4开关电源设计实例指南
  8. 未知  |  21549次下载  |  免费
  9. 5电气工程师手册免费下载(新编第二版pdf电子书)
  10. 0.00 MB  |  15349次下载  |  免费
  11. 6数字电路基础pdf(下载)
  12. 未知  |  13750次下载  |  免费
  13. 7电子制作实例集锦 下载
  14. 未知  |  8113次下载  |  免费
  15. 8《LED驱动电路设计》 温德尔著
  16. 0.00 MB  |  6656次下载  |  免费

总榜

  1. 1matlab软件下载入口
  2. 未知  |  935054次下载  |  免费
  3. 2protel99se软件下载(可英文版转中文版)
  4. 78.1 MB  |  537798次下载  |  免费
  5. 3MATLAB 7.1 下载 (含软件介绍)
  6. 未知  |  420027次下载  |  免费
  7. 4OrCAD10.5下载OrCAD10.5中文版软件
  8. 0.00 MB  |  234315次下载  |  免费
  9. 5Altium DXP2002下载入口
  10. 未知  |  233046次下载  |  免费
  11. 6电路仿真软件multisim 10.0免费下载
  12. 340992  |  191187次下载  |  免费
  13. 7十天学会AVR单片机与C语言视频教程 下载
  14. 158M  |  183279次下载  |  免费
  15. 8proe5.0野火版下载(中文版免费下载)
  16. 未知  |  138040次下载  |  免费