# 小黃a耍廢日常紀錄 contributed by < `hanqun0723` > Email : hanqun0723@gmail.com ### 2020/05/09 bare metal : 底層沒有OS , program直接run在CPU上 Interrupt : CPU接收到由軟體或硬體產生的訊號(IRQ,interrupt request), 提醒CPU有某些事情發生, 請你來處理 * Interrupt 的種類 1. External Interrupt(外部中斷): CPU 外的週邊元件所引起的。 (I/O Complete Interrupt, I/O Device error) 2. Internal Interrupt(內部中斷):不合法的用法所引起的。 (Debug、Divide-by-zero、overflow) 3. Software Interrupt(軟體中斷):使用者程式在執行時,若需要OS 提供服務時,會藉由System Call 來呼叫OS 執行對應的service routine,完成服務請求後,再將結果傳回給使用者程式 * Interrupt 的處理流程 1. 暫停目前process 之執行。 2. 保存此process 當時執行狀況。 3. OS 會根據Interrupt ID 查尋Interrupt vector。 4. 取得ISR(Interrupt Service Routine)的起始位址。 5. ISR 執行。 6. ISR 執行完成,回到原先中斷前的執行。 Interrupt vector : OS會maintain一個表格(中斷向量表),裡面每一格儲存的是對應的ISR的進入點(位址)。當外部事件或exception產生時,CPU或中斷處理器會知道第幾號中斷產生了,並參考中斷向量表,再將CPU“跳”到中斷向量表相對entry裡紀錄的位址 ISR(Interrupt Service Routine): 每個中斷都會有一小段函式來處理中斷 ![](https://i.imgur.com/sYlIDuG.png) cross compile : 我們一般的PC都是Intel or AMD(x86-64 架構), compiler沒辦法產生出RISC-V的binary, 如果要產生可以run在RISC-V CPU上的程式需要透過cross compiler, 且透過cross compiler編譯完的程式沒辦法跑在host CPU上 Reference : 1. https://blog.xuite.net/tzeng015/twblog/113273005-Interrupt%EF%BC%88%E4%B8%AD%E6%96%B7%EF%BC%89%E8%99%95%EF%A7%A4%E6%A9%9F%E5%88%B6 2. http://programmermagazine.github.io/201407/htm/article1.html (很生動, 寫的不錯) --- git: ![](https://i.imgur.com/N304oPl.png) * untracked:檔案一開始都在這個狀態。 * unmodified:經由指令將untracked的檔案加入追蹤,或是,staged狀態的檔案經由commit,會到這個狀態。另外在這狀態的檔案可以藉由指令來取消追蹤。 * modified:檔案只要有改變就會到這個狀態,無論是在unmodified或是* staged狀態。藉由指令可以放棄這些變更,回到之前的狀態。 * staged:在這個狀態的檔案,通常就是要準備要提交到新的版本中了。在此狀態的檔案一經過更改就會回到modified狀態。 學習資源: 1. https://www.slideshare.net/littlebtc/git-5528339 2. https://blog.techbridge.cc/2018/01/17/learning-programming-and-coding-with-python-git-and-github-tutorial/ 3. http://wiki.csie.ncku.edu.tw/git#%E7%B0%A1%E4%BB%8B nWave教學: https://hackmd.io/@gKtGr2bGRYmQTu5DmxguoA/rJB_1B7tx?type=view Verilog教學: https://hackmd.io/Pp7w1BXdSaOhPcXP_my2ew --- ### 2020/05/10 Eyeriss Project : http://eyeriss.mit.edu/ Eyeriss v1 -> data reuse optimization Eyeriss v2 -> Process element utilization Youtube影片介紹 : https://www.youtube.com/watch?v=brhOo-_7NS4 :::info 後面NoC的部分還看不是很懂,有時間再回來看 ::: 偷米從Eyeriss cited裡面找到的paper(Januruary,2020,交大Phd學生寫的), 看起來屌打Eyeriss v1,v2 VWA: Hardware Efficient Vectorwise Accelerator for Convolutional Neural Network https://ieeexplore.ieee.org/document/8854849?denied= :::info 看了一半大概懂了原理,明天再把data flow trace一遍 ::: A System-Level Solution for Low-Power Object Detection https://ieeexplore.ieee.org/document/9022427?denied= :::info 標題看起來很吸引人,還沒看內容 ::: --- ### 2020/05/11 OVPSim : https://hackmd.io/6GpvLrVPS1aLkfUt0jvHzw --- ### 2020/05/12 Depthwise convolutions : shift register :