Pico CPU: Pico-Memory Unit

figure 1
Addressing Modes
Our Pico-CPU will only support immediate addressing meaning we will directly use the memory address which we would like to use in our instruction. This constraint has an impact on our memory size. If our address should fit in one instruction, it means that our address is bounded in 8bits. In other terms, we can at most address 256 memory spaces (0 to 255).Testing Memory System
To test the Memory system we start reading data from a file into the memory in the first phase, and then read it back from memory and write to a file. In the end we have to check if these two files contain identical data. Our test setup should look like figure 2.
figure 2
Hints on VHDL file handeling
To read from a file in VHDL you have to first declare the input file and open it with the following commands:file InputFile : text;
file_open(InputFile, "Input_File.txt",
read_mode);
variable LINEVARIABLE : line;
readline(InputFile, LINEVARIABLE);
file OutputFile : text;
file_open(OutputFile, "Output_File.txt", write_mode);
writeline(OutputFile, LINEVARIABLE);
write(LINEVARIABLE, Signal_1, Signal_2,..., Signal_N);
Related Readings