發表文章

目前顯示的是 5月, 2023的文章

Nios II - Platform Designer 建立 Custom Component

圖片
建立好一個 Nios II System 之後 我們就可以利用 Nios II Software Build Tool 在上面開發 C Program 了 不過建立 Custom Component 的好處就是可以讓某些運算改由硬體來做 藉此提升效能 基本上參考手冊都把流程講完了 ( Nios II Custom Instruction User Guide ) 所以這裡只整理一些重點 跟自己在實作過程中碰到的問題 然後手冊雖然很長 但真的要有耐心一步一步照著做! 尤其是在 Platform Designer 建立 Custom Component 的地方 ================================================= Hardware 部分 下表列出了幾種 Custom Instruction Combinational => 該 Custom Component 為組合 (Combinational) 電路 Multicycle => 該 Custom Component 為時序 (Sequential) 電路 其中根據運算的 Cycle Count 是否固定,又可分為 fixed 或 variable fixed 表示從 start 送出後,固定某個 Cycle 數後就算好結果並回傳 (因此 done 訊號為非必要) variable 表示從 start 送出後,當 done 回傳為 1 時即可算好結果並回傳 (因此 done 訊號為必要) Extended => 讓該 Custom Component 可以做多個 Operation 用 n 來決定對該 Custom Component 下什麼指令 ================================================= Software 部分 建立好硬體部分後 就可以開啟 Software Build Tool 首先在手冊裡頭有提到自訂指令的函式宣告 例如這是回傳型態為 float 的函式 不過我們不需要這麼辛苦去 call 這些 function 因為在 <system.h> 裡頭都幫我們定義好了 接下來要在 code 中加入 #include <system.h> 然後先按 Build Project...

Nios II 使用 Host File System 的問題和注意事項

圖片
環境設置 OS: Windows 10 Software: Intel Quartus Prime Lite 18.0 Platform: Cyclone V GT 5CGTFD9E5F35C7 ==================================================== Host File System: 將要讀寫的資料放在 PC 上,然後就可以跟 PC 端做 File Operation ==================================================== 先前文章建立了一個完整的 Nios II System Quartus Qsys + Nios II 入門使用 但在嘗試使用 Host File System 的時候一直試不出來! 看了各種教學文章影片也都解決不了問題 後來才發現原來是因為之前 Nios II System 選擇的 Core 是 Nios II (Classic) e 雖然在 Host File System 的 Sample Code 裡頭說明是支援該 Core 的 但我自己實驗結果是沒辦法使用的 改成 Nios II f 之後就好了! 然後在新建 Project 後 也要記得 BSP Editor 裡的 Software Package  altera_hostfs 要打勾! 以及要注意 enable_small_c_library 不能打勾 ==================================================== Reference: (原創) 如何在Nios II EDS 8.0使用Host File System與Zip File System? (SOC) (Nios II)