From 3a6ddc8c4bc95f0cd7486e45816f07a6cc070394 Mon Sep 17 00:00:00 2001 From: ian Date: Fri, 22 Oct 2004 14:40:49 +0000 Subject: [PATCH] invert bit sense of moveable feature bits --- layout/segcmapassign | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/layout/segcmapassign b/layout/segcmapassign index 1ab9030..ef5712a 100755 --- a/layout/segcmapassign +++ b/layout/segcmapassign @@ -34,8 +34,8 @@ # 6 bits moveable feature and position # each moveable feature has an unambiguous prefix # the remainder of the bits are the position of that feature -# the feature all-bits-1 (0b111111) is for fixed track -# (so every moveable feature prefix must contain at least one 0) +# the feature all-bits-0 (0b000000) is for fixed track +# (so every moveable feature prefix must contain at least one 1) # BUT all of the bits are in the reverse order (so the # MSbit of GREEN is the LSbit of the moveable feature position) # @@ -98,17 +98,17 @@ sub cssnmap ($$$$) { our ($segnum) = 1; -our ($conf,$posbit,$posbiti,$nextfree); +our ($conf,$posbit,$posbiti,$abovenext); foreach $seg (sort keys %seg) { $si= $seg{$seg}; $si->{Num}= $segnum++; die if $si->{Num} >= 1024; - $nextfree= 0; + $abovenext= 0x40; printf("S %s 0x%x\n", $seg, $si->{Num}) or die $!; - cssnmap($seg,'', $si->{Num}, 0x3f); + cssnmap($seg,'', $si->{Num}, 0x00); foreach $movfeat (sort { $si->{Feat}{$b}{Max} <=> $si->{Feat}{$a}{Max}; } keys %{ $si->{Feat} }) { @@ -116,10 +116,11 @@ foreach $seg (sort keys %seg) { for ($posbit=1,$posbiti=0; $posbit<=$fi->{Max}; $posbit<<=1,$posbiti++) { } - $fi->{Prefix}= $nextfree; + $abovenext -= $posbit; + die "too many $seg" if $abovenext <= 0; + $fi->{Prefix}= $abovenext; $fi->{ConfigMask}= $posbit-1; $fi->{ConfigBits}= $posbiti; - $nextfree += $posbit; printf("F %s 0x%x %s 0x%x %d 0x%x\n", $seg, $si->{Num}, $movfeat, $fi->{Prefix}, $fi->{ConfigBits}, $fi->{Max}); @@ -127,7 +128,6 @@ foreach $seg (sort keys %seg) { cssnmap($seg, $movfeat.$conf, $si->{Num}, $fi->{Prefix}+$conf); } } - die "too many $seg" if $nextfree > 0x03f; } STDIN->error and die $!; -- 2.30.2