Conversation
…anch instructions to addresses greater than 2048
Contributor
|
At first glance . . . it looks like the |
Contributor
Author
Yes, I think you are right, I wanted to add a check to avoid using always the register (that was my first approach) I'll see if I can change it. |
… if s15 should be used for branch instructions
…lue-is-limited-to-11-bits' of github.com:openquantumhardware/qick into PR-63-tproc_v2-branch-instructions-immediate-address-value-is-limited-to-11-bits
Contributor
Author
|
Replaced We'll go with this solution for now and see if it can be improved later |
…-is-limited-to-11-bits' into PR-63-tproc_v2-branch-instructions-immediate-address-value-is-limited-to-11-bits
…'t work in nested macros
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.
Updated asm_v2 to support jump instructions (jump, call, conditional jump, close loop, wait, end) to addresses greater than 2048. Jump instructions with an immediate argument limit the argument to 11 bits; if the target label is more than 2048 lines into the program, the target address needs to be stored in a scratch register.
Since the program address of a label is not known until after macro expansion, and since replacing a jump-to-immediate with a jump-to-register adds an instruction, deciding which type of jump instruction to use needs to happen after macro expansion and needs to be done iteratively. This PR doesn't do that, and instead uses jump-to-register everywhere if the tProc program memory is more than 2048 words (in other words, if there is any possibility of exceeding the jump-to-immediate limit, whether or not that's actually happening). This adds extra instructions and execution time, but the impact should be negligible for typical programs.
We'll do this correctly later.