There are occasions where the user might want to change the name of a pin we extracted from the PIN_REPORT_FILE. PartBuilder provides a function to rename the pins AFTER extracting the pin-data so that the user does not have to hand edit the PIN_REPORT_FILE they obtained from a Vendor. Editing the vendors file could affect the integrity of the data in the file, and if the user needed to update the file from the vendor, they would have to remember to make the same changes again.
This is where partBuilders SIG_RENAME_RULES can be used.
Anchor | ||||
---|---|---|---|---|
|
FILE or CONFIG_SETTING:
The SIG_RENAME_RULES Configuration setting is avialable in the MORE_OPTIONS popup menu or in the PINOUT_CONTROL TAB of the ALL_CONFIG_SETTINGS Popup
The RENAME_RULES Config Setting allows you to enter a comma seperated list of RENAME_RULES in the GUI Entry,
or enter a File Name that contains a list of SIG_RENAME_RULES.
The Tool first checks to see if the Entry is a valid filename. If it is, it opens the file and builds a list of RENAME RULES to use to change pin_names after they are extracted from the PIN_REPORT_FILE
AS A FILE:
A RENAME_RULES file contains a list of valid rename rules and comments
SIG_RENAME_RULE SYNTAX
A SIG_RENAME_RULE using Match/Replace or Join can be entered as follows
- MATCH_STRING:REPLACE_STRING
- checks all strings to see if they contain the MATCH_STRING... if it does, the occurrence of the MATCH_STRING will be replaced with the REPLACE_STRING
- !JOIN_,MATCH_STRING,JOIN_STRING
- checks all strings to see if they contain the MATCH_STRING if they do the current pin name is appended with the JOIN_STRING preceeded by the character after the !JOIN which in this case and most cases will be the '_'
The SIG_RENAME_RULE can also be a REPLACEMENT_DIRECTIVE. The CadEnhance tools support several REPLACEMENT_DIRECTIVES
!STRIP_LEADING_ZEROS
- Remove leading zeros in any pin_name OR pin_number in the pin database.
- This is very useful for BSDL files which sometimes use leading zeros in their pinnames and pinnumbers
- dq00 will be changed to dq0, dq09 will be changed to dq9
- pin A01 will be change to A1
- Remove leading zeros in any pin_name OR pin_number in the pin database.
!STRIP_LEADING_ZEROS_FROM_END
- This is for a case like intel signals 1p05_001
- we do not want to strip the p05 because it means something special... but we do want to strip the 001 down to 1
!FIX_ACTIVE_LOW (Added in release v22.1.1)
- This is very valuable in the CE_HDL tool where pinNames that start with '-' or end with '*' can be fixed
- -RESET or RESET* will be changed to RESET_N
- Bussed Names like: -DQ7 or DQ7* will be changed to DQ_N7 (to keeping the digit at the end so busses are properly maintained
The MATCH_STRING in the SIG_RENAME_RULES are sorted by length before they are applied. Only the longest match for a pin_name is applied.
This enables the user to target more specific matches like the following (without worrying about the order the SIG_REPLACE_RULES are entered in)
VSS:GND
AVSS:ANALOG_GND
In this case a pin named AVSS_25 would be changed to ANALOG_GROUND_25
VSS_25 would be changed to GND_25
a pinNamed BVSS_25 would be changed to BGND_25 because it only matches the VSS PIN_MATCH
#this is for a case like intel signals 1p05_001 # we do not want to strip the p05 because it means something special... but we do want to strip the 001 down to 1
PartBuilder accepts regular expressions on the left side of the colon in the WAS:IS rename rule. This allows the user precise control over which pins get renamed as shown in the following table.
CK:CK_P
this will replace any pin name that CONTAINS CK with CK_P...
If a pin named CKE in the exists pinList, it would be renamed to CK_PE which you might not want
CK0 would be renamed CK_P0 which you may or may not want
CK→CK_P
ALT_CK → ALK_CK_P
You might want:
CK0 → CK_P0 (maybe what you want)
You probabaly don't want:
CKE->CK_PE
CKP → CK_PP
CK# →CK_P#The '$' changes the above rule so that partBuilder will rename any pin name that ENDS_WITH CK with CK_P...
A pin named CKE in the pinList, would not be renamed by this rule, since it ends with an 'E'
A pin named CK0 would also not be renamed.
CK→CK_P
ALT_CK->ALT_CK_P
CKE→CKE (no change)
CK0 → CK0 (no change)
CKP → CKP (no change)
CK# → CK# (no change)
This is a regular expression match where the (\d+) is captured into the $1 variable which can be used on the other side of the replacement
\d+ means any number of digits
What this rule says is replace any pinName that ENDS_WITH (because of the '$') CK followed by any number of digits with CK_(the_captured_digits)_P
so CK0 would be replaced with CK_0_P, CK25 would be replaced with CK_25_P and CK25# would not be replaced because the pinName does not end in a digit.
CK→CK (no change (no digit at end)
ALT_CK→ALT_CK (no change)
CKE→CKE (no change)
CK0 → CK_0_P
CK25 → CK_25_P
CK25# → CK25# (no change)
CKP → CKP (no change)
CK#→CK_N
CK25# →CK25# (no change)
ALT_CK# → ALT_CK_N
CKE# → CKE_N
will replace any set of pin_names that start with a '-' to that pin_name_n
uses backmatching... the regular expression captures all characters after the '-' and stores them in $1 then we replace with $1_N
'-pce_rx0' → pce_rx0_n
'-low_sig' → low_sig_n
Using Renaming Rules with
Math OperationsIn v21.12.1 The CadEnhance tools added support to include Math operations using matching numbers in the Renaming Rule specs.
This is a very valuable addtion for the CE_HDL tool when you want to rename groups of pins in a large bus to a smaller bus
The Math operation is surrounded by exclamation points and includes a back reference from the match regexp
Supported Math operators
The math is accomplished using perl builtin math, so proper order of operation is maintained.
'+' addition
'-' subtraction
'*' multiply
'/' divide
note that the user should be careful not to specify a divide operation with a 0 as the divisor
Simple Increment Math Replace:
CB(\d+):DQ!$1+64!
here the match has one set of parenthesis so the digits after CB string will be captured in $1
The math operation says to add 64 to $1
results:
CB0 →CB64,
$1=0
math op = $1+64 =64
CB1 →CB65...
$1=1
math op=$1+64 =65
Math using 2 or more back matches
C(\d+)_D(\d+):DQ!($1+1)*64+$2!
Here the match has 2 sets of parenthesis so the digits after the 'CB' string will be captured in $1, and the digits after the '_D' string will be captured in $2
The math operation calculates $1+1*64 + $2
sample results:
C0_D1 -> DQ65
$1 is 0, $2 is 1 {DQ'(0+1)*64+1'} ,
C1_D1 -> DQ127 {DQ'(1+1)*64+1'}
$1 is 1, $2 is 1
Math using more than 1 operation
#C(\d+)_D(\d+)_(\d+):C!$1*2!_D!$3*20+$2!
Here the match as 3 sets of parenthisis, so the digits after the 'C' string will be captured in $1, the digits after '_D' will be captured in $2 and the digits after the last '_' will be captured in $3
The replacement uses 2 math operations to build the replace string
the first is $1*$2
the second is $3*20+$2
sample results
C1_D5_2 → C5_D45
$1=1,$2=5,$3=2
math op 1 $1*$2=1*5=5
math op 2 $3*20+$2 =2*20+5 =45
RR_REPLACE_CHAR_LIST
The RR_REPLACE_CHAR_LIST is a kind of REPLACEMENT_DIRECTIVE but it is provided separately from the SIG_RENAME_RULES entry or File.
It's purpose is to provide a list of restricted characters for the symbol_tool, and have all those characters replaced with a valid character the RR_REPLACE_CHAR_SUB
the list defaults to ()\/ so any and the RR_REPLACE_CHAR_SUB defaults to the _
Any occurrence of the restricted characters in the pin_names will be substituted to the RR_REPLACE_CHAR_SUB
This substitution occurs after all the SIG_RENAME_RULES have been applied.
Code Block | ||||
---|---|---|---|---|
| ||||
# rename rule1
VSS:GND
#rename rule 2
!JOIN_,GPIO28,(INT5_N)
#rename rule 3
!JOIN_,GPIO27,(INT4_N)
#rename rule 4
GPIO26:INT_3_N
|
title | Effect of the Rename Rules |
---|---|
linenumbers | true |