Monday, January 14, 2013

The art of FPGA construction FPGA的建構藝術 (2) 程式碼編排

基本上,一個程式會有四大架構,

文章內是提到是VHDL的格式,但我想也是用於Verilog當中。

[1] Optional Heading Section

    檔頭部分,通常會寫一些重要的資訊,以及如何使用這套模組(Module)。

好讓第一次使用的人能夠快速上手,給用過的人能夠重新回想,還有一些歷史更改記錄。

[2] Library Declaration 

    宣告用了哪寫資料庫,可以提醒人記得匯入哪些資料到專案中。

[3] Entity Declaration

    其實,Module就是黑盒子的觀念一樣,你把輸入給黑盒子裡面做什麼不重要,

但要得到你想要的輸出,這樣才能達到簡化的目標。因此,輸入及輸出的訊號對Module來說可是很重要的。

為了能夠有效的整理利用就把它們放在此區塊吧。

[4] Architecture Section

    接著,最後的區塊就是給設計者設計的地方囉!!

0108esdSmithL02sm

 

 

 

 

 

 

 

 

 

 

 

 

 

下面有五個小訣竅可以幫助減少錯誤。

[1] 常常註解你的程式碼!!!

你覺得你記得住?等到一年後拿來看再說吧~

[2] 用空白鍵或Tab鍵來增加可讀性。

[3] 變數名稱的命名方式。

    (1) 命名盡量短而好記。舉例來說,

         active low chip enable  

    X active_low_chip_enable

    O CEn_n

    (2) 用“_”來加以敘述變數用途。舉例來說,

        負緣觸發的訊號,可以在變數名稱後面多加個n, _n, _b, *來提醒自己。

[4] 盡量止少使用Function。

[*5] Synchronize signals to change on a clock edge

       正負觸發的問題常常會影響訊號同步的問題。

 

繼續…看下去

 

Reference : 

http://www.embedded.com/design/configurable-systems/4007481/3/The-art-of-FPGA-construction

http://www.embedded.com/design/configurable-systems/4007481/4/The-art-of-FPGA-construction

 


The art of FPGA construction FPGA的建構藝術 (1) 基本概念

Working with FPGA isn't intimidating when you know the basic techniques and options.

很簡單的開宗明義,如果懂得去瞭解FPGA的基礎,那就什麼都不害怕了!!

但該如何去瞭解呢?在這部落格裡我想分享我的想法及思維,當然不是最完善的敘述。

但如果想討論的人歡迎一起研究!!

由於功力太淺無法直接憑空分享,所以我都借由文章來產生共鳴。今天的文章為~

http://www.embedded.com/design/configurable-systems/4007481/1/The-art-of-FPGA-construction

 

The key to good communication is having an understanding of the development process. A solid understanding will help you comprehend and extract relevant information for status reports, define schedule tasks, and allocate appropriate resources and time.There have been many times when my FPGA knowledge has allowed me to detect and correct errors, such as wrong part numbers or misuse of terms and terminology found in requirements and other documents.

其實寫FPGA是一個非常龐大的程式碼,有可能是一堆人完成的,所以溝通協調是非常重要的。

就算是一個人也會忘記當初所寫的,所以好的程式排版註解都是很重要的,可以提高效能和準確度。

不然暗藏臭蟲都毫無所知無從著手啊!!!


0108esdSmith01

 

 

 

 

 

 

 

 

 

 

 

 

 

圖示簡單地告訴我們設計FPGA有兩種概念的方式,

HDL的程式碼和Schematic Capture,

代表性的工具軟體分別為

Viewlogic's ViewDraw and HDL's EASE

CodeWright and Scriptum

其中HDL也有兩種設計概念,Structural and behavioral。

Structural就與Schematic Capture的概念雷同,利用圖像的方式拉移來完成。

Behavioural則是用寫程式碼來完成,知名的程式語言為VHDL, Verilog,也有Altera自己的語言AHDL等等~~


Continue

Tuesday, January 8, 2013

Parallels Desktop Suspending

要啓動虛擬伺服器卻卡在這個畫面進不去。

Screen Shot 2013-01-08 at 11.50.01 PM

 

 

 

 

 

 

 

 

 

 

 

 

 

請試試看以下做法,

Resolution

On the Host computer, open the Activity Monitor application from Finder -> Applications -> Utilities and find the following process:

In Parallels Desktop 5,6 and 7

prl_vm_app


In Parallels Desktop 


Parallels VM

 

Highlight this process, click 'Quit Process' and choose 'Force Quit' Option.

 

細節請參考。

http://kb.parallels.com/6338

Friday, March 23, 2012

[mail] 信件亂碼問題 in Mac

回想起常跟老外說到電腦的亂碼,我都會用Random Code來形容,但通常還是要解釋很久,

隨著時間過去看到許多文章才知道,亂碼其實也有專有名詞叫Mojabake來自於日語。

http://en.wikipedia.org/wiki/Mojibake

但其實說這個也並不是很多人知道意思。哈哈。

不過,現在主題是在於如何解決信件亂碼問題。

其實方法有兩種,

第一種是直接將文章重新解碼,這需要其他程式來完成。

第二種方式就是選擇編碼方式重新觀看。

Screen Shot 2012-03-23 at 下午5.47.58

 

 

 

 

 

 

 

在Mac的mail有這樣的功能,可以透過設定來改變觀看格式。

其實主要造成這個問題的原因,是在於在寄出信件時會附上信件格式,

但傳送到不同預設值的系統時就會發生問題,於是需要手動調整來正確顯示。

Mojibake is often caused when a character encoding is not correctly tagged in a document, or when a document is moved to a system with a different default encoding.

Tuesday, March 13, 2012

next/last page with shortcut in mac

Mac lion 10.7.3.

⌥+四指左右滑

 

http://macuknow.com/node/12687

Thursday, March 8, 2012

take icon off from system bar

press Control + command with mousing on icon.

Mac OS X Lion 10.7.

Monday, March 5, 2012

Qt Build Error: g++-4.2: No such file or directory

更新軟體,同步Xcode和QT版本。

http://stackoverflow.com/questions/8860105/qt-build-error-g-4-2-no-such-file-or-directory

 

Register Transfer Level Design with Verilog (1) [ebook]

設計程式之所以有趣不外乎是它的千變萬化,同樣的結果卻有不同的寫法。 但這些不同寫法當中也並沒有分誰對誰錯,也沒有制定標準來規範何事該用何解。 這也就是我們設計者的珍貴!! [1] Primitive Instantiations 在Verilog中最基本的邏輯...