Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
SIG_RENAME_RULES_FILE_INFO
SIG_RENAME_RULES_FILE_INFO

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

  1. MATCH_STRING:REPLACE_STRING
    1. 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
  2. !JOIN_,MATCH_STRING,JOIN_STRING
    1. 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

  1. !STRIP_LEADING_ZEROS 

    1. Remove leading zeros in any pin_name OR pin_number in the pin database.
      1. This is very useful for BSDL files which sometimes use leading zeros in their pinnames and pinnumbers
    2. dq00 will be changed to dq0, dq09 will be changed to dq9
    3. pin A01 will be change to A1 
  2. !STRIP_LEADING_ZEROS_FROM_END

    1. This is for a case like intel signals 1p05_001
    2. we do not want to strip the p05 because it means something special... but we do want to strip the 001 down to 1
  3. !FIX_ACTIVE_LOW (Added in release v22.1.1)

    1. This is very valuable in the CE_HDL tool where pinNames that start with '-' or end with '*' can be fixed
    2. -RESET or RESET* will be changed to RESET_N
    3. 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

AnchorSIG_RENAME_EXAMPLESSIG_RENAME_EXAMPLESUSEFUL RENAMING MATCH STRINGS

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.

RENAME_RULENotesexamples pin names

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#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)

CK(\d+)$:CK_$1_P

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_NWill replace any pinname containing CK# with CK_N

CK#→CK_N

CK25# →CK25# (no change)

ALT_CK# → ALT_CK_N

CKE# → CKE_N

^-(\S+):$1_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 Operations

In 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. 

  1. '+' addition

  2. '-' subtraction

  3. '*' multiply

  4. '/' divide

    1. note that the user should be careful not to specify a divide operation with a 0 as the divisor

  1. Simple Increment Math Replace:

    1. CB(\d+):DQ!$1+64!

    2. here the match has one set of parenthesis so the digits after CB string will be captured in $1

    3. The math operation says to add 64 to $1

    4. results:

      1. CB0 →CB64,

        1. $1=0

        2. math op = $1+64 =64

      2. CB1 →CB65...

        1. $1=1

        2. math op=$1+64 =65

  2. Math using 2 or more back matches

    1. C(\d+)_D(\d+):DQ!($1+1)*64+$2!

    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

    3. The math operation calculates $1+1*64 + $2

    4. sample results:

      1. C0_D1 -> DQ65

        1. $1 is 0, $2 is 1 {DQ'(0+1)*64+1'} ,

      2. C1_D1 -> DQ127 {DQ'(1+1)*64+1'}

        1. $1 is 1, $2 is 1 

  3. Math using more than 1 operation

    1. #C(\d+)_D(\d+)_(\d+):C!$1*2!_D!$3*20+$2!

    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

    3. The replacement uses 2 math operations to build the replace string 

      1. the first is $1*$2

      2. the second is $3*20+$2

    4. sample results

      1. C1_D5_2 → C5_D45

        1. $1=1,$2=5,$3=2 

        2. math op 1  $1*$2=1*5=5

        3. 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
titleexample RenameRules File
linenumberstrue
# 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
Code Block
titleEffect of the Rename Rules
linenumberstrue
effect of rename rule1: Any occurrence of 'VSS' in a PinName will be replaced with GND VSS_1->GND_1 AVSS_25_SPECIAL=>GND_25_SPECIAL effect of rename rule2: pin GPIO28 will be JOINED with _INT5_N to create GPIO28_INT5_N effect of rename rule3: (!JOIN_) pin GPIO27 will be JOINED with _INT4_N to create GPIO27_INT4_N effect of rename rule 4 any occurrence of GPIO26 in a pin name will be replaced with INT_3_N