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