W08-Check run on existing pipeline implementation
This week task is to continue testing on all the instruction set schematics that I have implemented in the pipeline. I need to make sure the correct instruction is fetch according the to the program counter and later decode and execute it according the instruction fetched. Thus, I need to write assembler codes that contains simple arithmetic operation based on the pseudo opcodes for each instruction sets and compile them to hex file format so that I could test run my current codes.
Based on the MicroBlaze Software Reference Guide, 3 new command I have learnt for the pipeline implementation coding checking. After writing the assembler codes according the pseudo opcodes stated in MicroBlaze Processor References Guide, save and exit, follow by $mb-as logical.s command to compile the assembler codes written earlier. Next, $mb-as objcopy -O ihex a.out a.hex command is used to copy the assembler codes to another object file called a.out and changed to ihex format. The last one will be $mb-objdump -d a.out command that is to dump out (show) the content of the an onject (.o) or an executable (.out) file. In my case, it will list out the content of a.out file. All the register value typed in logical.s file are in hexadecimal whereas it will shows in decimal base when a.out file is listed out. With these 3 commands, I am able to check my coding part by part in a systematic way.
While in the process of checking and debugging, I realized I have did quite a number of careless errors on the codes that are easy to be ignore if without codes testing and checking stage. Thus, codes test run is very important in every single stage of coding.