ceng3420 lab3-3:lc-3bdatapathbyu/ceng3420/2020spring/slides/lab3-3-upd… · ceng3420...

14
CENG3420 Lab 3-3: LC-3b Datapath Wei Li Department of Computer Science and Engineering The Chinese University of Hong Kong [email protected] Spring 2020 1 / 10

Upload: others

Post on 14-Jun-2020

46 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

CENG3420Lab 3-3: LC-3b Datapath

Wei Li

Department of Computer Science and EngineeringThe Chinese University of Hong Kong

[email protected]

Spring 2020

1 / 10

Page 2: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Overview

Introduction

Lab3-3 Assignment

Golden Results

2 / 10

Page 3: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Overview

Introduction

Lab3-3 Assignment

Golden Results

3 / 10

Page 4: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

The Slides are self-contained? NO!

Do please refer to following document:I LC-3b-datapath.pdfI LC-3b-ISA.pdf

3 / 10

Page 5: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

LC-3b Datapath

In lab 3-2, we write data into bus.

4 / 10

Page 6: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

LC-3b Datapath

In this lab, we read data from bus:I NEXT_LATCHES.PC

I NEXT_LATCHES.IR

I NEXT_LATCHES.MAR

I NEXT_LATCHES.N

I NEXT_LATCHES.Z

I NEXT_LATCHES.P

4 / 10

Page 7: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Overview

Introduction

Lab3-3 Assignment

Golden Results

5 / 10

Page 8: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Lab3-3 Assignment 1I Paste your previous codes into eval_bus_drivers() & drive_bus().I Finish the following function.

5 / 10

Page 9: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Lab3-3 Assignment 2: blockPCMUX

int blockPCMUX(int lPCMUX, int lPCAdd2, int lBUS, intlAdder)Special treatment again! The PCMUX selection criteria is different based on your SID

OriglPCMUX = 0: lPCAdd2 or1: lBUS; 2: lAdder;SID with even ending:lPCMUX = 0: lBUS; 1: lPCAdd2; 2: lAdder;

SID with odd ending:lPCMUX = 0: lAdder; 1: lBUS; 2: lPCAdd2;

6 / 10

Page 10: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Overview

Introduction

Lab3-3 Assignment

Golden Results

7 / 10

Page 11: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Assignment Package

I lc3bsim3-3.c, lc3bsim3.h: codes to work onI libems3-3-(darwin/linux).a: libraryI ucode3: FSMI Makefile

I bench: folder with benchmarks

Run the simulator:

1. make, then binary “lc3bsim3-3” is generated2. For even ending SID: ./lc3bsim3-3 ucode3-even bench/toupper.cod

3. For odd ending SID: ./lc3bsim3-3 ucode3-odd bench/toupper.cod

7 / 10

Page 12: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Golden Results – case toupper.cod

I Please refer to Lab 3-1 slides.

8 / 10

Page 13: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Golden Results – case count10.cod

I Please refer to Lab 3-2 slides.

9 / 10

Page 14: CENG3420 Lab3-3:LC-3bDatapathbyu/CENG3420/2020Spring/slides/lab3-3-upd… · CENG3420 Lab3-3:LC-3bDatapath WeiLi DepartmentofComputerScienceandEngineering TheChineseUniversityofHongKong

Thanks. For any question:[email protected]@cse.cuhk.edu.hk

10 / 10