Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lab 4: MSP430 Microarchitecture

Similar presentations


Presentation on theme: "Lab 4: MSP430 Microarchitecture"— Presentation transcript:

1 Lab 4: MSP430 Microarchitecture
MSP430 Microarchitecture Simulator: Use the MSP430 Microarchitecture Simulator to create a Finite State Machine that implements the Texas Instruments MSP430 ISA. Create states that fetch, decode, evaluate source, evaluate destination, execute, and store MSP430 instructions and operands. Execute a program that displays an incrementing counter in the simulator LEDs. Learning Objectives: After completing the Microarchitecture Lab, students will be able to: Implement a MSP430 ISA microarchitecture that executes computer instructions. Explain how a computer is a Finite State Machine. List 7 ways operands are accessed by a computer instruction. Use multiplexors, decoders, drivers, ALUs, and registers to move and store data within a computer. Explain the functions of the program counter, stack pointer, and condition code registers. Summarize the difference between clock cycles and instruction steps. BYU CS 224 Lab 4 - Microarchitecture Lab

2 Microarchitecture Simulator
MSP430 Microarchitecture Microarchitecture Simulator Simulator buttons: Run: Generate continuous clocks Step: Generate continuous clocks until next Fetch, Clock 1 state. Clock: Generate one clock. Back: Backup one clock state. Current State: Current instruction execution state. Next State: Next instruction state after a clock. Reset: Reset FSM Control, registers, memory, clocks, and instructions. Restart: Restarts current simulation. Quit: Exit MicroArch Simulator. Load Control: Read FSM control from a file. Save Control: Save current control to a file. Load Memory: Loads the currently selected program into memory. Analyze FSM: Outputs and analysis of the FSM Control in the Notes window. Please note: Save learned FSM Control after each instruction in a new file! BYU CS 224 Lab 4 - Microarchitecture Lab

3 Lab 4 - Microarchitecture Lab
MSP430 Microarchitecture Lab 4 Machine Code ;************************************************************** ; MSP430 Micro-Architecture Simulator Code ; ; Description: Display an incrementing counter in LEDs. .cdecls C,"msp430.h" .text 8000: RESET: mov.w #0x0300,SP ; Init stack pointer 8004: 40b2 5a mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT 800a: d0f2 000f 001E bis.b #0x0f,&P4DIR ; Set P1.0-3 output 8010: 430e mov.w #0,r14 8012: 4ec2 001D loop: mov.b r14,&P4OUT ; output P1.0-3 8016: 531e add.w #1,r14 8018: f03e 000f and.w #0x000f,r ; mask counter 801c: 401f mov.w delay,r ; Delay to R15 8020: 120f push r15 8022: wait: sub.w #1,0(sp) ; decrement delay count 8026: 23fd jne wait ; delay over? 8028: 41ef mov.w @sp+,r ; y 802a: 3ff jmp loop ; repeat 802c: delay: .word 2 .sect ".reset" ; MSP430 RESET Vector .word RESET ; NMI .end BYU CS 224 Lab 4 - Microarchitecture Lab

4 MSP430 Microarchitecture Simulator
BYU CS 224 Lab 4 - Microarchitecture Lab

5 Lab 4 - Microarchitecture Lab
MSP430 Microarchitecture Pass-off This lab is worth 10 points as follows: 1 point Your micro-architecture simulator executes the first instruction ("mov.w #0x0600,SP") correctly as outlined in the tutorial - a 2 word instruction with an immediate mode source operand and a register mode destination operand. 1 point Your micro-architecture simulator executes the second instruction ("mov.w #0x5a80,&WDTCTL") correctly - a three word instruction requiring three memory accesses with an absolute mode destination operand. 1 point Your micro-architecture simulator executes the third ("bis.b #0x000f,&P4DIR") and fourth ("mov.w #0,r14") instructions correctly - the fourth being an emulated instruction that uses the CG2 Constant Generator for the source operand and register mode for the destination operand. BYU CS 224 Lab 4 - Microarchitecture Lab

6 Lab 4 - Microarchitecture Lab
MSP430 Microarchitecture Pass-off 1 point Your micro-architecture simulator executes the fifth instruction ("mov.b r14,&P4OUT") correctly - a two word instruction writing a register to memory. 1 point Your micro-architecture simulator executes the sixth instruction ("add.w #1,r14") correctly - another double operand emulated instruction that uses the Constant Generator CG2 for the source operand. 1 point Your micro-architecture simulator executes the seventh ("and.w #0x000f,r14") and eighth ("mov.w Delay,r15") instructions correctly - the latter requiring a PC-Relative mode for the source operand. 1 point Your micro-architecture simulator executes the ninth ("push.w r15") instruction correctly - a single operand instruction that requires the EXECUTE phase. BYU CS 224 Lab 4 - Microarchitecture Lab

7 Lab 4 - Microarchitecture Lab
MSP430 Microarchitecture Pass-off 1 point Your micro-architecture simulator executes the tenth ("sub.w #1,0x0000(SP)") instruction correctly - an emulated instruction that uses an indexed register mode for the destination operand. 1 point Your micro-architecture simulator executes the eleventh ("jne (L1)") instruction correctly - a PC-Relative jump format that does not require a source nor destination phase. 1 point Finally, your micro-architecture simulator executes the twelfth ("pop.w r15") and thirteenth ("jmp (Mainloop)") instructions correctly - the former instruction's source operand is obtained using the indexed auto-increment addressing mode BYU CS 224 Lab 4 - Microarchitecture Lab

8 Lab 4 - Microarchitecture Lab
MSP430 Microarchitecture Bonus In addition to the above points, the following bonus / deductions apply: +1 point Passed off with a TA at least one day early. (Note: labs completed in a previous semester do NOT qualify for the early pass-off bonus.) +1 point Your MSP430 micro-architecture implementation is able to turn on all four LEDs at the same time (170 instructions) in less than 919 clocks. +2 points Your MSP430 microarchitecture implementation is able execute the Bonus program and turn on all four LEDs at the same time (97 instructions) in 544 or less clocks. -1 point For each school day late. (Timestamps may be used to verify completion time.) BYU CS 224 Lab 4 - Microarchitecture Lab


Download ppt "Lab 4: MSP430 Microarchitecture"

Similar presentations


Ads by Google