숙제 내용 - Memory & Storage Architecture Lab.

Download Report

Transcript 숙제 내용 - Memory & Storage Architecture Lab.

Memory & Storage Architecture Lab.
@ Seoul National University
Computer Architecture
Byoungjun Kim
[email protected]
School of Computer Science and Engineering
Seoul National University
목차
 Sequential Y86 implementation
 설명 : leave instruction 추가하기
 숙제 : iaddl, isubl instruction 추가하기
 Pipelined Y86 implementation
 숙제 : leave, iaddl, isubl instruction 추가하기
 숙제 : load forwarding 추가 구현하기
Memory & Storage Architecture Lab.
@ Seoul National University
 Sequential Y86 implementation
 설명 : leave instruction 추가하기
 숙제 : iaddl, isubl instruction 추가하기
 Pipelined Y86 implementation
 숙제 : leave, iaddl, isubl instruction 추가하기
 숙제 : load forwarding 추가 구현하기
Memory & Storage Architecture Lab.
@ Seoul National University
Configuration
 tar xvf archlab4u.tar
 cd archilab-handout/
 tar xvf sim.tar
 cd sim/
 /archilab/archlab-handout/sim$ make clean; make
Memory & Storage Architecture Lab.
@ Seoul National University
Sequential Y86 implementation
 작업폴더
 /sim/seq
 작업파일
 /sim/seq/seq-full.hcl
Memory & Storage Architecture Lab.
@ Seoul National University
leave instruction
 leave instruction can be used to prepare the stack for returning.
 As described in Section 3.7.2. in textbook.
 It is equivalent to the following code sequence(X86):
1
movl %ebp, %esp
Set stack pointer to beginning of frame
2
popl %ebp
Restore saved %ebp and set stack ptr to end of caller’s frame
 It is equivalent to the following code sequence(Y86):
1
rrmovl %ebp, %esp
Set stack pointer to beginning of frame
2
popl
Restore saved %ebp and set stack ptr to end of caller’s frame
%ebp
Memory & Storage Architecture Lab.
@ Seoul National University
Computation
 (rrmovl %ebp, %esp) 과 (popl %ebp) 이 합쳐진 형태
Memory & Storage Architecture Lab.
@ Seoul National University
Computation
 leave instruction
leave
icode:ifun  M1[PC]
Fetch
valP  PC+1
Decode
Execute
Memory
Write back
valA  R[%ebp]
valB  R[%ebp]
valE  valB + 4
valM  M4[valA]
R[%esp]  valE
R[%ebp]  valM
PC update PC  valP
Memory & Storage Architecture Lab.
@ Seoul National University
Implementation
 Fetch stage &
Memory & Storage Architecture Lab.
@ Seoul National University
Implementation
 Decode & Write-back stage
Memory & Storage Architecture Lab.
@ Seoul National University
Implementation
 Execute stage
Memory & Storage Architecture Lab.
@ Seoul National University
Implementation
 Memory stage
Memory & Storage Architecture Lab.
@ Seoul National University
Implementation
 PC update
Memory & Storage Architecture Lab.
@ Seoul National University
Verification
 구현 확인하기
 구현한 sequential implementation을 사용하는 방법
 /archilab/archlab-handout/sim/seq$ make clean; make ssim VERSION=full
Memory & Storage Architecture Lab.
@ Seoul National University
Verification
 구현 확인하기
 구현 정확성 확인하기
• leave instruction 확인하기 : /archilab/archlab-handout/sim/y86-code/asuml.yo
• 확인 시 실행 파일 : /archilab/archlab-handout/sim/seq/ssim
• /archilab/archlab-handout/sim/seq$ ./ssim –t ../y86-code/asuml.yo
Memory & Storage Architecture Lab.
@ Seoul National University
 Sequential Y86 implementation
 설명 : leave instruction 추가하기
 숙제 : iaddl, isubl instruction 추가하기
 Pipelined Y86 implementation
 숙제 : leave, iaddl, isubl instruction 추가하기
 숙제 : load forwarding 추가 구현하기
Memory & Storage Architecture Lab.
@ Seoul National University
iaddl, isubl instruction 추가하기 숙제
 작업폴더
 /sim/seq
 작업파일
 /sim/seq/seq-full.hcl
Memory & Storage Architecture Lab.
@ Seoul National University
iaddl, isubl instruction
 Computation
 irmovl instruction + OPl instruction
• iaddl V, rB : R[rB]  R[rB] + V
• isubl V, rB : R[rB]  R[rB] - V
Memory & Storage Architecture Lab.
@ Seoul National University
Verification
 구현 확인하기
 구현 정확성 확인하기
• iaddl instruction 확인 파일 : /archilab/archlab-handout/sim/y86-code/asumi.yo
• isubl instruction 확인 파일 : /archilab/archlab-handout/sim/y86-code/asums.yo
• 확인 시 실행 파일 : /archilab/archlab-handout/sim/seq/ssim
 구현 정확성 검증 명령어
• iaddl instruction : /archilab/archlab-handout/sim/seq$ ./ssim –t ../y86-code/asumi.yo
• isubl instruction : /archilab/archlab-handout/sim/seq$ ./ssim –t ../y86-code/asums.yo
Memory & Storage Architecture Lab.
@ Seoul National University
Current state
 iaddl instrunction 검증
 ./ssim –t ../y86-code/asumi.yo
 isubl instruction 검증
 ./ssim –t ../y86-code/asums.yo
Memory & Storage Architecture Lab.
@ Seoul National University
Goal state
 iaddl instrunction 검증
 ./ssim –t ../y86-code/asumi.yo
 isubl instrunction 검증
 ./ssim –t ../y86-code/asums.yo
Memory & Storage Architecture Lab.
@ Seoul National University
 Sequential Y86 implementation
 설명 : leave instruction 추가하기
 숙제 : iaddl, isubl instruction 추가하기
 Pipelined Y86 implementation
 숙제 : leave, iaddl, isubl instruction 추가하기
 숙제 : load forwarding 추가 구현하기
Memory & Storage Architecture Lab.
@ Seoul National University
Pipelined Y86 implementation
 기본 제공 파일
 pipe-std.hcl
• 기본적인 forwarding 구현
 과제
 iaddl, isubl, leave instruction 추가하기
• 작업 폴더 : sim/pipe
• 작업 파일 : pipe-full.hcl ( 미완성 파일 제공 )
 load forwarding 구현 하기
• 작업 폴더 : sim/pipe
• 작업 파일 : pipe-lf.hcl ( 미완성 파일 제공)
Memory & Storage Architecture Lab.
@ Seoul National University
Load forwarding
 Load forwarding
 Condition
• Load instruction의 target register와 바로 뒤의 store instruction의 source register가 같음
• 교재 연습문제 4.57번 참조
• Example sequence
Arithmetic 연산이
필요
Why?
Memory & Storage Architecture Lab.
@ Seoul National University
Verification : pipe-full.hcl
 구현 확인하기
 pipe-full.hcl 사용 하기
• /sim/pipe$ make clean; make VERSION=full
 구현 정확성 확인하기
• leave instruction 확인 파일 : /sim/y86-code/asuml.yo
• iaddl instruction 확인 파일 : /sim/pipe/y86-code/asumi.yo
• isubl instruction 확인 파일 : /sim/pipe/y86-code/asums.yo
• 확인 시 실행 파일 : /sim/pipe/psim
 구현 정확성 검증 명령어
• leave instruction : /sim/pipe$ ./psim –t ../y86-code/asuml.yo
• iaddl instruction : /sim/pipe$ ./psim –t ../y86-code/asumi.yo
• isubl instruction : /sim/pipe$ ./psim –t ../y86-code/asums.yo
Memory & Storage Architecture Lab.
@ Seoul National University
Verification : pipe-lf.hcl
 구현 확인하기
 pipe-lf.hcl 사용 하기
• /sim/pipe$ make clean; make VERSION=lf
 Load forwarding성능 확인하기
• Load forwarding 성능 확인 파일 : /sim/pipe/ldrivers.yo
• 확인 시 실행 파일 : /sim/pipe/psim
 Load forwarding 구현 검증 명령어
• leave instruction : /sim/pipe$ ./psim –t ldrivers.yo
Memory & Storage Architecture Lab.
@ Seoul National University
Current state : pipe-full.hcl
 iaddl instruction 검증
 /sim/pipe$ ./psim –t ../y86-code/asumi.yo
 isubl, leave instruction
 iaddl의 경우와 동일
Memory & Storage Architecture Lab.
@ Seoul National University
Goal state
asumi.yo
asuml.yo
asums.yo
Memory & Storage Architecture Lab.
@ Seoul National University
Current state : pipe-lf.hcl
 pipe-std.hcl을 사용했을 때
 make clean; make VERSION=std
 ./psim –t ldriver.yo
Memory & Storage Architecture Lab.
@ Seoul National University
Goal state : pipe-lf.hcl
 Load forwarding 구현 후
 make clean; make VERSION=lf
 ./psim –t ldriver.yo
Memory & Storage Architecture Lab.
@ Seoul National University
보고서 제출
 숙제에 대한 보고서
 각각에 대해 바꾼 부분에 대한 설명
• seq-full.hcl, pipe-full.hcl, pipe-lf.hcl
 결과 출력 화면
 어려웠던 점 / 해결 방법
 프로젝트를 진행하며 느낀 점
Memory & Storage Architecture Lab.
@ Seoul National University
제출 방법
 과제 확인
 제출 기한
• 12월 3일 수요일 자정 전(pm 23:59)까지
• 1일 delay 당 5점씩 감점 (100점 만점)
• 제출 기한 2일 후까지 제출 가능
- 12월 5일 금요일 자정 전(pm 23:59)
 제출 방법
• 조교 메일을 통해 제출
• 메일 제목 : [컴구 과제]학번_이름
- ex)[컴구 과제]200510000_김병준
• 첨부 파일 : 학번_이름.zip으로 아래 파일들과 보고서를 함께 제출
- 소스 코드 : seq-full.hcl, pipe-full.hcl, pipe-lf.hcl
- 보고서 : 한글/워드 중 택하여 학번_이름을 제목으로 함
• 메일 주소 : [email protected]
Memory & Storage Architecture Lab.
@ Seoul National University