Subversion Repositories OpenARM Single-board Computer

Rev

Rev 118 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 118 Rev 121
Line 6... Line 6...
6
 
6
 
7
# Usage: djboxsym sample.symdef > sample.sym
7
# Usage: djboxsym sample.symdef > sample.sym
8
 
8
 
9
$y{left} = 400;
9
$y{left} = 400;
10
$y{right} = 400;
10
$y{right} = 400;
11
$y{labels} = 700;
11
$y{labels} = -100;
12
$labelpin = 0;
12
$labelpin = 0;
13
 
13
 
14
# Read in the file, storing information about each pin.
14
# Read in the file, storing information about each pin.
15
 
15
 
16
while (<>) {
16
while (<>) {
Line 63... Line 63...
63
    if (/\S/ && $side eq "labels") {
63
    if (/\S/ && $side eq "labels") {
64
	$labelpin --;
64
	$labelpin --;
65
	$pinside{$labelpin} = $side;
65
	$pinside{$labelpin} = $side;
66
	$piny{$labelpin} = $y{labels};
66
	$piny{$labelpin} = $y{labels};
67
	$pinlabel{$labelpin} = $_;
67
	$pinlabel{$labelpin} = $_;
68
	$y{labels} += 400;
68
	$y{labels} -= 300;
69
	$rlen{$labelpin} = &textlen($_);
69
	$rlen{$labelpin} = &textlen($_);
70
	next;
70
	next;
71
    }
71
    }
72
 
72
 
73
    # Regular pins are handled here.
73
    # Regular pins are handled here.
Line 153... Line 153...
153
    if ($boxwidth < $w) {
153
    if ($boxwidth < $w) {
154
	$boxwidth = $w;
154
	$boxwidth = $w;
155
    }
155
    }
156
}
156
}
157
 
157
 
-
 
158
 
-
 
159
for ($i = $y{labels}; $i <= 0; $i+=100) {
-
 
160
	my $w = $bw{$i}{labels};
-
 
161
	$w += 100 - ($w%100);
-
 
162
	#$w = (int($w/100) * 100) + (($w/100) > int($w/100))?100:0;
-
 
163
	if ($boxwidth < $w) {
-
 
164
		$boxwidth = $w;
-
 
165
	}
-
 
166
}
-
 
167
 
-
 
168
#printf STDERR "test: %d\n", $y{labels};
-
 
169
 
158
$boxwidth = $w{top} if $boxwidth < $w{top};
170
$boxwidth = $w{top} if $boxwidth < $w{top};
159
$boxwidth = $w{bottom} if $boxwidth < $w{bottom};
171
$boxwidth = $w{bottom} if $boxwidth < $w{bottom};
160
 
172
 
161
# Flip Y coordinates (we count from the top, but symbols coordinates
173
# Flip Y coordinates (we count from the top, but symbols coordinates
162
# are from the bottom).
174
# are from the bottom).
Line 174... Line 186...
174
    next unless $pinside{$p} =~ /top|bottom/;
186
    next unless $pinside{$p} =~ /top|bottom/;
175
    $pinx{$p} += &alignpin(($boxwidth - $w{$pinside{$p}})/2) + 300;
187
    $pinx{$p} += &alignpin(($boxwidth - $w{$pinside{$p}})/2) + 300;
176
}
188
}
177
 
189
 
178
# Labels are centered in the box.
190
# Labels are centered in the box.
-
 
191
# labels have to be top, lef
179
for $lp ($minpin..-1) {
192
for $lp ($minpin..-1) {
180
    $pinx{$lp} = &alignpin($boxwidth/2) + 300;
193
    #$pinx{$lp} = &alignpin($boxwidth/2) + 300;
-
 
194
    $pinx{$lp} = 300 + &textlen($pinlabel{$lp})/2;
181
}
195
}
182
 
196
 
183
# Version.
197
# Version.
184
print "v 20060123 1\n";
198
print "v 20060123 1\n";
185
 
199