2010年2月22日 星期一

2/22~2/26

吃飯吧

接下來就要開始寫程式了

要如何才能專心在寫程式上呢?
你都要31歲了,難道不能自制一點嗎?
你不要用責備的方式,這樣是沒有用的,
如果罵一罵有話我現在搞不好已經畢業了呢!
不罵行嗎?講十天也沒用,就你不要看書了,還是硬要看完,
是怎樣?!那幹嘛專程來中研院看書,在家裡看不就好了,

what does "extern" mean in C++?
the following URL provides a good explanation:

and, do I need to declare a extern "C" header file?
in llvm_translation.h, we should have a declaration as follows:

extern "C"{
typedef unsigned long (*PFunc_t)();
PFunc_t llvm_gen_code(CPUX86State *CPU1, const uint16_t *opc_buf, const uint32_t *opparam_buf);
}

now, goto qemu makefile

幹!專心啦

現在 make 是一個大問題
其實也還好,只要將 header include 進去,再 compile,再 link 就可以了,

llvm_gen_code要在那裡?
應該要放在 gen_code_slow 那邊吧:

========2/23============
工作工作,人生的意義就在工作裡

加一個target,llvm_translator 的 target,真想吃點東西,

Makefile.target,加在裡面:

$@: target name,
$<: dependent name
@CMD: execute CMD


寫個信給老師,說我禮拜三不會去,

幹!怎麼不吃大便,整天一直講話,

在 configure 中加入 llvm translator 的 config
可以在 configure 的時候決定是否要用 llvm_translator,
--enable-llvm-trans

要不要加在 config-host.mak。不用。
config-host.mak, config-host.h
只要加在 config.mak及config.h中即可。
config.mak, config.h

焦慮中
去洗臉吧

在LLVM中,JIT所產生的 code 是放在那?heap中嗎?還是mmap中呢?
有可能是在 heap 中,那會有什麼問題嗎?執行上的問題吧,
可是它可以執行啊;嗯,對,有可能是需要在 mmap 中,

ExecutionEngine::create 有另一個
create (
ModuleProvider *MP,
std::string *Err,
JITMemoryManager *JMM,
CodeGenOpt::Level OptLevel=CodeGenOpt::Default,
bool GVsWithCode=true)

其中 JITMemoryManager 就是控制 Memory 的 class,
但問題是,如何將把它跟 QEMU 的memory control弄在一起,

所以現在的問題是 qemu 是如何來控制 memory 的?
我猜是…,還真不知道,
我只知道滿了就清空這個,
乾脆將tb->tc_ptr = llvm_gen_code 算了,

這樣可能會死!死了再說!!!!!!!!
先能動!


走走走走走

gen_opc_buf: uint16_t buf[OPC_BUF_SIZE]
gen_opc_ptr: uint16_t *, move inside the buffer

又來了,幹,幹嘛一直看圖片啦,是在幹什麼!

下班下班,工作的意義在於下班!

===========2/24======================

今天要報告什麼呢?
上上禮拜五請假,禮拜四meeting,
報告我做的事好了:
1、將 整合進 qemu 的 Makefile 中,
2、指出 LLVM 是用 JITMemoryManager 來管理 translated code cache
但 qemu 是自己管理 translated code cache,在
qemu 的 code cache 管理很簡單,只是一直放 code,如果 buffer 滿了,就清空。
cpu_gen_code 需要return gen_code_size,
因為它需要 advance code_gen_ptr;code_gen_ptr指到目前可以放code的位置。

regs_to_env is empty in i386

translated code alignment problem in QEMU,
QEMU forces all generated code to be 16-bit aligned!!!!

IR Cache - 這會存在 Module 中,
Basic Block Cache,這會存在 JITMemoryManager 中,
所以如果以後要做 Code Cache Memory 的研究,應該 extend 這

=========2/25=============

今天要做什麼呢?
可以做 translate.c 裡的 disas_insn_llvm 這個 fuction
也可以寫一個 translation function,

可是你還沒訴 Makefile 可以找到 llvm-translator.cpp 這個檔,do it!
結果只是 rules 寫錯,幹!
加入 llvm 的檔案,compile 需要,


cscope -R -b

整理一下,

今天已成功將 llvm translator integrate 到 qemu 的 make system
遇到的困難有,c 與 c++ 檔案的 link 的問題,
主要是我想在 llvm-translation.h 中將 llvm_gen_code_wrap 這個程式用 static 的
方式用在 translate-all.c 中,
不過好像不應該寫在 header file 中,直接寫在 translate-all.c 中。

but,anyway,想講的是,如果在 extern "C" 中要用到 static,就直接寫在裡面就好了,
如:

extern "C" {
static void* f (void){ /* write your code here */}
}

不要這樣:

extern "C" {
static void* f (void);
}

extern "C" static inline void* f(void)
{
/*write yout code here*/
}

上面的方式會有 linkage error 的錯誤訊息。

另外,今天也將 llvm 加入 svn 系統中,這樣就將 llvm 的版本固定下來了。

在 xeon 上跟 haru 上都可以打 make 編譯了。

做別的事轉換一下心情吧。
看paper。










































2010年2月10日 星期三

2010年2月8日 星期一

2010 2.8 note

一、我是否要用 llvm project 來建我的東西?
嗯,我覺得不一定要用它的東西。可以考慮,不過不是現在要,先知道有這個東西。

LLVM實在是一個很好的project,很難相信他們可以寫這麼多的document。

docs/ProgrammersManual.html
包含很多使用 llvm 寫程式的實用知識,

今天要將 llvm-translation.h 編好,能不能用倒是其次,要能 compile 倒是真的。

去大便吧!

compile llvm ... done, installed in /home/tk/local/llvm-2.6
然後compile llvm-gcc ... done, installed in /home/tk/local/llvm-gcc-2.6
去洗個臉,然後找啟彰去走走。

去洗個臉。

照理說,dyngen 應該是要用程式寫出來的,
合理的想法是,先寫 llvm-database,然後再parse database裡的東西寫出。
不過這我目前沒法做到,
老師也沒預期我會這樣做,所以還是先用手寫吧。


2010年1月26日 星期二

即然不想做事,就來寫點東西好了,主要是今天看到的:

1、Big-Endian V.S. Little-Endian
Danny Cohen 是 ADOBE 的兩位創始者之一,PostScript是他們發明的。
這篇是寫電腦科學中有名的問題,此君以幽默的語氣完整的介紹了此問題,
十分有趣,值得一讀。

2、

2010年1月20日 星期三

TODO:

1' find out <- this is llvm translation database
2' find out the translator engine <- llvm-op.h is the engine
3' add translator engine into llvm_gen_code
4' in the slide, you should mention the architecture of the framework, and
indicate which is done.
5' show the target instructions and say that you are going to build the translation function in the next week

2010年1月18日 星期一

QEMU programming notes

profiler => can we ignore it?

inhibit irq => true if hardware interrupts must be disabled for the next instruction

TF cpu flag => 8th bit of flags in x86, trap flag, system flag

jmp_opt in DisasContext => indicate whether to do block linking

what is GRP1? in
what is modrm?

Q: what are my target instructions?
test program is in ~/research/qemu/src/branches/llvm-qemu/tests/
add-i386.c
tmp.c

stay in disas_insn() in target-i386/translate.c
line 4122

I need a C programming language book

1' create a new fucking useless function!

mov
0x89 source is register, destination could be register
or memory location related to a register



2009年12月2日 星期三

svn merge

svn merge -r 5600:5646 ../branches/march

2009年11月25日 星期三

running qemu as daemon

I am using another way:
qemu -hda /qemu/xp.cow -boot c -cdrom /data/install/admin/os/windows/winxpsp3ue.iso -m 384 -k es -vnc *:0 -daemonize -localtime
-vnc *:0 to run a vnc server wich I can connect from anywhere (that's the asterisk for - *) on the display 0

-k es when using VNC instead of SDL you have to specify the keyboard layout, I am using spanish

-daemonize this keeps the process running as a daemon.

-localtime with this clock is set to the hardware clock, not utc. This is for windows

So, when i want to connect back i just use

2009年11月23日 星期一

grep exclude pattern

grep -ircl --exclude=*.{png,jpg} "foo=" *

grep -Ir --exclude="*\.svn*" "pattern" *

2009年11月17日 星期二

TODO

TODO:
  1. 打電話給吳小姐
  2. 將訃文拿給人事
  3. 注意實驗的進度
  4. 做translation function

2009年11月11日 星期三

enable IBM trackpoint and disable touchpad

first, install xinput: sudo apt-get install xinput

xinput list => show all input devices
xinput list-props $dev_id => show all options of $dev_id
xinput set-int-prop $dev_id "$opt" 8 $value => set integer value to option $opt,

xinput set-int-prop $touchpad "Device Enabled" 8 0
xinput set-int-prop $trackpoint "Evdev Wheel Emulation" 8 1
xinput set-int-prop $trackpoint "Evdev Wheel Emulation Button" 8 2
xinput set-int-prop $trackpoint "Evdev Middle Button Emulation" 8 1

2009年11月10日 星期二

meeting結論

1、叫學弟做實驗分析QEMU的執行時間:translation, execution, control。
2、用 ARM 跑PARSEC2.0,可能要cross compile
3、將QEMU x86上不能跑超過三個threads回報至mail中。

2009年9月7日 星期一

ToDo

一、藝鴻
1、流程要能跑完。
二、unigrid demo
1、要跟晁睿拿 ibm
2、後製要到我的電腦上用 k9 來做
三、師大的案子(星期三)
1、電子報上,
2、討論區中譯,
3、手冊?
四、民航局的案子
1、阿碼科技的檢驗提案。
2、pixy的問題
五、JSS
1、Lovasz Local Lemma 的 implementation
2、JSS演算法的了解
六、Binary Translator
1、LLVM

2009年8月28日 星期五

一、寄通知信給各老師,請他們啟動 SRB
二、做 slide,demo sequence
三、

2009年8月8日 星期六

Transitive's QuickTransit

Apple Computer implemented a dynamic translating emulator for M68K code in their PowerPC line of Macintoshes, which achieved a very high level of reliability, performance and compatibility (see Mac 68K emulator). This allowed Apple to bring the machines to market with only a partially native operating system, and end users could adopt the new, faster architecture without risking their investment in software. Partly because the emulator was so successful, many parts of the operating system remained emulated. A full transition to a PowerPC native operating system (OS) was not made until the release of Mac OS X (10.0) in 2001, and within this new OS the "Classic" runtime environment still offers the emulation capability on PowerPC Macs. Also, the Rosetta translation layer included in releases of Mac OS 10.4 for Intel-based Macs, which is used to ease the transition from the PPC to x86, is an example of dynamic translation. Developed for Apple by Transitive, the Rosetta software is an implementation of Transitive's QuickTransit solution, which can be used to dynamically translate between platforms that include SPARC, PowerPC, MIPS, Itanium and x86.

2009年7月31日 星期五

Open64 Research - Work item

1. read whirl node

Open64 - cg

Questions:

在那 fprintf assembly

ToDo

一、問阿斌封面的事
二、看一下 無障礙 tab 鍵
三、OPEN64
四、師大

2009年7月29日 星期三

TODO

一、啟彰的 slide
二、明早 meeting 的 slide
三、明天下午的 slide
四、後天 meeting 的 slide
五、annotation的東西
六、明天早上打給黃雲英小姐
七、明天記得帶 dvd 出門

2009年7月28日 星期二

ToDo

1、明天要去航管局資管中心蓋章
2、明天早上要來中研院開會
3、要還 dvd,出門記得帶著
4、確定六項的名稱,條碼,明天要生海開始檢查,要告訴他如何檢查
5、要記得問真慧版,跟師大聯絡
6、跟藝鴻討論一下,順便拿給簽好的東西
7、記得買保險套
8、要記得跟德禹講錢的事
9、明天要聚餐,台北 101 四樓 Wasabi
10、

2009年7月18日 星期六

php mailer gmail

要先跳過去,
要有menu,

$phpmailer->CharSet = 'utf-8';
$phpmailer->Encoding = 'base64';


//$phpmailer->Sender = "cher.webmaster@gmail.com";
//$phpmailer->Sender = "tk@sage.csie.ntu.edu.tw";
//$phpmailer->IsSMTP(); // set mailer to use php mail()
//$phpmailer->Host = 'ssl://smtp.gmail.com';
//$phpmailer->Port = 465; //default is 25, gmail is 465 or 587
//$phpmailer->SMTPAuth = true;
//$phpmailer->Username = "tp.killer@gmail.com";
//$phpmailer->Password = "ix jn tk";

2009年7月15日 星期三

OPEN64 - Glossary

TY = type
ST = symbol table
TN = temporary node
PREG = pseudo register

2009年7月14日 星期二

Question about ianthro

Question:

I still don't know how to find out where 'navigation' is generated.

drupal path fix

1. /collections has been URL-aliased to node/2779. Therefore, we won't need
"collections " in menu system(remove $items['collections'])
1.1 remove "$items['collections']" out of menu system will lost 'collections' in navigation bar, don't know why

2. we don't need function collections_nodeapi since now /collections has been mapped to node/2779. We don't need it to render '/collections' page

3. remove all loader since now we use page callbacks to connect collections and drupal

4. the function of collection_preprocess_page. It will append $collections['template_files'] to $variables['template_files'] which will be used to generate collections pages in theme().

4.1. We need the condition if ( ! isset($collections) ) since collection_preprocess_page could be called without being followed _collections_load which we define collections.

2009年7月13日 星期一

工作日誌:

ianthro:安裝 phpMyAdmin 及 lynx
gogogogogogogogogogogogogogogo

2009年5月23日 星期六

中研院管考

正式系統:
tag/march/0.01
1. chart disabled; comment out chart button in SelectPanel.mxml
2. svn commit -m ""; svn cp CURRENT
3. svn co <>
3. add config/database.yml
4. run march: ./start_march restart 140.109.136.136
5. mv db/migrate/032xxx .; rake db:migrate; mv 032 back
6 add operations operation_items uploaded_files data into database
7. cp IHP/bin/pdftk to production directory

2009年5月17日 星期日

TODO

一、寫作業。
二、統計 worksheet
三、交心得報告
四、藝鴻的東西, http://sb.ianthro.tw/
五、greedy algorithm,approximation
六、

2009年4月20日 星期一

hadoop cluster and eclipse plugin

Eclipse : 3.3.2
Hadoop: 0.19.1
Hadoop-eclipse-plugin: 0.19.1, in contrib/eclipse-plugin

cluster environment:
grid01(cluster head) has two network interfaces:
140.112.30.240 --> external
192.168.77.1 --> internal

grid02~grid05 are in the private network:
192.168.77.2~5.

Since we need to contact the internal nodes when running hadoop applications,
we need to setup proxy to have grid02~grid05 accessible to people outside.

Setup proxy port 54088:

ssh -L 140.112.30.240:12345:192.168.77.1:22 140.112.30.240 -n -N &
ssh -D 140.112.30.240:54088 -p 12345 140.112.30.240 -n -N &

And then in hadoop-eclipse plugin, you can set proxy host/port as 140.112.30.240:54088

2009年4月18日 星期六

memo

1, cvs check, user upload
2, month

2009年4月17日 星期五

2009年4月16日 星期四

funwish todo

一、月份不是從 1 月開始
二、csv 上傳時需要自動 insert,actual,expect,digital_output,
三、測試報告

memo

need to judge when to put final
but right now, only need to consider season

gogogo

second round, GO

what about digital?

16 2 3 7 8 10 1

2009年4月14日 星期二

TODO

要做的事有:
一、申請簽證,明天早上九點半
二、訂 Frankfurt YH,
三、準備 Hadoop worksheet
四、setup hadoop machines
五、research,pin,dynamoRIO,XED2,qemu。

2009年4月10日 星期五

build UQBT

build uqbt

require libelfg0-dev package

1. tar xzf uqbt1.0alpha.tar.gz
2. ./configure --with-source=pent --with-target=sparc --disable-vpo --enable-remote --prefix=/home/tk/local
3. vim Makefile
change CPPFLAGS= -I/usr/bin/../include/linux to CPPFLAGS=
change CC=gcc to CC=gcc-2.95
change CXX=g++-2.95
pass '--traditional-format' option to linker
%s/-lstdc++/-Wl,--traditional-format -lstdc++/g
4. vim include/config.h
change #define HAVE_ELF_H 1 to #define HAVE_ELF_H 0
5. vim include/ElfBinaryFile.h
put #include to the top of #ifndef ELF32_R_SYM
6. vim loader/ElfBinaryFile.cc
elf_hash(pName) ==> elf_hash((unsigned char*)pName)
7. make

The processes goes fine until ld, there will be alot of errors shown, put we still can get the uqbtps executable file

however, it cannot translate the compiled program ...

2009年4月6日 星期一

我是不是有病

我是不是有病

要很認真的思考這個問題,我是不是有病!

無法專心,無法完成一件事,
整個頭腦亂成一團,我需要整理我的腦袋。
定期的

2009年3月17日 星期二

Setup OpenSuse

1' setup network: /etc/sysconfig/ifcfg-eth0 /etc/sysconfig/ifroute-eth0
2' setup firewall, sudo /sbin/yast, choose firewall, allow SSH, and related services to through firewall
3' set NIS server
4' set NFS server
5' set NIS client
6' set NCF client

2009年3月3日 星期二

TODO

1' Announce TA office hour
2' study OpenMP, CUDA
3' Prepare power extending lines for classes
4'

TODO

1' understand OPEN64 CGIR form
2' collect binary transformation, binary optimization papers
3'

2009年2月15日 星期日

delete in operation_item_controller.rb has problem, when updating items' ranks

2009年2月10日 星期二

model cannot use type as attribute name

Cannot use "type" as attributed name in model.

it will issue an error when you use find, e.g., Operation.find :all
>> Operation.find 1
SyntaxError: compile error
/home/tk/eclipse/flex/ihp-report/branches/march/IHP/vendor/rails/activerecord/lib/active_record/base.rb:1748: syntax error, unexpected tINTEGER
Object::0

shit

2009年2月3日 星期二

今天要做的事

一、看曉偉的東西,
二、experiment about that "does greedy algorithm produce optimal solutions for file transfer problem."
三、artit 的東西。
四、funwish 的東西。
五、multi-core meeting, tutorial
六、

2nd open 64 tutorial

where does mcf-seq-f and mcf-par-f come from? are they copied from the outputs of 1st tutorial ?

2009年2月2日 星期一

鏡子

鏡子,今天要去買鏡子。
昨天跟依親聊天時她的匿稱也是鏡子,剛看msn的列表時也有人是到鏡子。
這是什麼預兆呢?

2009年1月19日 星期一

xrandr

interesting stuff : xrandrx

xrandr --auto ( auto-detect newly add screen(VGA, another monitor, projctor, etc.))

xrandr --output VGA-0 --right-of LVDS ( create a big screen where VGA-0 is right of LVDS )

2009年1月18日 星期日

an optimal solution for edge-contention is an optimal solution for out-degree? or vice versa?

There is a simple question:

an optimal solution for out-degree-minimization is an optimal solution for edge contention?

If we say a solution is optimal for edge-contention, is it an optimal solution for out-degree-minimization?

2009年1月17日 星期六

要做的

寫程式測試 file transfer problem 的 greedy 的演算法是否有反例

試 open64

REVIEW 曉偉的 paper

要閱讀的

Using Open64 based TLS compiler

Pin: Building Customized Program Analysis Tools with Dynamic Instrumentation
SuperPin: Parallelizing Dynamic Instrumentation for Real-Time Performance

Hill-Conf. Presentation Advice.pdf
Hill-Conference Etiquette.pdf
Hill-Writting.Tips.pdf
How to be a winner.pdf