星期一, 9月 14, 2009

Suffer vt. 遭受, 經歷

Suffer from vi. 受苦, 患病
These algorithm suffer from the problem of external fragmentation.

星期五, 3月 27, 2009

Smoothsort

Edsger W. Dijkstrak 在1981年提出來的Sorting方法 ,
就是和 Dijkstra's Shorest Path Alogirthm 同一人 ,

Smoothsort算是Heap Sort的變形,
Heap Sort的演算法的複雜度平均是 O(nlogn),
Smoothsort複雜度的Worst Case也是O(nlogn), 但是在某種Case的時後可以是 O(n)
實作起來要有點數學基礎, 演算法的基礎是Leonardo number, 花了一些時間才弄懂
下面是Leonardo number的Binary Tree表示法,

詳細的演算法等我弄懂一點才貼出來,

有興趣請參考Wiki, EWD796a,

星期一, 3月 23, 2009

安裝SystemC

http://scream.csie.ncku.edu.tw/WWW/images/ESL/SystemC/systemc_setup.pdf

星期一, 1月 19, 2009

[英文寫作] Respectively

Respectively, adv.
個別, 分別

例句一:
Mary and Anne were respectively 12 and 16 years old.

例句二:
The brothers were called Felix and Max, respectively.

星期三, 11月 19, 2008

Verilog Generated Instatiation

In some case, we require variable number of instances
A example in Standrad: Ripple Adder

module addergen1 (co, sum, a, b, ci);
parameter SIZE = 4;
output [SIZE-1:0] sum;
output co;
input [SIZE-1:0] a, b;
input ci;
wire [SIZE :0] c;

genvar i;

assign c[0] = ci;

// Generated instance names are:
// xor gates: bit[0].g1 bit[1].g1 bit[2].g1 bit[3].g1
// bit[0].g2 bit[1].g2 bit[2].g2 bit[3].g2
// and gates: bit[0].g3 bit[1].g3 bit[2].g3 bit[3].g3
// bit[0].g4 bit[1].g4 bit[2].g4 bit[3].g4
// or gates: bit[0].g5 bit[1].g5 bit[2].g5 bit[3].g5
// Generated instances are connected with
// generated nets: bit[0].t1 bit[1].t1 bit[2].t1 bit[3].t1
// bit[0].t2 bit[1].t2 bit[2].t2 bit[3].t2
// bit[0].t3 bit[1].t3 bit[2].t3 bit[3].t3

generate
for(i=0; i<SIZE; i=i+1) begin:bit
wire t1, t2, t3; // generated net declaration
xor g1 ( t1, a[i], b[i]);
xor g2 ( sum[i], t1, c[i]);
and g3 ( t2, a[i], b[i]);
and g4 ( t3, t1, c[i]);
or g5 ( c[i+1], t2, t3);
end
endgenerate

assign co = c[SIZE];

endmodule

星期五, 5月 09, 2008

VC++ 使用 OpenMP

1) /openmp
2) vcompd.dll not find?
#include "omp.h"

平行化的三種方式
parallel、sections、for

星期一, 4月 21, 2008

VMM Detection

VMM (Virtual Machine Management) 的目的是要架構一虛擬的平台

在真實硬體上未完備之前來讓軟體能在上面執行, 或者能讓一台機器來模擬其它硬體平台

但是接下來會衍生一個問題, VMM能做到完全不被上層執行的軟體發現嗎?

作者引用了另一篇HOTOS的會議論文 --Compatibility is not Transparency: VMM Detection Myths and Realities, 文中的結論是不太可能作到這點

關鍵在於"時間"..... <待續>

星期六, 4月 19, 2008

StreamIt: Multicore Programming Lanaguage

CPU發展的趨勢了幾乎已經確定是Manycore而不是Better core
單一晶片中可能有8個, 16個, 32個... 甚至上千個核心
但是面對如此強大的硬體資源, 傳統的程式語言(Programming Language)可以掌握嗎?
傳統程式語言使採取循序(Sequential)觀點來面對程式
之後有執行緒(Thread)的概念出現,
執行緒的概念是要在單一記憶體空間中同時處理有兩件以上的事情
但執行緒之間有同步以及共享記憶體的問題, 這會造成程式設計師很難撰寫及除錯

StreamIt是MIT在2002年開發的程式語言,
StreamIt採用元件概念來寫程式, 一支程式是由許多Filter構成~
每個Filter會處理輸入串流(Stream), 然後產生輸出串流
每個Filter都是平行在處理自己的串流, 彼此沒有共享資料, 可以很容易達到最佳化的效能
MIT目前有在自校的課程教授StreamIt, 應用的平台是Sony PS3的Cell Processor

星期四, 4月 03, 2008

Software Defined Silicon

Multicore 的應用

定義新的Language來描述I/O, 要用Multicore來取代FPGA?

優勢是Power? Cost?

硬體工程師可能會排斥?

星期一, 3月 31, 2008

星期日, 12月 16, 2007

Internal Conference

ISCA (International Symposium on Computer Architecture)
June 21-25, 2008, Beijing, China

ASPLOS (Architecture Support for Programming Language and Operation System)
March 1-5, 2008, Seattle, WA

DAC (Design Automation Conference)
June 8-13, 2008, Anaheim, California

DATE (Design Automation and Test in Europe)
March 10-14, 2008, Munich, Gernan

SAMOS (Embedded Computer System: Architecture, MOeling, and Simulation)
June 21-24, 2008, Samos, Greece

LCTES (Conference on Languae, Compilers, and Tools or Embedded Systems)
June 12-13, 2008, Tucson, AZ

星期三, 8月 15, 2007

Embedded RTOS

1. uC/OS-II
非常迷你的OS, 從8051, PIC到32-bit CPU都有Port, 要自己Porting自己CPU也很快上手
除了基本的Kernel及TCP/IP有Open Source, 其它例如Filesystem都要額外付錢,
有四種License方式Single Product, Product Line, Per CPU-Type, Site

2. RTEMS
RTOS for Multiprocessor Systems, 支援許多open API Stanard: POISIX, VEMbus, TCP/IP including BSD Socket, uITRON.
在網路方面大部份的Service都有, Filesystem支援FAT, TFTP, NFS
但是支援的CPU種類較少, 而且偏向是比較高階的CPU

3. DSPnano
前身是Unison, 對DSP最最佳化處理, Eclips-based的開發環境

星期二, 7月 17, 2007

Chip Debug Industry Related

http://www.us.design-reuse.com/exit/?url=http%3A%2F%2Fwww.embedded.com%2Fshared%2FprintableArticle.jhtml%3FarticleID%3D201000620

1) Nexus (IEEE 5001) Forum, which is focused on high performance trace related interfaces based on the IEEE 5001 (Nexus) standard;
2) MIPI Alliance Test and Debug working group whic is addressing a range of debug interface efforts;
3) IJTAG (P1687) , which is a working group looking at JTAG extensions
4) Multicore Association (MCA) which is looking at integrated set of Debug and Communication APIs for Multicore architectures.
5) AJTAG (P1149.7) which is looking at 2 wire JTAG architectures
6) SPIRIT Consortium has a Debug working group looking at debug register description within the SPIRIT IP-XACT frameworks.

星期四, 6月 21, 2007

Debug Audio

http://www.insidedsp.com/tabid/64/articleType/ArticleView/articleId/207/Tips-and-Tricks-for-Debugging-Audio.aspx

星期二, 5月 22, 2007

Annotation of heterogeneous designs in OrCAD Capture

1. 在Part Property新增一Column "Group"
2. 將同一Part的Package的Group設為一樣
3. 在Annotate的Physical Packing 加入"{Group}"

星期五, 3月 23, 2007

SystemC Module Constructor (SC_HAS_PROCESS)

典型的SystemC Module 寫法:
SC_MODULE(module_test) {
public:
SC_CTOR(module_test) {}
};

但是如果Constructor要傳入不同變數的時後必須換另一種寫法
class module_test: public sc_module {
public:
module_test(sc_module_name nm, ....): sc_module(nm) {....}
};

但是在這這種情況下, 如果module裡面要宣告Process
例如SC_METHOD, SC_THREAD, SC_CTHREAD 就會有問題,
因為Process 會用到 SC_CTOR這個macro所定義到的一些東西
所以要用下面這種寫法
class module_test: public sc_module {
public:
SC_HAS_PROCESS(module_test)
module_test(sc_module_name nm, ....): sc_module(nm)
{
SC_CTHREAD(....);
}
};

星期一, 3月 19, 2007

SystemC x86_64

1. 2.1版的不支援, 請用2.2beta版
2. 將configure裡面的LD_FLAGS改為LDFLAGS

參考文章: http://panoramis.free.fr/search.systemc.org/?pdoc=systemc/64bits

星期一, 12月 18, 2006

使用PrimePower

PrimePower是Gate Level Power Estimation的工具

使用的程序如下:
1. 先合成出gate level的net list
2. 輸出 netlist 以及sdf
3. 跑gate level simulation在 Test Bench先要加入以下兩行
$sdf_annotate("aaa.sdf", U_aaa");
$dumpfile("aaa.vcd")
4. 會得到aaa.vcd, 然後再執行PrimePower


以下指令:
set search_path {. /aaa/bbb} // /aaa/bbb是Cell Lib的路徑
set link_lib {* xxx.db} // xxx.db是所使用的Cell Lib
set target_lib {* xxx.db}
read_verilog aaa.v // aaa.v是合成出來的gate level netlist
current_design aaa // aaa是 Top Module
read_vcd -strip_path tb_aaa/U_aaa aaa.vcd //tb_aaa/U_aaa 是 Test Bench裡面Top Module
calculate_power -waveform //註: -waveform才會有Peak Power的結果
report_power




使用PowerCompiler

1. 在Verilog Test Bench 加入
initial begin
$dumpfile("xxx.vcd");
$dumpvars;
end

2. 將vcd格式轉為saif格式 (Linux 指令)
vcd2saif -i xxx.vcd -o xxx.saif

3. 將Saif讀進來 (DC Shell)
read_saif -input xxx.saif -instance tb_core/U_CORE

Verilog File I/O System Task

integer $fopen(file_name, mode)
file_name: 要開啟檔案的名稱
mode : "r" for read "w" for write
Return : 會回傳一個數字表示 file descriptor


integer $fread(mem, fd, start, num)
mem : 資料要寫入的地方
fd : file descriptorstart : 資料要從 mem 的第幾筆開始寫
num : 要讀幾筆 (一筆的寬度是由mem的宣告決定)
return : 會回傳到底讀了多少 byte


integer $fseek(fd, nb, mode)
fd : file descriptor
nb : number of byte
mode :
0: seek from begin
1: seek from current
2: seek from end


integer $fscanf(fd, format, args...)
fd: file descriptor
format: format
args: 參數
Returns:回傳讀了多少參數

$fdisplay(fd, format, args...)
fd: file descriptor
format: format