[FPGA]

Mapping, PNR with Xilinx ISE

Neo Park 2012. 12. 5. 17:02

 

FPGA bit file 생성을 위해 Synplify로 RTL synthesis를 마쳤다면,
이제는 synthesis된 결과를 FPGA에 mapping하고 PNR을 할 차례이다.

Mapping, PNR을 하고 bit file을 생성하는 것은 Xilinx ISE를 통해 할 수 있다.
그럼 mapping, PNR을 하는 과정을 순서대로 살펴보도록 하자.

1. NGD build
NGDBuild 단계에서는 Synplify를 통해 합성된 결과인 EDIF파일이나 NGC파일을 읽어서 Xilinx Native Generic Database 인 NGD file을 생성하는 단계이다. NGD파일은 AND, OR gate와 LUT, flip-flop 그리고 RAM과 같은 logic element로 design을 명시한 파일이다.
Input: EDIF or NGC file: Synthesis된 netlist 파일
UCF file: User Constraint File로 timing이나 layout constraint같은 constraint가 기술되어 있는 파일이다.
이는 user가 직접 작성해주어야 하는 파일로 보통 FPGA의 어느 pin에 design의 어느 port를
연결해 주어야 하는지에 대한 정보가 기술된다.
Output: NGD file: Native Generic Database file로 design에 대한 logical description이 binary 형태로
저장되어 있다.

아래는 general한 NGDBuild 수행 명령어이다.

ngdbuild -intstyle ise -dd _ngo \
-sd ${NGCPath} \
-nt timestamp \
-uc ${UCFfile} \
-p ${PARTName} \
${SYNDIR}/${TopName}.edf

각각의 option에 대해서 살펴보면

-intstyle ise: Design의 integration style을 ISE style로 한다는 option이다.
-dd ${NGOPath}: Destination directory이다. Output file이 저장되는 디렉토리를 설정해준다.
-sd ${NGCPath}: Search specified Directory, Netlist나 NGO, NGC, memory file을 reference할 때
필요한 directory이다. 만약 design 내의 어떠한 module이 black box 처리 되어있고,
이에 해당하는 netlist(NGC, NGO file)가 주어져 있다면 그 netlist 파일을
이곳에서 명시한 디렉토리에 저장해 놓으면 자동으로 찾아서 같이 합성하게 된다.
-nt timestamp: Netlist Translation Type을 설정해준다.
뒤의 timestamp option을 켜주면 Netlist Launcher가 timestamp check를 실시한다.
-uc ${UCFfile}: UCF file을 명시해주는 option이다.
-p ${PARTName}: Part Number를 설정해주는 option으로
target으로 하는 FPGA의 configuration part number를 명시해주면 된다.
${SYNDIR}/${TopName}.edf: Input file인 EDIF파일이다.



2. Mapping
Mapping은 앞에서 Synplify로 synthesis하여 얻어낸 gate level의 digital logic을 우리가 target으로 하는 FPGA의 element로 mapping 하는 과정이다.
Input file: NGD file: Native Generic Database로 앞에서 NGDBuild를 통해 나온 결과물이다.
Output file: NCD file: Native Circuit Description으로 mapping된 정보가 포함되있는 파일형식이다.
PCF file: FPGA의 physical element로 기술할 때 생기는 constraint파일이다.
이후 TRACE과정에서 이용된다.

아래는 general한 mapping 수행 명령어이다.

map -intstyle ise -timing \
-p ${PARTName} \
-w -logic_opt off -ol high \
-t 1 -mt off -detail \
-xe n -pr off \
-lc off -power off \
-o ${TopName}_map.ncd \
${TopName}.ngd \
${TopName}.pcf

각각의 option에 대해서 살펴보면

-intstyle ise: Design의 integration style을 ISE style로 한다는 option이다.
-timing: Design의 performance를 향상시키기 위해서 사용된다.
이 option을 enable시키면 mapping 과정에서 기본적인 packing과 placement을 모두 수행한다.
-p ${PARTName}: Part Number를 설정해주는 option으로
target으로 하는 FPGA의 configuration part number를 명시해주면 된다.
-w: 만약 이미 output file이 있으면 overwrite하라는 option이다.
-logic_opt off: Timing critical한 connection의 optimize하도록 시도하라는 것이다. 여기서는 off하였는데
이를 enable하기 위해서는 위에서 -timing option이 enable되어야 한다.
-ol high: Overall effort level로 packing과 placement를 하는데
어느정도의 시간을 소모하느냐에 대한 option이다. "std" 또는 "high"가 들어갈 수 있다.
-t 1: Placer cost table을 명시해주는데 1-100까지의 값이 들어갈 수 있으며
자세한 내용은 아래 첨부한 파일의 PAR Chapter를 참고하도록 한다.
-mt off: Mapping 과정을 하는데 하나 이상의 processor를 사용하고 싶다면 이를 on시켜주면 된다.
-detail: Mapping 과정의 report를 detail하게 작성하라는 option이다.
-xe n: -timing option이 켜져있을 때 유효하며, packing과 placement를 하는데
어느정도의 추가 노력을 하는지에 대한 option이다.
"n" (normal), "c" (continue) 두 value를 지정해줄 수 있다.
-pr off: Pack Registers in I/O, I/O에 register를 넣을 것인지에 대한 option이다.
"off", "i"(input에만), "o"(output에만), "b"(둘 다)의 value를 지정할 수 있다.
-lc off: 두개의 LUT component를 LUT6 site로 묶을 것인지에 대한 option이다.
"off", "area"(가능한 경우에 모두 묶어라), "auto"(performance와 area사이에서 balance를 맞춰라)
세 value를 지정해줄 수 있다.
-power off: Power optimization을 수행할 것인지에 대한 option이다.
on", "off", "high", "xe"(extra effort)의 네가지 value를 지정해줄 수 있다.
-o ${TopName}_map.ncd: Output file(NCD, NGD)의 이름을 명시한다.
${TopName}.ngd: Input file(NGD)의 이름을 명시한다.
${TopName}.pcf: 또다른 output file인 PCF파일의 이름을 명시한다.

3. PAR
Mapping된 결과물을 실제 FPGA상에서 placement & routing하는 단계이다.
Input: NCD file: Mapping단계의 결과물로 mapping된 정보가 포함되있는 파일형식이다.
Output: NCD file: Input file과 같은 형식이지만 placement & routing 정보가 포함되어 있다.

아래는 general한 PAR 수행 명령어이다.

par -w -intstyle ise \
-mt off -ol high \
${TopName}_map.ncd \
${TopName}

각각의 option에 대해서 살펴보면

-w: 만약 이미 output file이 있으면 overwrite하라는 option이다
-intstyle ise: Design의 integration style을 ISE style로 한다는 option이다.
-mt off: PAR 과정을 하는데 하나 이상의 processor를 사용하고 싶다면 이를 on시켜주면 된다.
-ol high: Overall effort level로 packing과 placement를 하는데
어느정도의 시간을 소모하느냐에 대한 option이다. "std" 또는 "high"가 들어갈 수 있다.
${TopName}_map.ncd: Input file(NCD)의 이름을 명시한다.
${TopName}: Output file의 이름을 명시한다 (${TopName}.ncd와 같이 저장되게 된다.)


4. TRACE (Timing Reporter And Circuit Evaluator)
TRACE과정에서는 PNR된 design을 input timing constraint를 가지고 static timing analysis를 하는 과정이다.
즉, PNR된 결과가 timing constraint를 만족하는지, 만족하지 않는다면 timing violation된 list를 뽑아내 알려준다.
Input: NCD file : Mapping된 design이다.
PCF file (optional) : 사용자에 의해 지정된 physical constraint file이다. Mapping 과정을 통해 생성된다.

Output: TWR file : Summary, error, verbose report가 생성될 수 있으며, 옵션에 따라 output file의 유형을
결정 할 수 있다.

아래는 general한 TRACE 수행 명령어이다.

trce -intstyle ise -v 50 -a \
-s 1 -l 30 -xml ${TopName} \
-o ${TopName}.twr \
${TopName}.ncd

각각의 option에 대해서 살펴보면

-intstyle ise: Integration style을 ISE style로 한다는 option이다.
-v 50:
-s1
-l 30
-xml ${TopName}
-o ${TopName}


5. Bit Generation
여기서는 실제로 Xilinx FPGA에 들어가는 입력 형식인 bit file을 생성하는 단계이다.
Input: NCD file: Mapping과 PAR이 모두 수행된 NCD file이다.
Output: Bit file: 실제 Xilinx FPGA에 들어가는 bit file이다.

아래는 general한 Bit Generation 수행 명령어이다.

bitgen -intstyle ise \
-f ${SCRDIR}/${TopName}.ut \
${TopName}.ncd

각각의 option에 대해서 살펴보면

-intstyle ise: Design의 integration style을 ISE style로 한다는 option이다.
-f ${SCRDIR}/${TopName}.ut: ${TopName}.ut에 기술된 command line argument를 수행하라는 뜻이다.
자세한 내용은 아래 첨부한 파일을 참조한다.
${TopName}.ncd: Input file(NCD)의 이름을 명시한다.
(참고: output 파일의 경우 자동으로 ${TopName}.bit으로 저장된다)



이로써 FPGA에서 사용되는 Bit file을 생성하는 데까지의 과정을 알아보았다.
더 자세한 사항은 밑에 첨부된 파일을 참고하도록 한다.

    > devref.pdf

 

추가로 위의과정을 모두 수행하는 script 파일이다.
    > run_pnr

 

 

 

참조 : http://sunshowers.tistory.com/78

run_pnr
0.0MB
devref.pdf
4.63MB