Monday, August 13, 2012

xilinx fpga--terms

about speed grades.ref
There is no consistent definition of a speed grade for all devices. Even for Xilinx, speed grades mean different things depending on if you are referring to a FPGA or a CPLD. For CPLDs, speed grades represent the time it takes for logic to go through the device (eg. in <= out). So a -10 device means that the device is guaranteed to send a signal from an input pin thru to an output pin in under 10 nS. So for CPLDs, the lower the number, the faster the part is. This is standard for CPLDs across all vendors so this can be used for device comparison purposes.

  However for FPGAs, they don't use the same definition for speed grade. Originally speed grades for FPGAs represented the time through a look up table but now the speed grade doesn't actually repesent a timing path. I am not sure if it is the same for other vendors, but for Xilinx FPGAs higher numbers are faster. Each speed grade increment is ~15% faster than the one before it. So a -5 is 10% faster than a -4 speed grade. 

Arthur
~~~~~~

Jasper,
As Arthur indicated, it is a relative term that is really dependent on the specific family:
-for CPLDs, it is generally pin-to-pin delays in nanoseconds (lower # = faster)
-for old Xilinx FPGAs (pre-Virtex), lower # was faster
-for modern (Virtex and later) FPGAs, the higher # is faster.
The speed grade influences a variety of timing paramters in the FPGA, including fabric (slice), multiplier/DSP48x, BlockRAM, I/O, and other resources parameters.
You really need to consult the specific datasheet to see specific details for timing based on associated speed grades.
For example, Virtex-4 speed grades are -10 (slowest), -11, and -12 (fatest)
Virtex-5 spede grades are -1 (slowest), -2, and -3 (fastest)
There is no correlation between these numbers. It is really a relative metric of performance within a specific family.
Cheers,
bt
=======





Sunday, August 12, 2012

将calibre集成到cadence环境中

08-12
1.  确定.cdsinit位置,使用cdsuser路径下的。
安装Cadence IC后.cdsinit会在以下两个路径下存在:
<cds_install_dir>/samples/local/cdsinit - site customization
<cds_install_dir>/cdsuser/.cdsinit - user customization

2. 修改.cdsinit文件
skillPath=getSkillPath();
setSkillPath(append(skillPath list("/calibre_path/lib")));
load("calibre.skl");

3. OA 版本兼容性问题
不过SOC81的OA version 22.04-p032,我之前已经安装好IC610,其用的OA版本较老,当把OA_HOME指向SOC81的OA,则icfb启动不了,有以下错误提示:
/opt/eda/ic610/tools/dfII/bin/32bit/icfb.exe: /opt/eda/ic610/tools/lib/libgcc_s.so.1: version `GCC_4.2.0' not found (required by /usr/lib/libstdc++.so.6)

这个只有自己写脚本,对不同的应用启动调用不同OA_HOME来解决兼容问题。


Wednesday, July 25, 2012

双系统Ubuntu增加空间

By Rui Chen
前记:我是Dell Inspiron 1525的XP和Ubuntu 10.04 LTS的双系统,已经在Ubuntu下使用Gparted完成了对/dev/sda6的格式化。当前的/home所在分区为/dev/sda9。

在对/home进行分区扩大的过程中,我主要参考了两个帖子:
增多home空间从Windows增加磁盘空间给Ubuntu
其中,第二个帖子关于步骤二的第8步的命令
cd ~/chown name .dmrcchmod 644 .dmrc
cd /homechown name namechmod 755 name
是错误的,如果这样并排的多个命令,linux系统会以空格为分隔符,将只会执行cd ~/(以第一条命令为例),对应的正确做法应该是(ref: 增多home空间):
7.修改权限:cd ~/chown name .dmrcchmod 644 .dmrc cd /homechown name namechmod 755 name
但需要注意的是,两个帖子都没有强调,所有步骤需要开展的环境。如果是直接进入Ubuntu,进行mv /home /home.bak操作,则会一直提示device is busy。这是因为整个gnome-session都是在/home/username下进行的。所以需要做的是,转到recovery mode选择最下面的选项,在console下完成全部的操作。

需要多说的是/dev/hda10 /home auto rw 0 0。
文件行的格式模板为<file system>、<mount point>、<type> 、<options>、<dump>、<pass>
auto表示系统自动识别分区的格式,而因为知道sda6的类型,所以直接设定为ext4。
最后三个选项直接参考帖子fstab文件介绍,给出各自相关的解释:
4、<options>
这里用来填写设置选项,各个选项用逗号隔开。由于选项非常多,而这里篇幅有限,所以不再作详细介绍,如需了解,请用 命令 man mount 来查看。但在这里有个非常重要的关键字需要了解一下:defaults,它代表包含了选项rw,suid,dev,exec,auto,nouser和 async。
5、<dump>
此处为1的话,表示要将整个<fie sysytem>里的内容备份;为0的话,表示不备份。现在很少用到dump这个工具,在这里一般选0。
6、<pass>
这里用来指定如何使用fsck来检查硬盘。如果这里填0,则不检查;挂载点为 / 的(即根分区),必须在这里填写1,其他的都不能填写1。如果有分区填写大于1的话,则在检查完根分区后,接着按填写的数字从小到大依次检查下去。同数字 的同时检查。比如第一和第二个分区填写2,第三和第四个分区填写3,则系统在检查完根分区后,接着同时检查第一和第二个分区,然后再同时检查第三和第四个 分区。
尽管最后没有能够增大/home的大小,但还是用到了一些有用的命令,介绍在附录之中。

附录:相关命令

1.
fuser -m /home
ps aux | grep XX(fuser 显示的PID)

上面的命令是负责显示有哪些进程正在使用/home路径,而ps命令行,是显示PID(进程ID)的具体内容。在得到具体的PID之后,可以使用kill终止进程,正如前面所述,如果直接进入Ubuntu环境,会一直有个gnome-session,如果你kill掉它,会重新让你登陆。回过头来,你必须进入recovery mode完成所有操作。

2.
cp -Rpv src/ dest/
cp命令的-R, -r, --recusive,不像ls命令,是没有区别的。而-p(和--preserve一样)的作用是保留mode, ownership和timestamps。 -v就是verbose打印正在进行的操作。这其中,p比较有用。这条命令也是我在gnome环境下,无解device is busy报错后,想出来将/home中的内容保存到移动硬盘上,再进行硬盘格式化,挂载所使用到的命令。最后这个方法在console下被放弃。

3.
ls -l /dev/disk/by-uuid
这条命令主要是查硬盘分区的UUID,为修改/etc/fstab挂载硬盘文件做准备。

《增加home空间》原帖
增加home空间
忘记备份了,结果我的home虽然加大了,但是里面的内容被格了。。又交了次学费。
1.备份 /home 目录
mv /home /home.bak
2.如果 /home 目录已经挂载的状态,首先卸载,然后删除:
umount /home
rm /home
3.重新创建 /home 目录:
mkdir /home
4.将刚才格式化的分区挂载到 /home 目录:
mount /dev/sda8 /home
5.还原 /home 下的所有文件:
cp -R /home.bak/* /home
6.设回原来的用户目录的权限:
chown -R name:name file
7.修改权限:
cd ~/
chown name .dmrc
chmod 644 .dmrc 
cd /home
chown name name
chmod 755 name
8.编辑fstab,使新分进来的设备自动挂载:
vim /etc/fstab
编辑文件,/dev/hda10  /home  auto  rw  0   0
改为auto自动识别磁盘格式。 rw是可读可写。
最后reboot,进入系统查看 /home 和 / 的剩余空间。

Saturday, May 26, 2012

您和怹

看了郭德纲的《训徒》才知道中国的怹这一人称指代。两个字的发音上也是,你ni变您nin,而他ta便怹tan,至于这种变化也是加入鼻音,以示尊重。

自大一点念个臭字。

袁阔成的评书小段讲的挺像是单口相声的。

Friday, May 4, 2012

中国字和中国文化

文化是一个很广义的概念,有时候在一些电视节目上经常会碰到有些狂妄自大的人会自夸,贯通中西什么的,也许稍稍提点四书五经的内容,他们就要打退堂鼓了。而这些先秦时代的经典古籍在中国人的哲学思想以及生活行为的方式上产生了及其深远的影响。

我今天想说的只是其中的“字”。有趣的是,由于中国汉文化的延续同一性,汉字的跨越并没有时间上的阻隔,演变的只是不同的文字书写方式,字的内涵本意却随着经典的诠释而始终如一。所以,但凡有什么字的讹用,一定是对其的理解产生了偏差,而只是主观地进行了简化。而对汉字的诠释却又显露了中国文化的深层底蕴。


先说说这个斌字,翻看字典,说斌,通“彬”,人的文采和实质配合适当。形容气质温文尔雅,行为举止端正,语出《论语》,原文是:
论语·雍也》:“质胜文则野,文胜质则史,文质彬彬,然后君子。” 
也就是说斌应该算是一个化用,这种事情在古代并不鲜见,因为以前的书籍并不像现在机器排版印刷,都是通过手抄的方式进行穿越,而汉代蔡伦发明纸之前,人们更是需要将字书写在竹片上来进行传承。

东西
之前在《故事会》上看到过一个非常经典的小故事,他是通过五行来分析中国为什么会有“东西”的通称方式。在中国生活过一段时间的人都知道,“东西”就像是一个万能词,可以指代很多的物品。而故事中,清朝有个皇帝也曾有过同样的困惑,他就请来翰林学士,说这个“东西”究竟是个什么说法。翰林学士给出了五行论的观点。大意是,金木水火土,在方位上对应的是东西南北中,而水火不能近身,所以只能以东西代指世间万物。
有人会想,不是还有个土么?这个解释就比较简单了,古代人认为,土生万物,万物终归土。包括盘古开天辟地,女娲补天等神话故事也都是融入了这样的思想。

五行论
既然上文提到了五行,就不得不说说这种中国人最为古老的物质观。五行指的是,积木水火土。而五行论则认为世界是由这五种元素所构成。这五个要素的盛衰,而使得大自然产生变化,不但影响到人的命运,同时也使宇宙万物循环不已。
就相对东西这样的文化用语的影响一样,这是一个内涵极为丰富的概念,对中医和天文历法也都有着影响。比如说,中医认为,木为人体内的肝和胆,金为肺和大肠,水为肾和膀胱,土为脾和胃,火为心和小肠。
“木曰曲直”,代表生长、升发、条达、舒畅的功能,在人体为(臟)和(腑)。
“金曰从革”,代表沉降、肃杀、收敛等性质,在人体为(臟)和大腸(腑)。
“水曰润下”,代表了滋润、下行、寒凉、闭藏的性质,在人体为(臟)和膀胱(腑)。
“土曰稼檣”,代表了生化、承载、受纳等性质,在人体为(臟)和(腑)。
“火曰炎上”,代表了温热、向上等性质,在人体为(臟)和小腸(腑)。 
在天文历法上也会有金星,木星,水星,火星,土星的说法。

至于五行与方位的关系,并不是像上位说的东西南北中与金木水火土一一对应,按照中医的理论,五行与方位,五气,五味都是想对应的,先后顺序应该是(ref.)
方位:东 南 中 西 北
五行:木 火 土 金 水
五脏:肝 心 脾 肺 肾
五味:酸 苦 甘 辛 咸
五色:青 赤 黄 白 黑
有时候经过一番考证、探究之后,会觉得中国字或者是中国文化是多么的优美有韵味。而这正是传统文化弥足珍贵之处。

Tuesday, May 1, 2012

Chinese Farewell

In farewells among the Chinese part of Encountering the Chinese, the author states the interesting differences between the American style and Chinese style. The whole farewell generally consists of two phases, initiate the idea and actually depart.
It is said, the Americans generally makes a large time gap between the two phases, while the Chinese just go in the immediate way. The causes of the departures varies too. It also relates to the individualism and collectivism. During the phase two, the hosts also treats in different ways too, in the American way, the host just simply gives the waves, while the Chinese may give a long companion and continue to converse.

Comments:
1. The etiquette in farewell can be also discussed along with the Chinese social culture and core value as well. As result, the farewell may be classified and fit into different social groups bonded with either working relationships or family relationships or friendships. So, the farewell scenario depicted may not happen every where or every time. That actually depends on how close the friends are. If not so close, I think the American style will typically adopted with socially warm farewell.
2. Another thing I would like to say, is about the housing structure and layout. Unlike U.S., Chinese agriculture and collectivism determines the close relationship in the community in the countryside. They know meet each other every day and meet each other very well. The doors in many houses in the countryside may just left open during the day. Also, they do not have reliable transportation if they are paying a long visit. So the host's companion can be viewed as caring more about the visitor for security consideration.
However, with rapid developments, many places have built lots of tall housing buildings, and people does not know each other so well even they are in the same building. So, the social bonds between each other is quite different now. If just social farewell, people are more and more used to the American style.

Chopsticks and Chinese Culture

By Rui Chen
After hearing about the cross talker performer Degang Guo, I have been attracted to the history of Chopsticks and its behind idea. When performing On Eating, he did come up with some interesting ideas connecting the Chinese eating culture with the oldest book I Ching(aka. Book of Changes). What he said, I quote and translate here:
The chopsticks consists of two. When held in hand, one is yang, the other is yin, which means one is proactive, the other one is reactive. The two ends of chopstick are round and square, respectively. This is equivalent to the two divinatory trigrams in the eight trigrams. And the round end is for the earth, while the other end is for the heaven. If including the fingers in the middle, that's also called Three Forces in the world. Also there is a famous idiom for it, People regard food as their heaven.
If we goes further, yin and yang, which are the Chinese general terms for female and male, are illustrated a lot in   another famous book, Tao Te Ching by Laozi. Actually, in ancient China, the relationship between the earth and the heaven, along with the genesis of the world, is discussed a lot, just like what happened in the western history. The great thinkers always have their unique opinions, so does Laozi.
Know masculinity, Maintain femininity, and be a ravine for all under heaven." (chap. 28, tr. Mair) 
All things have their backs to the female
and stand facing the male.
When male and female combine,
all things achieve harmony. (chap. 42)
This statement can be another viewpoint for what happened in using chopsticks. Another statement, which I like very much is,
The Tao gives birth to One.
One gives birth to Two.
Two gives birth to Three.
Three gives birth to all things.(chap. 40)
 There is also a good statement regarding food is Food and Sex are part of human nature by Confucius, who lived at the same time as Laozi.

Reference
I Ching http://www.akirarabelais.com/i/i.html
Tao Te Ching http://academic.brooklyn.cuny.edu/core9/phalsall/texts/taote-v3.html
Analects http://classics.mit.edu/Confucius/analects.html

Saturday, April 21, 2012

3805 South Madelain Dr., San Jose

New place, new motive.

1. 住apartment, 进去前最好是拍照记录下一些不好的地方。
2. 搬出来前如果需要换地毯,可以自己找搬家公司考虑
3. 和房东的纠纷,多看看帖子

Friday, April 20, 2012

转身: A poem


转身
Rui Chen

并不愿以真面目示人
但眼中却流露期许
猜忌 流言
胡妄之中
要的却也只是一个理由

转身 却未离开
假面舞会之中的流光错影
聚焦的却也 并非你我
散落在角落之中心情
萌动地想要了解别人

春风拂过青涩的面颊
有些话语却总难倾吐
总会是想着
宏大的志向来掩饰
稚嫩的情感
然而走走停停的诠释之中
却也有些迷离

面朝大海
博爱却也是翻斗的浪花
并没有这炫目的挑剔
但却在波涛阵阵之中
怀揣着最深沉的撞响
这种协奏之中契合
注写着人生的韵脚

海风拂面
晃动不平的行程
海鸥时近时远
但海天一线 却无限延伸到
视线的深处
在这同一样的维度上
我体味着不可言说的颠簸

追逐之中
记得与不记得
忘却与回忆
一并在这夜色之中
弥散,淡去

Sunday, April 1, 2012

to 爱人: a poem


我喜欢你 这是一种感觉 不仅仅是在白天
睡梦之中 你的留影  也会让梦甜蜜
我喜欢你 这是一种声音
在静静的仿佛之中 也会幻化为一种发自心底的 纯美干净

我喜欢你 喜欢你身上的体味
静静的幽香 惹人怜爱
我喜欢你 喜欢你曼妙的舞步
峰回路转之间 淌现的是你的生活态度

我喜欢你 有时也会痴想
在一望无垠的大海边

你我坐拥 注视斜阳的静谧
波光点点 鸟鸣阵阵
相对无言的专注 体味着大自然的和谐
并不需要那种浑身的激情 却也能享受通彻灵魂的恬淡
即使是身旁的新婚眷侣 也会投来羡慕的目光

我喜欢你 我常常幻象
相忘于江湖 不分你我
在果敢与专断之间 你更甚于我
在柔情与缠绵之间 我并不输于你

我喜欢你 日日夜夜
深入我的骨髓 幻化成一种心灵的意志

Thursday, March 29, 2012

Use vcs to sim systemc file

My ubuntu is 10.04, the default g++ is 4.4. But for simulating systemc file, you need to specify the lower version of g++.

The problem can be solved as follows:
1.  Go to the archive link to download the following five files:
    gcc-3.4-base_3.4.6-6Ubuntu3_i386.deb、
    gcc-3.4_3.4.6-6Ubuntu3_i386.deb、
    cpp-3.4_3.4.6-6Ubuntu3_i386.deb、
    g++-3.4_3.4.6-6Ubuntu3_i386.deb、
    libstdc++6-dev_3.4.6-6Ubuntu3_i386.deb
Put them into the same folder, like g++-3.4, and then run command "dpkg -i *.deb";

2. redirect the g++ link to use the lower version
   You can find the g++-3.4 with find / -name g++-3.4* command, however, it is already inside the /usr/bin if you are familiar. All you need to do right now is to redirect the g++ to your newly installed file.
   The command is "ln -sf /usr/bin/g++-3.4 /usr/bin/g++";
   There is also another way, check the reference link(in Chinese)

With the user guide, the easiest way is to run simulations of your systemc file is :
   syscan adder.cpp
   syscan adder_tb.cpp adder_main.cpp
   vcs -sysc sc_main
   ./simv

Tuesday, March 27, 2012

Verdi and VCS cosim

1. add fsdb functions into your testbench
  $fsdbDumpfile("test.fsdb");
  $fsdbDumpvars;
use `ifdef macros to optionally enable. Need to specify +define+DumpFSDB(`ifdef DumpFSDB) in your vcs command options

2. Find fsdb PLI lib files
  for vcs ${NOVAS_INST_DIR}/share/PLI/VCS/${PLATFORM}/pli.a(or novas.tab)
  also include the lib directory
  ${NOVAS_INST_DIR}/share/PLI/lib/${PLATFORM}
  better to specify the path for the LD_LIBRARY_PATH within your ~/.bashrc file

3. Specify the PLI archive files
  My method is copy the files(novas.tab and pli.a) into the working directory, and use the vcs command:
  vcs filename.v +v2k -P novas.tab pli.a(${abosulute_path/pli.a} if not copied)

4. ./simv to get the .fsdb file

5. use Verdi to check the .fsdb file
  command like, verdi -2001 -f vcs.args -ssf test.fsdb

Monday, February 13, 2012

深夜上Trail


将近傍晚的时候,准备出去小跑锻炼下身体,就想起了之前屡次经过的trail。在佛罗里达出去玩的时候,也是经常会走一些trail,但是也还没有看到过把trail设在高处,像高架桥一样的。就这样,兴气冲冲地跑了过去。傍晚的车流确实跟早上的很不一样,记得上次早上6、7点的时候,都可以躺在路上睡觉,而不用担心有车路过。这绝不是说天还未亮,只是因为早晨的时候天气反而会凉一些,所以不敢一试。

车水马龙的光线映射着两旁更加的黑魆,如果不是有着行人路灯的指示,恐怕一些路段也确实是很难看清行人。这是雨过之后,但偶尔也会有自行车的路人从身边经过,身负行囊,行色匆匆,回家的心切映照在尾灯上的一闪一闪。想象中这trail还真是和家有一段距离,都快到了mountain view 的caltrain中转站了。

Trail并不是想象之中的设施齐备,更有着一种城市之中的原生态,完完全全的伸手不见五指,偶尔远处自行车的尾灯还能让我确认即使是有些湿漉的路面也还有这行人路过。面对这陌生的周遭,我其实还是有些莫名的不镇静,审查了一下周围的情况,我这才决定上了那个类似高架桥的trail。木制的地面,接着车水马龙的前车灯以及旁边的微暗的路灯,还能辨出雨过的痕迹。在Sunnyvale,下雨可不是一件容易的事情,经常是等上20天,也才会有场让人有些春意的小雨;时常也会看到天空逗留着的积云,但总是在下雨之时,被阳光照散。小雨固然是可爱,有时更有种惬意的魅力,但在这trail上,我却总是有种说不出的味道。湿滑的路面总是能让我联想起电影中的镜头,亦或是南方的那场雪灾,又想起了当时因为跌跤而摔的骨折的同学。但黑夜的确有种魅惑,又也许是走了一段路,在这个时间,这个地点,我总是有种向前的冲动。

于是,我缓步上前,将我的步子尽量迈的小一些(前几天打篮球,这双鞋还给我造成过麻烦),但站在车水马龙上面,我又有些不淡定了,嗖嗖的冷风刮到我的身上,让我感到了些寒意,而此时ipod里面有正好飘出了all angels的歌曲。真是有点搞笑,反反复复,我又是在桥上面来回踱步,客服着心理上的障碍。好不容易是迈过了这道坎,却又在caltrain的铁轨上方犯起了愁,我安慰自己,照几张照片表示自己来过,却又在未知的前方面前躁动不安。这时候我在想,我是怎么了?我似乎从来没有摆脱过小时候的那个自己,都这么大的人了,却还在这种小事上面犯愁。我想到了,小时候经常做噩梦的时候,事实上,那种做噩梦的心理体验似乎从来没有离开过我。我又想着室友过马路的过分谨慎小心,这个时候看看自己,却总是摆脱不了着恐高症的心理。也许知道现在我也并没有完全地客服掉噩梦对我的影响,我只是学会了更好地去回避,将自己的体验融入到噩梦之中,想到这里,我有了一些线索。我试图去转移自己的注意力,让自己融入到黑暗对我的吸引之中,慢慢地我通过了拱桥,走到了对面。

回来的路上,我有时也在玩味过去一个小时里对我的生命体验。如何放弃自己,才能突破自我,享受到更多的东西。