C
Chandramohan Neelakantan
hello
The following is the code Ive been using to parse hardware desing
rules from a ASCII file based on ideas from Gunnar Hjalmarsson and
Matija Papec.
******************************************************************
# A sample rules page is in $contents
$contents = "10.01 Width of n+buried layer
3.6
1, R1
10.02 Enclosure of oxide isolation (L35)
0.3 all devices,
1, R7
except power npn
CEBEC
10.03 Distance to scribe line (inside DIE AREA)
20.0
1, R2
Note: N+ buried layer is NOT allowed in scribe line
areas.";
# Begin Parsing
while ( $contents =~
/(\d+(?:\.\d+)+)
\s+
([\w\-\s]+[\w\-]\s{1,3}(.*?)) # Description
\s+
(\d+.*?\s{3}) # Dimensions
\s{1,3}
(.*?) # Devices
\s{6,}
(\d,\s[A-Z]\d) # Fig
/gix)
{
print $1,"\n"; # Rule No
print $2,"\n"; # Description
print $4,"\n"; # Dimension
print $5,"\n"; # Apllicable Devices
print $6,"\n"; # Figure
$contents = $';
$contents =~ /(.*?)(?=\d+(?:\.\d+)+|$)/sg;
$contents = $';
print "******************************************************************\n";
}
******************************************************************
Each rule has
1. A Rule Number
2. A Rule description ( Additional note to this column *may* appear in
subsequent lines)
3. Dimension info
4. Applicable devices ( may be blank or words for this column could
appear in subsequent lines
5. Figure
There are many instances where it is difficult to associate text to
its appropriate column.
For example,
******************************************************************
10.02 Enclosure of oxide isolation (L35)
0.3 all devices,
1, R7
except power npn
CEBEC
******************************************************************
is a rule where the Applicable devices column entry is 'all devices
except power npn CEBEC'. Since the entry is spanned over a few lines I
find it difficult to associate it with the appropriate column. Also ,
the entry for this column may be empty
Here is another example:
******************************************************************
10.03 Distance to scribe line (inside DIE AREA)
20.0
1, R2
Note: N+ buried layer is NOT allowed in scribe line
areas.
******************************************************************
The Note actually belongs to the Description column.
I need to find a way in which I can attach each of the text
appearing in subsequent lines of a rule to its subsequent collumn.
PLease note that there may or may not be Notes and Applicable devices
column entry to each rule .
I think the code mentioned above is mostly right. I need help in
attching the text to its appropriate column.
I have uploaded a copy of a sample text file here
http://geocities.com/knchandramohan/1920.zip
Help appreciated !
MAny thanks
CM
The following is the code Ive been using to parse hardware desing
rules from a ASCII file based on ideas from Gunnar Hjalmarsson and
Matija Papec.
******************************************************************
# A sample rules page is in $contents
$contents = "10.01 Width of n+buried layer
3.6
1, R1
10.02 Enclosure of oxide isolation (L35)
0.3 all devices,
1, R7
except power npn
CEBEC
10.03 Distance to scribe line (inside DIE AREA)
20.0
1, R2
Note: N+ buried layer is NOT allowed in scribe line
areas.";
# Begin Parsing
while ( $contents =~
/(\d+(?:\.\d+)+)
\s+
([\w\-\s]+[\w\-]\s{1,3}(.*?)) # Description
\s+
(\d+.*?\s{3}) # Dimensions
\s{1,3}
(.*?) # Devices
\s{6,}
(\d,\s[A-Z]\d) # Fig
/gix)
{
print $1,"\n"; # Rule No
print $2,"\n"; # Description
print $4,"\n"; # Dimension
print $5,"\n"; # Apllicable Devices
print $6,"\n"; # Figure
$contents = $';
$contents =~ /(.*?)(?=\d+(?:\.\d+)+|$)/sg;
$contents = $';
print "******************************************************************\n";
}
******************************************************************
Each rule has
1. A Rule Number
2. A Rule description ( Additional note to this column *may* appear in
subsequent lines)
3. Dimension info
4. Applicable devices ( may be blank or words for this column could
appear in subsequent lines
5. Figure
There are many instances where it is difficult to associate text to
its appropriate column.
For example,
******************************************************************
10.02 Enclosure of oxide isolation (L35)
0.3 all devices,
1, R7
except power npn
CEBEC
******************************************************************
is a rule where the Applicable devices column entry is 'all devices
except power npn CEBEC'. Since the entry is spanned over a few lines I
find it difficult to associate it with the appropriate column. Also ,
the entry for this column may be empty
Here is another example:
******************************************************************
10.03 Distance to scribe line (inside DIE AREA)
20.0
1, R2
Note: N+ buried layer is NOT allowed in scribe line
areas.
******************************************************************
The Note actually belongs to the Description column.
I need to find a way in which I can attach each of the text
appearing in subsequent lines of a rule to its subsequent collumn.
PLease note that there may or may not be Notes and Applicable devices
column entry to each rule .
I think the code mentioned above is mostly right. I need help in
attching the text to its appropriate column.
I have uploaded a copy of a sample text file here
http://geocities.com/knchandramohan/1920.zip
Help appreciated !
MAny thanks
CM