2009年4月25日星期六

在blogpot中显示程序源代码

在blog上写些技术性的东西,总有需要将源代码在帖子中显示的需求。在网上找了好久,相关的资料倒是不少,但自己毫无CSS基础,看了别人的说明自己也搞不定,一个大问题就是不知道这些方法中所提供的CSS代码放置在模板中的哪个位置。最后在下面这篇博文的评论/回复中找到了答案,这段CSS代码需放在模板的HTML代码的</head>前(“布局”-->“修改HTML”)。我放在了下面这段的后面了。
-----------------------------------------------
Blogger Template Style
Name: Rounders 3
Designer: Douglas Bowman
URL: www.stopdesign.com
Date: 27 Feb 2004
Updated by: Blogger Team
----------------------------------------------- */

但是这个解决方法对缩进,"<"和">"的支持好像不是很好,不知是否有更好的解决方法~~

国良先生的博文:
http://klcintw4.blogspot.com/2006/11/blog-post_03.html

2009年4月24日星期五

如何修改DC关于wire的命名规则

用DC综合一个设计,在一个子模块中出现了名字为N110和n110的两个wire,在APR flow中,如果不区分大小写,就会有问题。解决方法如下:
在.synopsys_dc.setup中加入下面这个name rule
define_name_rules Jerry_Rule -restricted "mailto:!@#$%%5E&*%28%29%5C%5C-%5B%5D/" -case_insensitive -first_restricted "0-9 _ \\"
在综合脚本compile后,write netlist前加入下面这句
change_names -rules Jerry_Rule -hierarchy

其中,-case_insensitive 是让DC不产生这种仅大小写不同的wire name的选项。

另外,我写了个Perl Script,可用于check 综合后的netlist中是否有这种仅大小写不同的wire name。

下面的"while() {"实际为"while(<SRCFILE>) {", 下面这个代码框在处理<和>时会有问题,不知道有什么好的解决方法~~

#! /usr/bin/perl -w
use strict;

my $srcfile = $ARGV[0];
my @var;
my $word;
my %var_hash;
my $key;
my $value;
my $module;

open SRCFILE, "< $srcfile" or die "can not open the source file:$!";
while () {
@var = split /\s+\(,;\)/;
if (/\bmodule\b\s+(\w+)/) {
$module = $1;
print "Begin parser module $module...\n";
foreach $key (sort keys %var_hash) {
delete $var_hash{$key};
}
} elsif(/\bendmodule\b/) {
print "End parser module $module.\n";
}
foreach $word (@var) {
unless ($word =~ /(^\s+$)(^$)/) {
unless (exists $var_hash{$word}) {
foreach $key (sort keys %var_hash) {
if (($word =~ /\b$key\b/i) && ($key =~ /\b$word\b/i)) {
print "ERROR: $word and $key are the same except case\n";
}
}
}
if ($word =~ /^\w+/) {
$var_hash{$word} = 1;
}
}
}
}