The popularization of FPGAs for the hobbyist market indicates a great deal a lot more than custom-made LED controllers as well as clones of traditional computer systems. FPGAs are likewise a fantastic tool to explore computer architecture, producing new, weird, CPUs that don’t abide by the conventions the market has utilized for 40 years. [Victor] is creating a new CPU that difficulties the conventions of exactly how to gain access to different memory locations, as well as in the process even came up with a bit of example code that runs on an ARM microcontroller.
Most of the time, the maker code running on your desktop or laptop isn’t that interesting; it’s just long strings of directions to be processed linearly. The magic of a computer comes with comparisons, an if statement or a jump in code, where the CPU can run one of two pieces of code, depending upon a value in a register. There is the issue of reach, though: if a piece of code makes a direct contact us to one more piece of code, the address of the new code need to in shape within an instruction. On an ARM processor, only 24 bits are offered to encode the address, indicating a jump in code can only go 16 MB on either side of its call. Going any type of additionally needs a lot more instructions, as well as the performance hit that comes together with that.
[Victor] made a decision a option to this issue would be to produce a bit of circuitry that would be a moving window to store address locations. instead of storing the literal address for jumps in code, every branch in the code is kept as a place family member to whatever is in the program counter. The result is an simple method to JMP to code extremely far away in memory, with less of a performance hit.
There’s an application for this moving window token thing [Victor] whipped up for NXP’s ARM Cortex M3 microprocessor, as well as he’ll be working on an application of this idea in a new CPU over on his git.