This repository was archived by the owner on Aug 20, 2023. It is now read-only.
Open
Conversation
For now this is a proof of concept. Storing parameters works fine, reading them back, too, but instead of being used, they're simple written to the console. For now the parameters are device type and cpu frequency, but the concept can be extended easily to all other command line parameters. The proof is applied to the simple_serial example. The point of this strategy is to avoid the neccessity to run simulavr with more command line parameters than just the name of the ELF file. At compilation time we know best for which device we compile, after all.
Substantial part of this patch is a move from accessing protected properties of class AvrDevice directly to using their Getters.
This makes the ELf file slightly bigger, but reading it more simple and failure-proof.
avr-gcc has been seen to set the length field to zero. Clearly a bug, but ignoring bugs doesn't help.
Applied to the simple_serial example, but no action yet, just the info transport.
This class moves serial output to a file, to a special file or to stdout. While there's special_output_port already, using an UI device neither changes the AVR code nor does it influence AVR behaviour.
Once I found out on how it's done, it was surprisingly simple. Even better for the user: No need for TCL, no need for Python, no need for Swig, just add a single, simple macro to your AVR source code.
Almost the same as SIMINFO_SERIAL_IN(), but the other direction.
Just like the Rx counterpart, this is for communications between a file/special file/console and the actually simulated UART. Works beautifully.
Just as the Rx counterpart, you can now connect to the console, a pipe file or even a serial device file of the host. All without additional scripting and languages, just a macro in the AVR source code.
Sync "#ifdef _MSC_VER" ELFLoad definition with src/avrreadelf.h declaration.
There were errors like this: WARNING: file avrreadelf.cpp: line 417: ELF signature 0xffffffff taking precedence over ELF siminfo device name atmega644 WARNING: file avrreadelf.cpp: line 441: unknown signature in ELF file: 0xffffffff Problem was variable "signature" being initialised to max(), but checked against zero. To avoid more such confusions the whole function was rewritten in a more sorted order. Functionality should be still the same.
Simply make them the same as their non-p counterparts, even is this isn't entirley correct; e.g. 644 has only one UART, 644p has two. No need to also change src/avrsignature.cpp, these variants are already known there.
For unknown reasons, AvrDevice::Step() of an ATmega644 occasionally returns 1. This was ignored up until the breaking patch came along. Return to ignoring this flag again.
The message combined the expected runtime with the actual number of cycles simulated. These two don't fit in case the simulation was aborted prematurely by some means.
It changes something like Connection opened by host 127.0.0.1, port -31795. to something like Connection opened by host 127.0.0.1, port 35990.
3e1b746 to
0f64e17
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When connecting with gdb, it changes
Connection opened by host 127.0.0.1, port -31795.
to something like
Connection opened by host 127.0.0.1, port 35990.