-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Match emulator to circuits: use a Harvard Architecture (#688)
Our circuits use a [modified](Modified_Harvard_architecture) [Harvard architecture](https://en.wikipedia.org/wiki/Harvard_architecture) where the memory space for instructions and data are completely separated, even though they are both addressed with 32 bits. That is a Good Thing. That means writing to the data cell with address x does not change the value of the instruction cell with address x. In contrast, our emulator uses a [von Neumann architecture](https://en.wikipedia.org/wiki/Von_Neumann_architecture) at its core, but goes through quite a few gymnastics to hide that fact. > In a von Neumann architecture, data memory and stored program memory are intermixed. Modern computers have moved away from this architecture for [security](https://en.wikipedia.org/wiki/W%5EX) and performance reasons. In this PR, we turn our emulator into a Harvard Architecture machine as well to match what our circuits are doing. That means we change the emulator to explicitly load instructions not from the data RAM, but from the program ROM, which we are already storing separately anyway. > Instead of thinking about separate address spaces for data and code, you can also imagine that we have an [instruction cache and a data cache](https://en.wikipedia.org/wiki/Modified_Harvard_architecture#Split-cache_(or_almost-von-Neumann)_architecture), and that we load the instructions into their cache once at the start of the program, and then never invalidate that cache. This works towards #630
- Loading branch information
1 parent
f97ae15
commit 43a9617
Showing
4 changed files
with
34 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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