{"id":13439821,"url":"https://github.com/buserror/simavr","last_synced_at":"2025-05-14T04:07:33.749Z","repository":{"id":3282472,"uuid":"4322749","full_name":"buserror/simavr","owner":"buserror","description":"simavr is a lean, mean and hackable AVR simulator for linux \u0026 OSX","archived":false,"fork":false,"pushed_at":"2025-05-04T09:00:17.000Z","size":5959,"stargazers_count":1644,"open_issues_count":73,"forks_count":375,"subscribers_count":73,"default_branch":"master","last_synced_at":"2025-05-04T09:25:58.648Z","etag":null,"topics":["avr-gcc","avr-simulator","c","debugger","embedded","gtkwave","simavr"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/buserror.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2012-05-14T10:54:53.000Z","updated_at":"2025-05-04T09:00:21.000Z","dependencies_parsed_at":"2024-04-22T10:44:04.274Z","dependency_job_id":"a99ead09-a4c8-48d3-9902-7eb3903a9ee4","html_url":"https://github.com/buserror/simavr","commit_stats":{"total_commits":955,"total_committers":106,"mean_commits":9.00943396226415,"dds":"0.47958115183246075","last_synced_commit":"ae75edec3f4068f3d1a6c30130abef7ef8e83155"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buserror%2Fsimavr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buserror%2Fsimavr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buserror%2Fsimavr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/buserror%2Fsimavr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/buserror","download_url":"https://codeload.github.com/buserror/simavr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254069213,"owners_count":22009509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["avr-gcc","avr-simulator","c","debugger","embedded","gtkwave","simavr"],"created_at":"2024-07-31T03:01:17.371Z","updated_at":"2025-05-14T04:07:33.720Z","avatar_url":"https://github.com/buserror.png","language":"C","readme":"simavr - a lean and mean Atmel AVR simulator for linux\n======\n\n_simavr_ is an AVR simulator for linux, or any platform that uses avr-gcc. It uses \navr-gcc's own register definition to simplify creating new targets for supported AVR\ndevices. The core was made to be small and compact, and hackable so allow quick \nprototyping of an AVR project. The AVR core is now stable for use with parts \nwith \u003c= 128KB flash, and with preliminary support for the bigger parts. The \nsimulator loads ELF files directly, and there is even a way to specify simulation \nparameters directly in the emulated code using an .elf section. You can also \nload multipart HEX files.\n\n```diff\n- _simavr_ is provided **AS IS**. If you think you should report \"security vulnerabilities\"\n- and waste everyones time with them, you are either a grifter OR an idiot, or both. And\n- anyone checking the CV you brag about it will see this paragraph, first.\n```\n\nInstallation\n------------\nOn OSX, we recommend using [homebrew](https://brew.sh):\n\n    brew tap osx-cross/avr\n    brew install --HEAD simavr\n\nOn Ubuntu, SimAVR is available in the Bionic package source:\n\n    apt-get install simavr\n\n(Note that the command is made available under the name `simavr` not `run_avr`.)\n\nOtherwise, `make` is enough to just start using __bin/simavr__. To install the __simavr__ command system-wide, `make install RELEASE=1`.\n\nSupported IOs\n--------------\n* _eeprom_\n* _watchdog_\n* _IO ports_ (including pin interrupts)\n* _Timers_, 8 \u002616 (Normal, CTC and Fast PWM, the overflow interrupt too)\n* The _UART_, including tx \u0026 rx interrupts (there is a loopback/local echo test mode too)\n* _SPI_, master/slave including the interrupt\n* _i2c_ Master \u0026 Slave\n* External _Interrupts_, INT0 and so on.\n* _ADC_\n* Self-programming (ie bootloaders!)\n* A lot more!\n\nEmulated Cores (very easy to add new ones!)\n--------------\n+ ATMega2560\n+ AT90USB162 (with USB!)\n+ ATMega1281\n+ ATMega1280\n+ ATMega128\n+ ATMega128rf1\n+ ATMega16M1\n+ ATMega169\n+ ATMega162\n+ ATMega164/324/644\n+ ATMega48/88/168/328\n+ ATMega8/16/32\n+ ATTiny25/45/85\n+ ATTIny44/84\n+ ATTiny2313/2313v\n+ ATTiny13/13a\n+ Many more!\n\nExtras:\n-------\n* fully working _gdb_ support including some pretty cool “passive modes”.\n* There is also very easy support for “VCD” (Value Change Dump) that can be visualized \ngraphically as “waveforms” with tools like _gtkwave_ (see below).\n* You can even source your own VCD files (for example from your logic analyzer) and feed them into your simulation.\n* There are a few examples of real life firmwares running on simavr, including OpenGL rendering of the display…\n* There is support for _Arduino_, but no IDE integration\n\nDocumentation And Further Information\n-------------------------------------\n\n* [Manual / Developer Guide](doc/manual/manual.pdf?raw=true)\n* [Examples](examples)\n* [Mailing List](https://groups.google.com/g/simavr)\n* IRC: _#simavr_ on Freenode\n\nContributing\n------------\n\nPatches are always welcome! Please submit your changes via Github pull requests.\n\nVCD Support -- built in logic analyzer \n-----------\n_simavr_ can output most of its pins, firmware variables, interrupts and a few other\nthings as signals to be dumped into a file that can be plotted using gtkwave for\nfurther, precise analysis.\nA firmware can contain instructions for _simavr_ to know what to trace, and the file is\nautomatically generated.\nExample:\n\n\tconst struct avr_mmcu_vcd_trace_t _mytrace[]  _MMCU_ = {\n\t\t{ AVR_MCU_VCD_SYMBOL(\"UDR0\"), .what = (void*)\u0026UDR0, },\n\t\t{ AVR_MCU_VCD_SYMBOL(\"UDRE0\"), .mask = (1 \u003c\u003c UDRE0), .what = (void*)\u0026UCSR0A, },\n\t};\n\nWill tell _simavr_ to generate a trace everytime the UDR0 register changes and everytime\nthe interrupt is raised (in UCSR0A). The *_MMCU_* tag tells gcc that it needs compiling,\nbut it won't be linked in your program, so it takes literally zero bytes, this is a code\nsection that is private to _simavr_, it's free!\nA program running with these instructions and writing to the serial port will generate\na file that will display:\n\n\t$ ./simavr/run_avr tests/atmega88_example.axf\n\tAVR_MMCU_TAG_VCD_TRACE 00c6:00 - UDR0\n\tAVR_MMCU_TAG_VCD_TRACE 00c0:20 - UDRE0\n\tLoaded 1780 .text\n\tLoaded 114 .data\n\tLoaded 4 .eeprom\n\tStarting atmega88 - flashend 1fff ramend 04ff e2end 01ff\n\tatmega88 init\n\tavr_eeprom_ioctl: AVR_IOCTL_EEPROM_SET Loaded 4 at offset 0\n\tCreating VCD trace file 'gtkwave_trace.vcd'\n\tRead from eeprom 0xdeadbeef -- should be 0xdeadbeef..\n\tRead from eeprom 0xcafef00d -- should be 0xcafef00d..\n\tsimavr: sleeping with interrupts off, quitting gracefully\n\nAnd when the file is loaded in gtkwave, you see:\n![gtkwave](doc/img/gtkwave1.png)\n\nYou get a very precise timing breakdown of any change that you add to the trace, down\nto the AVR cycle. \n\nExample:\n--------\n_simavr_ is really made to be the center for emulating your own AVR projects, not just\na debugger, but also the emulating the peripherals you will use in your firmware, so \nyou can test and develop offline, and now and then try it on the hardware.\n\nYou can also use _simavr_ to do test units on your shipping firmware to validate it\nbefore you ship a new version, to prevent regressions or mistakes.\n\n_simavr_ has a few 'complete projects/ that demonstrate this, most of them were made\nusing real hardware at some point, and the firmware binary is _exactly_ the one that\nran on the hardware. The key here is to emulate the _parts_ or peripherals that\nare hooked to the AVR. Of course, you don't have to emulate the full hardware, you just\nneed to generate the proper stimulus so that the AVR is fooled.\n\nHD44780 LCD Board Demo\n----------------------\n\n![lcd](doc/img/hd44780.png)\n\nThis example board hooks up an Atmega48 to an emulated HD44780 LCD and display a running\ncounter in the 'lcd'. Everything is emulated, the firmware runs exactly like this\non a real hardware.\n\n![lcd-gtkwave](doc/img/hd44780-wave.png)\n\nAnd this is a gtkwave trace of what the firmware is doing. You can zoom in, measure, etc\nin gtkwave, select traces to see etc.\n\nQuite a few other examples are available!\n","funding_links":[],"categories":["C","Microcontrollers","\u003ca id=\"89e277bca2740d737c1aeac3192f374c\"\u003e\u003c/a\u003e工具","Simulators"],"sub_categories":["\u003ca id=\"203d00ef3396d68f5277c90279f4ebf3\"\u003e\u003c/a\u003e新添加"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuserror%2Fsimavr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuserror%2Fsimavr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuserror%2Fsimavr/lists"}