01signal.com

Quartus / Linux: 명령줄로 FPGA 프로그래밍

명령줄?

네, GUI programmer보다 훨씬 편리합니다. FPGA 에 bitstream file을 로드하는 것은 반복되는 작업입니다. 동일한 컴퓨터에 연결된 동일한 보드의 동일한 FPGA 에 대한 동일한 파일입니다. 그리고 어떻게 든 GUI tools는 그것을 벅찬 의식으로 바꿉니다(때로는 어떤 장치가 연결되어 있는지 정확히 알 수 없으므로 정확한 장치를 알아야 하는 경우에는 퀴즈도 있습니다).

명령줄을 사용하면 말 그대로 bash history에서 명령을 선택하고 Enter를 누릅니다. 그리고 놀랍게도 명령줄 도구는 GUI 도구가 하는 어리석은 질문을 하지 않습니다.

첫째, 일부는 놀고있다.

environment설정:

$ /path/to/quartus/15.1/nios2eds/nios2_command_shell.sh

발견된 모든 장치를 나열하려면( cable은 자동 감지됨):

$ quartus_pgm --auto
Info: *******************************************************************
Info: Running Quartus Prime Programmer
    Info: Version 15.1.0 Build 185 10/21/2015 SJ Lite Edition
    Info: Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
[ ... ]
    Info: agreement for further details.
    Info: Processing started: Sun May 27 15:06:22 2018
Info: Command: quartus_pgm --auto
Info (213045): Using programming cable "USB-BlasterII [2-5.1]"
1) USB-BlasterII [2-5.1]
  02B040DD   5CGTFD9(A5|C5|D5|E5)/..
  020A40DD   5M2210Z/EPM2210

[ ... ]

위에 표시된 대로 장치를 나열하는 것은 bitstream을 로드하는 데 필요하지 않습니다 . 아마도 JTAG chain에서 FPGA 의 위치를 알려주는 것이 유용할 수 있습니다. 보드를 탐색하기 위해 한 번 수행되는 작업입니다.

jtagd

TCP/IP port 1309를 수신하는 이 daemon을 인식하는 것이 중요합니다. USB bus를 통해 JTAG 어댑터와 통신하는 역할을 하므로 GUI programmer 와 명령줄 도구 모두 이 어댑터에 의존합니다. 실행 중인 daemon이 없으면 둘 다 시작합니다.

그러나 여러 버전의 Quartus를 사용하는 경우, 특히 이전 버전으로 FPGA를 로드하려고 시도한 다음 새 버전을 시도하는 경우 혼란의 원인이 될 수 있습니다. 이는 최신 버전의 Quartus가 이전 버전의 jtagd를 계속 사용하기 때문입니다. 그리고 이 구형 jtagd는 최신 버전의 Quartus가 지원하는 FPGAs를 지원하지 않을 수 있습니다. 따라서 결론은 이상한 일이 발생하면 문제가 해결될 수 있고 아무 문제가 없다는 것입니다.

$ killall jtagd

FPGA로드

quartus_pgm은 대부분의 출력을 녹색 텍스트로 표시합니다. 일반적으로 빨간색 텍스트가 없으면 모든 것이 잘 된 것입니다.

$ quartus_pgm -m jtag -o "p;path/to/file.sof"

또는 JTAG chain 에서 JTAG 의 위치를 명시적으로 추가합니다(특히 첫 번째 장치가 아닌 경우). 이 경우 @1, 즉 JTAG chain의 첫 번째 장치입니다. 두 번째 장치인 경우 @2 등을 선택합니다.

$ quartus_pgm -m jtag -o "p;path/to/file.sof@1"
Info: *******************************************************************
Info: Running Quartus Prime Programmer
    Info: Version 15.1.0 Build 185 10/21/2015 SJ Lite Edition
    Info: Copyright (C) 1991-2015 Altera Corporation. All rights reserved.
    Info: Your use of Altera Corporation's design tools, logic functions
    Info: and other software and tools, and its AMPP partner logic
    Info: functions, and any output files from any of the foregoing
    Info: (including device programming or simulation files), and any
    Info: associated documentation or information are expressly subject
    Info: to the terms and conditions of the Altera Program License
    Info: Subscription Agreement, the Altera Quartus Prime License Agreement,
    Info: the Altera MegaCore Function License Agreement, or other
    Info: applicable license agreement, including, without limitation,
    Info: that your use is for the sole purpose of programming logic
    Info: devices manufactured by Altera and sold by Altera or its
    Info: authorized distributors.  Please refer to the applicable
    Info: agreement for further details.
    Info: Processing started: Sun May 27 15:35:02 2018
Info: Command: quartus_pgm -m jtag -o p;path/to/file.sof@1
Info (213045): Using programming cable "USB-BlasterII [2-5.1]"
Info (213011): Using programming file p;path/to/file.sof@1 with checksum 0x061958E1 for device 5CGTFD9E5F35@1
Info (209060): Started Programmer operation at Sun May 27 15:35:05 2018
Info (209016): Configuring device index 1
Info (209017): Device 1 contains JTAG ID code 0x02B040DD
Info (209007): Configuration succeeded -- 1 device(s) configured
Info (209011): Successfully performed operation(s)
Info (209061): Ended Programmer operation at Sun May 27 15:35:09 2018
Info: Quartus Prime Programmer was successful. 0 errors, 0 warnings
    Info: Peak virtual memory: 432 megabytes
    Info: Processing ended: Sun May 27 15:35:09 2018
    Info: Elapsed time: 00:00:07
    Info: Total CPU time (on all processors): 00:00:03

장치 불일치, JTAG chain 스캔 실패 또는 기타 다른 문제가 발생하면 빨간색으로 표시된 오류로 인해 이를 놓치기 어렵습니다. 명령줄 인터페이스의 좋은 점은 모든 시도가 처음부터 모든 것을 시작한다는 것이므로 보드를 켜고 다시 시도하십시오.

Cyclone 10 GX FPGA development kit

이 게시판은 나에게 약간의 추가 문제를 일으켰습니다. 그래서 그것에 대해 몇 마디 덧붙입니다. 이 보드가 컴퓨터에 연결되면 09fb:6810로 표시되지만 FPGA (마지막에 "@2" 참고)를 로드하려고 시도한 후 다음과 같이 표시됩니다.

$ quartus_pgm -m jtag -o "p;thecode.sof@2"
Error (213019): Can't scan JTAG chain. Error code 86.

장치의 ID가 09fb:6010로 변경됩니다. 따라서 firmware 의 일부 reprogramming이 분명히 있습니다( system log은 새로운 ID와의 연결이 끊겼다가 다시 연결됨을 보여줍니다). 보드는 Quartus의 GUI Programming Tool에 의해 GX0000406 로 감지되지만 "Auto Detect"를 클릭하면 "Unable to scan device chain. Hardware is not connected"가 표시됩니다.

자, scan을 사용해 보는 것은 어떻습니까?

$ quartus_pgm --auto
[ ... ]
Info (213045): Using programming cable "10CGX0000406 [1-5.1.2]"
1) 10CGX0000406 [1-5.1.2]
  Unable to read device chain - Hardware not attached

제 경우의 문제는 실행 중인 jtagd가 Cyclone 10 장치를 인식하지 못하는 이전 버전의 Quartus에 의해 시작되었다는 것입니다. 따라서 위의 조언을 따르고 죽이십시오. 그 후, 위의 명령을 사용한 프로그래밍은 Quartus Pro 17.1에서 작동했습니다.

$ quartus_pgm --auto
[...]
Info (213045): Using programming cable "USB-BlasterII [1-5.1.2]"
1) USB-BlasterII [1-5.1.2]
  031820DD   10M08SA(.|ES)/10M08SC
  02E120DD   10CX220Y
이 페이지는 영어에서 자동으로 번역됩니다. 불분명한 사항이 있으면 원본 페이지를 참조하십시오.
Copyright © 2021-2024. All rights reserved. (6f913017)