# Macro(IP) & Memory
###### tags: `Digital IC Design`
[回到主頁面](https://hackmd.io/@derek8955/BkK2Nb5Jo/https%3A%2F%2Fhackmd.io%2FdpcBlBL8TlShpQ-wSi9Quw)
### <font color= "blue"> What is IP </font>
Intellectual Property (IP) : 是個已經設計好的邏輯電路,designer 可以直接套用別人寫好的 IP 於自己的 design 中。其中 IP 又分為以下三種型式 :
- soft macro(IP) : Synthesizable RTL code
- firm macro(IP) : Netlist format
> 已經被合成完
- hard macro(IP) : Hardware (LEF, GDS2 file format)
> 已經做完 APR
### <font color= "blue"> Memory </font>
||
|:---:|
|Memory Architecture|
在撰寫 Register transfer level 時,常常需要存放大量的資料,這個時候則必須使用其他種 memory
- 因為 register 最基本的 DFF 就需要 12 顆的電晶體,最基本的 SRAM 則只需要 6 顆
- 不可能用 register 兜出來,cost會非常大
- DRAM 跟 DISK 會使用到一些傳輸的 protocol,速度會很慢,所以一般 design 若要使用 memory,都是優先使用 SRAM
為了節省 memory 合成的時間,所以 memory 在經過 [memory compiler](https://hackmd.io/0BG0fE6vQ3OZXIh15PR4EQ) 後,所產生的即是一個 hard macro。這時你可能會想,hard macro 已經做完 APR ,那要怎麼使用在 Register transfer level 跑 simulation ?
vendor 會提供的一個模擬模型(.v)來類比 IP 的真實行為,協助我們也可以 pass 前面的 flow。但要注意一件事,因為 hard macro 本身已經過繞線、擺放...等,所以她已經擁有 timing 的資訊,在 RTL simulation 的時候記得加上 notimingcheck,不然會有 timing violation
### <font color= "blue"> Synthesis Related Command </font>
因為 memory 是個 hard ip,所以我們不想他在合成的時候被包含進去,就可以打以下指令
```verilog=
//synopsys translate_off
`include "memory.v" // 把 memory include 在這兩行 command 之間就不會被合成了
//synopsys translate_on
```