Digital Signal Processing Reference
In-Depth Information
The MIPS program is contained in instruction memory. Instruction memory is
automatically initialized using the program.mif file shown in Figure 14.5. This
initialization only occurs once during download and not at a reset.
For different test programs, the appropriate machine code must be entered in
this file in hex. Note that the memory addresses displayed in the program.mif
file are word addresses while addresses in registers such as the PC are byte
addresses. The byte address is four times the word address since a 32-bit word
contains four bytes. Only word addresses can be used in the *.mif files.
-- MIPS Instruction Memory Initialization File
Depth = 256;
Width = 32;
Address_radix = HEX;
Data_radix = HEX;
Content
Begin
-- Use NOPS for default instruction memory values
[00..FF]: 00000000;
-- nop (sll r0,r0,0)
-- Place MIPS Instructions here
-- Note: memory addresses are in words and not bytes
-- i.e. next location is +1 and not +4
00: 8C020000;
-- lw $2,0 ;memory(00)=55
01: 8C030001;
-- lw $3,1 ;memory(01)=AA
02: 00430820;
-- add $1,$2,$3
03: AC010003;
-- sw $1,3 ;memory(03)=FF
04: 1022FFFF;
-- beq $1,$2,-4
05: 1021FFFA;
-- beq $1,$1,-24
End ;
Figure 14.5 MIPS Program Memory Initialization File, program.mif.
Search WWH ::




Custom Search