한국기술교육대학교...
Transcript of 한국기술교육대학교...
한국기술교육대학교장영조
한국기술교육대학교 전기전자통신공학부 2
본 슬라이드의 내용은 http://www.altera.com을 참조하였습니다.
1. FPGA 개념2. FPGA 구조3. FPGA 컨피겨레이션4. FPGA 메모리 설계
한국기술교육대학교 전기전자통신공학부 3
Altera Cyclone IV (SRAM type) 컨피겨레이션 scheme Active Serial (AS) – Serial configuration memory 사용 Active Parallel (AP) – Flash memory 지원 Passive Serial (PS) – download cable, 플래시 메모리를 가진 외부host JTAG – download cable, 플래시 메모리를 가진 외부host
Configuration data 크기 압축된 형태로 저장 가능 – 35~55% 크기 절약
Cyclone IV EUncompressed
데이터크기(bits)
EP4CE6 2,944,088
EP4CE30 9,534,304
EP4CE55 14,889,560
EP4CE115 28,571,696
한국기술교육대학교 전기전자통신공학부 4
AS 컨피겨레이션 4 pin interface
- Serial clock input : DCLK- Serial data output : DATA- Active low chip select : nCS- AS dada input : ASDI
단일 FPGA
다중 FPGA
한국기술교육대학교 전기전자통신공학부 5
PS 컨피겨레이션 연결도 PC등의 호스트가 configuration 제어
단일 FPGA
다중 FPGA
한국기술교육대학교 전기전자통신공학부 6
JTAG 컨피겨레이션 연결도 JTAG (Joint Test Action Group)- 1985, PCB의 design 검증과 testing에
대한 방법 개발- 4 pin interface : TDI, TDO, TMS, TCK
USB Blaster cable 사용 - .sof 파일 사용
단일 FPGA
한국기술교육대학교 전기전자통신공학부 7
SRAM object file (.sof) : USBBlaster/ByteBlaster를 사용하는 PS 및JTAG 컨피겨레이션
Programming Object File (.pof) : EPC 소자에 다운로드 Serial Bitstream File (.sbf) : BitBlaster를 사용하는 PS 컨피겨레이션 Hexadecimal (Intel format) File (.hex) :
third party ROM 프로그래머, PPS, PPA 모드, parallel EPROM 쿼터스 툴에서 기본적으로 프로젝트
의 ../output_files/project_name.sof 파일 생성
Download cable : ByteBlasterMV, ByteBlaster, USBBlaster PC에 10핀으로 연결되어 FPGA를 PS 방식으로 프로그래밍
한국기술교육대학교 전기전자통신공학부 8
RAM 임베디드 메모리 블록, M9K를 사용한 메모리 설계 쿼터스 툴의 라이브러리 함수 사용 ROM, RAM, FIFO 등 설계
Megawizard manager- memorycompiler-RAM 1port
RAM의 주소, 입출력 데이터 크기 설정
메가 함수, 출력형태, 파일이름 설정
한국기술교육대학교 전기전자통신공학부 9
출력 레지스터 사용 설정 Write 동작 중 Reading발생시 값
한국기술교육대학교 전기전자통신공학부 10
EDA 툴과의 인터페이스 메모리의 초기 정보 파일 설정
- 파일 사용시는.mif (memory initialization file)
혹은 .hex 파일 형태 사용
한국기술교육대학교 전기전자통신공학부 11
RAM megafunction에서 생성되는파일 종류
스키매틱 편집기에 생성된 ram1 심볼 호출
ram1.v : Verilog fileram1.bsf : 회로 심볼 파일
한국기술교육대학교 전기전자통신공학부 12
module ram1 ( address, clock, data, wren,q);input [7:0] address;input clock;input [9:0] data;input wren;output [9:0] q;wire [9:0] sub_wire0;wire [9:0] q = sub_wire0[9:0];altsyncram altsyncram_component (
.address_a (address), .clock0 (clock), .data_a (data),
.wren_a (wren), .q_a (sub_wire0), .aclr0 (1'b0),
.aclr1 (1'b0), .address_b (1'b1) , .addressstall_a (1'b0),
.addressstall_b (1'b0), .byteena_a (1'b1), .byteena_b (1'b1),
.clock1 (1'b1), .clocken0 (1'b1), .clocken1 (1'b1),
.clocken2 (1'b1), .clocken3 (1'b1), .data_b (1'b1),
.eccstatus (), .q_b (), .rden_a (1'b1), .rden_b (1'b1), .wren_b (1'b0));defparam
altsyncram_component.clock_enable_input_a = "BYPASS",altsyncram_component.clock_enable_output_a = "BYPASS",altsyncram_component.intended_device_family = "Cyclone IV E",altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=NO",altsyncram_component.lpm_type = "altsyncram",altsyncram_component.numwords_a = 256,altsyncram_component.operation_mode = "SINGLE_PORT",altsyncram_component.outdata_aclr_a = "NONE",altsyncram_component.outdata_reg_a = "UNREGISTERED",altsyncram_component.power_up_uninitialized = "TRUE",altsyncram_component.read_during_write_mode_port_a = "NEW_DATA_NO_NBE_READ",altsyncram_component.widthad_a = 8,altsyncram_component.width_a = 10,altsyncram_component.width_byteena_a = 1;
endmodule
생성된 Verilog 파일 ram1.v 설계에서 프로젝트에 포함하여 사용
한국기술교육대학교 전기전자통신공학부 13
Megawizard manager- memorycompiler-ROM 1port
ROM의 주소, 입출력 데이터 크기 설정
메가함수, 생성 출력 형태, 파일이름 설정
한국기술교육대학교 전기전자통신공학부 14
주소, 입출력 포트의 레지스터사용 설정
메모리의 초기 정보 파일 설정
.mif (memory initialization file) 혹은 .hex 파일 형태 사용
한국기술교육대학교 전기전자통신공학부 15
.메모리의 안정된 동작을 위해서는 주소에 레지스터를 사용하도록 설정되어있다. 출력 레지스터는 선택적
ROM megafunction에서 생성되는파일 종류
스키매틱 편집기에 생성된 rom1 심볼 호출
rom1.v : Verilog filerom1.bsf : 회로 심볼 파일
한국기술교육대학교 전기전자통신공학부 16
module rom1 ( address, clock, q);input [6:0] address;input clock;output [9:0] q;wire [9:0] sub_wire0;wire [9:0] q = sub_wire0[9:0];altsyncram altsyncram_component (
.address_a (address), .clock0 (clock), .q_a (sub_wire0),
.aclr0 (1'b0),.aclr1 (1'b0),.address_b (1'b1),
.addressstall_a (1'b0),.addressstall_b (1'b0),.byteena_a (1'b1),
.byteena_b (1'b1),.clock1 (1'b1),.clocken0 (1'b1),
.clocken1 (1'b1), clocken2 (1'b1),.clocken3 (1'b1),
.data_a ({10{1'b1}}),.data_b (1'b1),.eccstatus (),
.q_b (),.rden_a (1'b1),.rden_b (1'b1),.wren_a (1'b0), .wren_b (1'b0));defparam
altsyncram_component.address_aclr_a = "NONE",altsyncram_component.clock_enable_input_a = "BYPASS",altsyncram_component.clock_enable_output_a = "BYPASS",altsyncram_component.init_file = "rom1_data.mif",altsyncram_component.intended_device_family = "Cyclone IV E",altsyncram_component.lpm_hint = "ENABLE_RUNTIME_MOD=NO",altsyncram_component.lpm_type = "altsyncram",altsyncram_component.numwords_a = 128,altsyncram_component.operation_mode = "ROM",altsyncram_component.outdata_aclr_a = "NONE",altsyncram_component.outdata_reg_a = "CLOCK0",altsyncram_component.widthad_a = 7,altsyncram_component.width_a = 10,altsyncram_component.width_byteena_a = 1;
endmodule
생성된 rom1.v Verilog 파일 설계에서 사용
한국기술교육대학교 전기전자통신공학부 17
depth = 128;
width = 10;
address_radix = dec;
data_radix = hex;
content
begin
0: 222;
1: 001;
2: 002;
3: 003;
4: 004;
5: 005;
6: 006;
7: 007;
8: 008;
9: 009;
10: 1A0;
11: 111;
12: 112;
13: 213;
14: 214;
15: 315;
16: 316;
17: 317;
18: 318;
19: 019;
20: 020;
21: 021;
[22..26]: 3FF;
27: 3F7;
28: 3F8;
[29..126]:3F0;
127:3FA;
end;
mif 파일 형식
depth : 주소 최대 크기width : 데이터 비트address radix : 주소 표현 basedata radix : 데이터 표현 baseradix 종류 : bin, oct, hex, uns (양의 정수), dec(부호있는 정수)
저장될 데이터 내용1: 001 1번지에 001 데이터 저장[22..26]:3FF 22~26번지에 모두 3FF
• 이와 같은 형태로 파일을 텍스트 편집기를 사용하여 편집하고 rom1_data.mif 와 같은 이름으로 저장
• mif 파일은 쿼터스에서 컴파일 후 파일 열기로 읽어와서 재 편집 가능
한국기술교육대학교 전기전자통신공학부 18
쿼터스 툴에서 mif 파일 생성
(1) 메뉴 (2) 워드수,크기설정 (3) 데이터편집
한국기술교육대학교 전기전자통신공학부 19
쿼터스 툴에서 mif 파일 생성
(4) 저장된 파일 열기및 재편집 가능
한국기술교육대학교 전기전자통신공학부 20
ram1과 rom1을 스키매틱 생성기에서 호출하여다음 회로 완성 : mem.bdf로 저장
한국기술교육대학교 전기전자통신공학부 21
카운터 cntN은 메모리의 주소 생성. Verilog 파일로 저장한뒤 File > “Create Symbol Files for Current File”로 심볼파일 생성한 후 스키매틱 편집기에 추가
회로 동작 : rom1에 저장된 내용(rom1_data.mif)을 ram1에 쓰게한 후ram1의 출력 (ram_out)으로 읽어내게 한다. 카운터는 메모리의 주소 생성
mem.bdf를 컴파일하고 report 파일 : 사용한 메모리 양 확인
한국기술교육대학교 전기전자통신공학부 22
테스트벤치 작성과 시뮬레이션
rom1에 저장된 내용을 두번사용하여 RAM에 저장한 후RAM 내용을 읽게한다.
시뮬레이션 파형
ram_we=1 : ram1에 데이터 저장ram의 01,02번지에는 222 저장, 03은 001저장
ram_we=0 : ram1의 데이터 읽기ram의 01,02번지에 222가03 번지에는 001이 읽혀진다.
한국기술교육대학교 전기전자통신공학부 23