Commit graph

7 commits

Author SHA1 Message Date
Graham Edgecombe
b73a0155dd Swap byte order in the ram module
Although the processor uses little-endian addressing, the memory bus
itself is big-endian. (This simplifies the implementation of
memory-mapped registers.)

However, this does mean the contents of the RAM need to be in big-endian
order, rather than little-endian order. $readmemh does not provide any
control over byte order, so we previously swapped the byte order of
progmem.hex with srec_cat in the Makefile.

This commit changes the ram module to swap the byte order upon
reading/writing. This removes the need to use srec_cat in the Makefile.
Swapping the byte order in hardware shouldn't cause any performance
impact as it just involves re-arranging wires.
2017-12-26 14:15:12 +00:00
Graham Edgecombe
9b1e27cc0d Combine the instruction and data buses 2017-12-25 23:33:53 +00:00
Graham Edgecombe
04dc25c5dc Merge memory bus inputs/outputs in the port list
I don't think the control/data in/out split makes as much sense - it's
a convention much better suited to the pipeline stages.
2017-12-12 21:15:11 +00:00
Graham Edgecombe
22bce1bdeb Fix compatibility with iverilog
This commit:

 * changes the type of all output variables to logic
 * splits variable declaration and assignment
 * declares variables before modules that use the variables
2017-12-09 21:03:45 +00:00
Graham Edgecombe
0be0da3917 Add memory address decoding 2017-12-07 22:37:58 +00:00
Graham Edgecombe
281009a64c Increase size of data RAM to 8 KB 2017-12-07 22:37:58 +00:00
Graham Edgecombe
018faac560 Add memory bus and move data memory to a separate module 2017-12-07 22:37:58 +00:00