PE/PA bit operands: add bit access support#39
Open
occamsshavingkit wants to merge 3 commits into
Open
Conversation
Add 1-bit operand descriptors for direct peripheral input and output areas so bit instructions can parse PE/PA operands alongside the existing PEB/PEW/PED and PAB/PAW/PAD forms. Also add the English PI/PQ aliases to keep bit operands consistent with the existing PIB/PIW/PID and PQB/PQW/PQD aliases.
The direct peripheral hardware callback API accepts a byte offset and an access width, but no bit offset. For PE/PA bit operands, route hardware access as an 8-bit access at the operand byte offset, then extract or update the addressed bit in the CPU process image. PE bit reads now refresh the process-image byte when direct hardware returns data, then return the requested bit. PA bit stores update the process-image bit first, then write the resulting byte to hardware so neighboring bits are preserved. PA bit stores outside the output process image are rejected because the current hardware API cannot read-modify-write an isolated peripheral output bit without a backing byte image.
Cover PE bit process-image fallback, PA bit process-image preservation, and direct hardware PE/PA bit access. The hardware-facing test uses a temporary module that requires byte-wide direct access, which catches regressions that pass width 1 to the hardware API. The direct hardware test also exercises English PI/PQ bit aliases under English mnemonics.
Owner
|
Thanks for your contribution. Peripheral bit access was left out because I thought it doesn't exist on the real S7 hardware. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds PE/PA and PI/PQ bit operand parsing and byte-backed peripheral bit access, with regression coverage.
Validated locally:
Rollback: close the PR before merge, or revert the three commits after merge.