학습목표 - koreatech사용하지않는architecture 4를이용하여compile 해야한다. ......
TRANSCRIPT
![Page 1: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/1.jpg)
학습목표
• HW/SW codesign에 대한 기본 개념을 실습을 통해 익힌다.
• ARM ADS를 이용하여 JPEG 예제를 수행하고 분석해본다. 이를통해 HW 수행에 적합한 task가 어떤 것인지 찾아본다.
• HDL을 이용하여 직접 HW 블록을 설계해본다.
• HDL을 이용하여 직접 버스와 HW 블록을 연결하는 wrapper를설계해본다.
• 직접 설계한 모듈을 ModelSim을 이용해 simulation해 보고, 사용법을 익힌다.
• 간단한 SoC를 구성하기 위해 여러 모듈들을 integration하고실제 simulation해 봄으로써, codesign에 따른 성능 향상을확인한다.
![Page 2: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/2.jpg)
강의자료 활용 Guideline
• JPEG 이외에 다른 여러 가지 예제들을 이용하는 실습을 하는 것도 좋다.
• 프로파일의 결과에 따라 꼭 computation intensive한 task를 HW로 보낼 필요는 없다. 상황에 따라, 즉 HW module의 reuse나 설계 용이성 등에 따라, HW로 보낼 task를 설계자가 결정할 수 있다.
• 통신 방식은 polling, interrupt 등 다양하게 사용될 수 있다.
• 통신의 양에 따라서 때로는 codesign한 결과가 처음보다 나쁘게나올 수 있으므로 double buffering, task level pipelining 등 성능 향상을 위한 다양한 기법을 적용하는 것도 좋다.
• Simulation 도구의 버전에 따라서 다른 결과를 나타낼 수도 있다. ModelSim은 6.2a를 ADS는 1.2를 사용할 것을 권장한다. 만약arm compiler가 RealView로 되어있을 경우에는 thumb 모드를사용하지 않는 architecture 4를 이용하여 compile 해야 한다.
![Page 3: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/3.jpg)
Contents
1. Overview
2. ADS를 이용한 JPEG encoder profiling
3. HDL을 이용한 HW IP 설계 (VHDL or verilog)
4. ModelSim을 이용한 RTL simulation 실습
5. AHB slave 인터페이스를 만족하는 wrapper 설계
6. Codesign에 따른 성능비교
![Page 4: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/4.jpg)
Overview
• Final architecture (Simple SoC)
– Codesign에 따른 성능비교• ARM7 프로세서만을 이용한 JPEG encoder 수행• ARM7 프로세서와 Quantize, Zigzag HW 블록을 이용한 JPEG encoder 수행
ARM7tdmi-s
Quantize& Zigzag(HW IP)
ROM RAM
wrapper
UARTGPIO
AMBA AHB bus
![Page 5: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/5.jpg)
Contents
1. Overview
2. ADS를 이용한 JPEG encoder profiling
3. HDL을 이용한 HW IP 설계 (VHDL or verilog)
4. ModelSim을 이용한 RTL simulation 실습
5. AHB slave 인터페이스를 만족하는 wrapper 설계
6. Codesign에 따른 성능비교
![Page 6: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/6.jpg)
About the ADS
• ADS consists of a suite of applications, together with supporting documentation and examples, that enable you to write and debug applications for the ARM family of RISC processors.
• You can use ADS to develop, build, and debug C, C++, or ARM assembly language programs
![Page 7: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/7.jpg)
Components of ADS
• Command-line development tools
– armcc, armcpp, armasm, armlink, armsd
• GUI development tools
– AXD, CodeWarrior IDE
• Utilities
– fromELF, armprof
• Supporting software.
– ARMulator
• Documentation
– http://www.arm.com
![Page 8: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/8.jpg)
Objective
• Using ADS tool
• Profiling JPEG encoder code
– Our JPEG encoder 구성
ReadBmp ChenDCT Quantize Zigzag HuffEncode
“bmp” image source “jpg” compressed image
![Page 9: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/9.jpg)
About JPEG encoder
Bmp image
88 Preshift
DCT
Bound
Quantize
Zigzag
Encoding
8
8jpg format
![Page 10: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/10.jpg)
Using Code Warrior (1)
• STEP 1
– new project
• file->new project
![Page 11: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/11.jpg)
Using Code Warrior (2)
• STEP 2
– Add Files
• Copy jpeg.c file to project folder
• Add jpeg.c (mouse right click on the project background)
![Page 12: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/12.jpg)
Using Code Warrior (3)
• STEP 3
– DebugRel setting
![Page 13: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/13.jpg)
Using Code Warrior (4)
• STEP 4
– Target settings
![Page 14: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/14.jpg)
Using Code Warrior (5)
• STEP 5
– ARM Assembler setting
![Page 15: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/15.jpg)
Using Code Warrior (6)
• STEP 6
– Arm C compiler setting
![Page 16: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/16.jpg)
Using Code Warrior (7)
• STEP 7
– ARM C compiler optimization level setting
![Page 17: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/17.jpg)
Using Code Warrior (8)
• STEP 8
– Other compiler setting
• ARM C++ compiler, Thumb C compiler, Thumb C++ compiler
![Page 18: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/18.jpg)
Using Code Warrior (9)
• STEP 9
– ARM Linker Setting (output)
![Page 19: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/19.jpg)
Using Code Warrior (10)
• STEP 10
– MAKE ALL
– Launch AXD debugger
![Page 20: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/20.jpg)
Using AXD (1)
• STEP 11
– Load Image with profiling on
![Page 21: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/21.jpg)
Using AXD (2)
• STEP 12
– Profiling setting
![Page 22: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/22.jpg)
Using AXD (3)
• STEP 13
– Run simulation until “_sys_exit”
– Write profiling data
![Page 23: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/23.jpg)
Using AXD (4)
• STEP 14
– Run “armprof jpeg.prf > jpeg_profile_result.txt” command
![Page 24: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/24.jpg)
Contents
1. Overview
2. ADS를 이용한 JPEG encoder profiling
3. HDL을 이용한 HW IP 설계 (VHDL or verilog)
4. ModelSim을 이용한 RTL simulation 실습
5. AHB slave 인터페이스를 만족하는 wrapper 설계
6. Codesign에 따른 성능비교
![Page 25: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/25.jpg)
HW IP design using HDL
• Design the HW IP in HDL (VHDL)
– Modify reference code– Design quantize block– Design zigzag block
![Page 26: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/26.jpg)
Modify SW code (1)
• Reference C code
Quantize(int *matrix, int *qmatrix){
int i, m, q;for (i=0; i<BLOCKSIZE; i++){
m = matrix[i]; q = qmatrix[i];if (m>0)
matrix[i] = (m+q/2)/q;else
matrix[i] = (m-q/2)/q;}
}
Designing divider? It’s too slow and hard!
Other solution Designing shifter
![Page 27: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/27.jpg)
Modify SW code (2)
• Replace divider with shifter
Quantize(int *matrix, int *qmatrix){
int i, m, q;for (i=0; i<BLOCKSIZE; i++){
m = matrix[i]; q = qmatrix[i];d = qdiv[i];if (m>0)
matrix[i] = (m+(q>>1))>>delse
matrix[i] = -((-m+(q>>1))>>d);}
}
![Page 28: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/28.jpg)
Modify SW code (3)
• Quantization matrix Shift adapted Quantization matrix
#define BLOCKSIZE 64//#define QuantizationMatrix LuminanceQuantization#define QuantizationMatrix ShitfAdaptedQuantization
![Page 29: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/29.jpg)
Modify SW code (4)
• Launch AXD with modified code
![Page 30: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/30.jpg)
Design the Quantize and Zigzag block in HDL
• Design the Quantize and Zigzag block in HDL
HW_IP
godone
inData(31:0)outData(31:0)
<Pseudo Code>
If (go=‘1’) thenDoBehavior()done <= ‘1’;
end if;
DoBehavior(){
Read data from inData memoryDo quantize with shifterDo zigzagWrite data to outData memory
}
writeEnableAddr(6:0)
resetclock
![Page 31: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/31.jpg)
Contents
1. Overview
2. ADS를 이용한 JPEG encoder profiling
3. HDL을 이용한 HW IP 설계 (VHDL or verilog)
4. ModelSim을 이용한 RTL simulation 실습
5. AHB slave 인터페이스를 만족하는 wrapper 설계
6. Codesign에 따른 성능비교
![Page 32: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/32.jpg)
Using ModelSim
• STEP 1
– File->New->Project
![Page 33: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/33.jpg)
Using ModelSim
• STEP 2
– Add source codes to the project
![Page 34: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/34.jpg)
Using ModelSim
• STEP 3
– Complete the quantize.vhd file
![Page 35: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/35.jpg)
Using ModelSim
• STEP 4
– Compile all the HDL codes in order.
![Page 36: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/36.jpg)
Using ModelSim
• STEP 5
– Simulate the tb (provided testbench) and verify the module
![Page 37: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/37.jpg)
Using ModelSim
• STEP 6
– Add the signal to wave view to debugging
![Page 38: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/38.jpg)
Using ModelSim
• STEP 7
– Run the simulation
![Page 39: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/39.jpg)
Using ModelSim
• STEP 8
– Verify that the code runs correctly
![Page 40: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/40.jpg)
Contents
1. Overview
2. ADS를 이용한 JPEG encoder profiling
3. HDL을 이용한 HW IP 설계 (VHDL or verilog)
4. ModelSim을 이용한 RTL simulation 실습
5. AHB slave 인터페이스를 만족하는 wrapper 설계
6. Codesign에 따른 성능비교
![Page 41: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/41.jpg)
AHB Slave Interface
•
![Page 42: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/42.jpg)
AHB Decoder
•
![Page 43: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/43.jpg)
AHB Timing
•
![Page 44: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/44.jpg)
Response Type
HRESP[1:0] Response Description00 OKAY Transaction Completed
01 ERROR Error Occurs
10 RETRY Transaction Not Completed
Master Must Retry
11 SPLIT Transaction Not Completed
Master Must Retry
Slave Informs Completion
ERROR/RETRY/SPLIT: two cycle response
![Page 45: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/45.jpg)
Burst Mode
HBURST[2:0] Type Description000 SINGLE Single transfer
001 INCR Incrementing burst of unspecified length
010 WRAP4 4-beat wrapping burst
100 WRAP8 8-beat wrapping burst
011 INCR4 4-beat incrementing burst
101 INCR8 8-beat incrementing burst
110 WRAP16 16-beat wrapping burst
111 INCR16 16-beat incrementing burst
![Page 46: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/46.jpg)
Transfer Type
HTRANS[1:0] Type Description00 IDLE No data transfer required
Requires zero wait state OKAY response
01 BUSY Same as IDLE between burst transfers
Address/Control unrelated previous
10 NONSEQ Single transfer or the first of a burst
to the previous transfer
11 SEQ Remaining transfers in a burst
Address/control related
to the previous transfer
![Page 47: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/47.jpg)
Transfer Size
HSIZE[2:0] Size Description000 8 bits Byte
001 16 bits Halfword
010 32 bits Word
100 128 bits 4-word line
011 64 bits -
101 256 bits 8-word line
110 512 bits -
111 1024 bits -
![Page 48: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/48.jpg)
AHB HW wrapper design
• AMBA AHB의 slave interface와 quantize block 사이의 wrapper 설계
go
AHBwrapper
Quantizeblock
done
writeEnableaddr(6:0)
inData(31:0)outData(31:0)
AHB slave interface
![Page 49: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/49.jpg)
Wrapper diagram for AHB slave interface
D Q
En
hselhwritehtranshaddr
write
go
done
address
wdata
haddr(9:8)
rdata
haddr(8:2)
hsel and htrans(1) and hwrite and not(haddr(9))
hready
hwdata
hrdata
![Page 50: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/50.jpg)
Contents
1. Overview
2. ADS를 이용한 JPEG encoder profiling
3. HDL을 이용한 HW IP 설계 (VHDL or verilog)
4. ModelSim을 이용한 RTL simulation 실습
5. AHB slave 인터페이스를 만족하는 wrapper 설계
6. Codesign에 따른 성능비교
![Page 51: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/51.jpg)
HW/SW codesign
• 설계된 wrapper와 HW block을 프로세서에 연결하여 통합 검증
– 주어지는 ARM7tdmi-s 프로세서 모델을 사용하여 HW/SW Co-Simulation을 수행
• Goal : Compare two models
– Pure SW JPEG
– Modified SW JPEG and HW module (Quantize and Zigzag)
![Page 52: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/52.jpg)
HW/SW codesign
• Our simple SoC platform
ARM7tdmi-s
Quantize& Zigzag(HW IP)
ROM RAM
wrapper
UARTGPIO
AMBA AHB bus
Module name ID Base memory map
ROM (0)
(1)
UART (2) 0x20000000
(3)
HWIP (4) 0x40000000
0x00000000
RAM 0x10000000
GPIO 0x30000000
![Page 53: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/53.jpg)
Target I – SW only
• AXD simulation
– Do ‘make’ command with given ‘jpeg.c’ file• Directory $SRCS/testDALRisc/sw
• ‘main’ function is replaced with ‘C_Entry’ function– ‘boot.s’ contains initialize and jump instruction to ‘C_Entry’
– Launch AXD with compiled ‘jpeg.axf’ file
![Page 54: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/54.jpg)
Target I – SW only
• ModelSim simulation
– Steps• open project “dalrisc.mpf” (directory $SRCS/testDALRisc/modelsim)
• vsim work.tb
• mem load –i D:/works/dalrisc/sw/jpeg.mem /tb/uut/rom/memarr
• add waves
• run 104 ms
![Page 55: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/55.jpg)
Target I – SW only
• Dump memory
– Steps
• export memory (GUI command)
– Final result will be stored on variable ‘ofp’
– The address range of ‘ofp’ 0x98b ~ 0xb09
• ./hex2bin dumped.mem dumped.jpg
– This command converts dumped hex data to jpeg file.
![Page 56: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/56.jpg)
Target II – HW/SW codesign
• Modify JPEG SW code
– Synchronization method : polling
extern void waitFlag(int *flag);
HWPollingQuantizeNZigzag(int *input, int *output){
int *indata = (int*)0x40000000;int *outData = (int*)0x40000100;int *go = (int*)0x40000200;int *done = (int*)0x40000300;int i;
for (i=0; i<BLOCKSIZE; i++)*(inData+i) = input[i];
*go = 1;waitFlag(done);for (i=0; i<BLOCKSIZE; i++)
output[i] = *(outData+i);}
![Page 57: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/57.jpg)
Target II – HW/SW codesign
• Compile and link modified SW code
– Cygwin make environment
• armasm –cpu arm7tdmi-s boot.s
• armasm –cpu arm7tdmi-s waitFlag.s
• armcc –cpu arm7tdmi-s -g -c –O2 jpeg_quant.c
• armlink –o jpeg_quant.axf –ro-base 0x0 –rw-base 0x10000000 –map –symbols –info Sizes –first boot.o boot.o waitFlag.o jpeg_quant.o –list jpeg_quant.info
• fromelf jpeg_quant.axf –bin –output jpeg_quant.bin
• ./bin2hex jpeg_quant.bin jpeg_quant.mem
![Page 58: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/58.jpg)
Target II – HW/SW codesign
• ModelSim simulation
– Steps• Open project – “dalrisc.mpf”• Add your HW IP (ahbquantize.vhd, etc …)• Modify “Top_module.vhd” file
Replace “dummy” to “ahbquant” module
![Page 59: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/59.jpg)
Target II – HW/SW codesign
• ModelSim simulation
– Steps (cont’d)
• compile uploaded codes
• vsim work.tb
• mem load –i D:/works/dalrisc/sw/jpeg_quant.mem /tb/uut/rom/memarr
• run 98 ms
• Dump memory• mem save ...
![Page 60: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/60.jpg)
Target II – HW/SW codesign
• ModelSim simulation
– Debugging
• compile modified codes
• restart -f
• mem load –i D:/works/dalrisc/sw/jpeg_quant.mem /tb/uut/rom/memarr
• add waves that you want to see...
• break at which you want to see...
• run -all
![Page 61: 학습목표 - KOREATECH사용하지않는architecture 4를이용하여compile 해야한다. ... build, and debug C, C++, or ARM assembly language programs. Components of ADS • Command-line](https://reader033.vdocuments.net/reader033/viewer/2022042916/5f55ceb141ad0f18b070b73c/html5/thumbnails/61.jpg)
Summary
• Analysis and compare the result
– Total SW time: 2,581,050 cycles (1 cycle = 40 ns)
– Iteration Number: 180
– Pure SW design (339,547 cycles)
– HW/SW codesign (138,420 cycles)
Module name SW time(cycles)
SW 1 iteration time (cycles)
Total communication
1 iteration communication
Quantize 250,104
149,443
01,389
830 0
0
Zigzag 0
Module name HW time(cycles)
HW 1 iteration time (cycles)
Total communication
1 iteration communication
Quantize 11,700
0
126,72065
0 0
704
Zigzag 0