Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

The Structure and Syntax of the CadEnhance Symbol Description Language (SDL) is described here

Symbol Description Language Structure

The Symbol Description Language (SDL) was designed to be efficient, simple to understand and easy to enter.

SDL KEY_WORDS and constructs are never case-sensitive. 

An SDL File is a collection of ordered SYMBOL_NAME_DEFINITIONs enclosing MATCH_STATEMENTS and Spacer_Commands.

SYMBOL_NAME_DEFINITIONs and MATCH_STATEMENTS and Spacer_Commands can also appear between the start and end of special Loop_Directives

SDL also supports Simple Variable Substitution commands.

SYMBOL_NAME_DEFINITION

A SYMBOL_NAME_DEFINITION is used to instruct partBuilder to start placing matching pins into a named symbol.

It has 2 parts, a beginning:

SymbolName=

and an end which is just the terminating semicolon.

';'

The SymbolName is the actual name you want to use for the symbol and it should not contain spaces

 in the simple sample file, the start of the first SYMBOL_NAME_DEFINITION  was

DRAM_ACTL_PINS=

That was followed by several MATCH_STATEMENTS  

and was terminated by the

';' 

character

It instructed partBuilder to create a Symbol named DRAM_ACTL_PINS as a place to add the pins matching all the MATCH_STATEMENTS that follow until the SYMBOL_NAME_DEFINITION is closed.

MATCH_STATEMENTS

MATCH_STATEMENTS are  what tell partBuilder which pins to place within the current symbol, what side to place them on  and any other modifier to enable creating special graphics or properites for the pins that match.

MATCH_STATEMENTS are built out of   LOCATOR, MODIFIER and PIN_MATCH elements

The simplest MATCH_STATEMENT only contains a LOCATOR and a PIN_MATCH, and is entered as

LOCATOR=>PIN_MATCH

The equal-Arrow "=>" separates the PIN_MATCH from the list of LOCATORS and MODIFIERS

MODIFIERS are added on the left hand side of the '=>' either before or after the LOCATOR.

For clarity and easier cut and paste in Excel, our examples will show the LOCATOR first.

MODIFIERS and LOCATORS are separated by the colon character ':' as follows;

LOCATOR:MODIFIER1:MODIFIER2:...MODIFIERn=>PIN_MATCH

There is no restriction on the number of valid MODIFIERS that can be included in  a MATCH_STATEMENT. 

It should be obvious that only one LOCATOR is used per MATCH_STATEMENT 

Some simple MATCH_STATEMENTS are provided in the table below to help get a feel for what they look like as you read more about the structure of them.

Examples of Simple MATCH_STATEMENTS.

MATCH_STATEMENTSimple Operation*Notes
left=>a[15:0]

puts bus pins a15...a0 on the left hand side of the symbol starting from the current position on the left hand side



right:dpair=>clk_p


puts diff_pair mates clk_p and clk_n** consceutively on the right hand side of the symbol using the currently configured defaults for diff pair spacing

**presumably clk_n

top:is_pin=>1..17places pins 1 to pin 17 on the top of the symbol
bot:bubble=>reset_nplaces pin matching reset_n on the bottom and puts an inversion bubble between the pin and the symbol



LOCATORS

The purpose of the LOCATOR is to tell partBuilder what side of the symbol to place the matching pins on.

Part builder creates one list for each side  of the symbol, and as it sees a locator, it pushes the matching pins 

Valid Locators are mostly obvious, and are explained in the following table

LocatorEffect
LEFTplace matching pins on the Left Hand Side of the symbol
RIGHTplace matching pins on the Right Hand Side of the symbol
BOTHdistribute the matching pins equally on the Left and Right Hand sides of the symbol
TOPplace matching pins on the top side of the symbol
BOT or BOTTOMplace matching pins on the bottom side of the symbol
AUTO

place matching INPUT pins on the Left Hand Side of the symbol

place matching OUTPUT or INOUT pins on the Right Hand Side of the symbol

distribute all other pin_types equally on the Left and Right Hand Sides of the symbol

MODIFIERS

Valid Modifiers are explained in the following table. Modifiers may be further broken down by partBuilder to impart extra information as shown

MODIFIEREffectSpecial Notes
DOT or BUBBLEInstructs PartBuilder to Add an Inversion Bubble in the proper place for any matching pin
CLK or CLOCKInstructs PartBuilder to Add a clock indicator like '>' in the proper place for any matching pin
SHORTInstructs PartBuilder to create a SHORT Pinworks for Eagle and Orcad Symbols
ZEROInstructs PartBuilder ORCAD zero Length Pins
HIDDEN

Instructs partBuilder to create a Hidden Pin.


This currently only works with AllegroHDL and is not reccomended
VECTOR or VECTORED

Instructs PartBuilder to create one symbol pin to represent 2 or more pins.


This currently only works with AllegroHDL and can be used to significantly reduce the size of power symbols
IS_PINInstructs PartBuilder that the PIN_MATCH should be applied to the Pin Number instead of the Pin Name

This makes it very easy to build parts where you layout the pins like they appear on the physical symbol.

Also very efficient when building connectors organized by row or column

DPAIR

DPAIR_{OPT_SUFFIX}

Instructs PartBuilder to place both the matching diff_pair pin AND its mate pin in sequenceThe DPAIR Modifier can be appended with a suffix to impart more information to override the default diff_pair spacing that is configured for partBuilder.
PSG_{swapGroupName}

Instructs PartBuilder that the matching pins are a member of a PIN_SWAP_GROUP.

PartBuilder maintains a list of all the PIN_SWAP group names and properly annotates the matching pins so they can be included in the PIN_SWAP in the PCB side.

The name of the pinSwapGroup must be provided in the suffix to the PSG_ modifier.

This is currentyl supported for AllegroHDL

PIN_MATCHES

The PIN_MATCH is the string that PartBuilder uses to test all pins in the extracted pinData for a match. 

PIN_MATCHES may be entered as a simple string or with a wildcard.

PartBuilder treats all the PIN_MATCHES it extracts from the SDL as a Regular Expression. It actually converts the wildcard '*' internally to the '.*' used in Regular Expressions.

They may also be entered as a valid Perl Regular Expression.

PartBuilder treats all the PIN_MATCHES it extracts from the SDL as a Regular Expression. It actually converts the wildcard '*' internally to the '.*' used in Regular Expressions.

A Regular Expression is a pattern describing a certain amount of Text.  The Regular Expression can be very general or very restrictive.

In the simplest context, PartBuilder uses a regular expressions to determine if a Pin contains the PIN_MATCH pattern. 

If the PIN_MATCH  is entered as "DQ", PartBuilder will match any pin that Contains DQ anywhere in the pinname.

Excellent references for Regular Expressions exist on the web like the one at this link.

 

www.regular-expressions.info


PartBuilder Bus-Enhanced Regular Expressions.

PartBuilder does some behind the scenes work to change the PIN_MATCH  Regular Expressions to enable  placing  bussed pins seamlessly

Its not truly necessary to understand this detail, but In a normal regular expression, the '[]' characters in the pattern match enclose a list of characters to match against

If you were comparing a list of pins dq7 dq6 dq5 dq4 dq3 dq2 dq1 and  dq0 using the regular Expression 'dq[0:7]' , the pattern would only match dq0 and dq7 (and funny enough dq:).

You could get more useful results with 'dq[0-7]' (because 0-7 inside the square brackets says to match any character between 0 and 7) but unfortunately that would not enforce the order of the pins. 

In order to work around this, when PartBuilder sees the 'DQ[0:7]' in a PIN_MATCH it  expands it to 8 seperate PIN_MATCHES DQ0, DQ1, DQ2... DQ7** which are then used as pattern matches.

It also maintains the order of the bits so that they will be added to the symbol in LSB→MSB order if you enter busName[0:7] or MSB→LSB order if you enter busName[7:0]. As described in the table below, it also appends whats called a zero-width-lookahead assertion at the end fo each  to insure that DQ18 doesn't match DQ1 but it would still allow a match of dq1_p

(**it also appends a  zero-width-lookahead assertion to each match to ensure that no other digits are following the ones we want so that DQ18 doesn't match DQ1) 

Examples of Useful PIN_MATCH Regular Expressions

PIN_MATCHEffectNOTES
DQPartBulder will match any pin that contains DQ
DQSPartBuilder will match any pin that contains DQS
^DQS0PartBuilder will match any pin that STARTS with DQS0the caret '^' enforces the start of word boundary
DQ[7:0]

PartBuilder will expand to 8 matches DQ7, DQ6, DQ5... DQ0**

it will match any pins that contain any of those strings

so

DQ7,DRAM_DQ6_BUS,DQ5_F would all match

DQA7, DQ06... would not match

note that DQ3_P and DQ1_N would match but

DQ31_P and DQ18_N would not


In the category of too much information:

DQ1 seems like it would match because it contains DQ1,

but when partBuilder expands the PIN_MATCH it adds

**the zero-width lookahead assertion to assure that any character except another number can match

^DQ[0:7]

PartBuilder will match any pin that STARTS with DQ0 or DQ1... DQ7

L_DQ0 would not match


DQ[0:7]$

PartBuilder will match any pin that ENDS with DQ0 or DQ1 ... DQ7

DQ0_L would not match since it doesn't end with 0,1,2,3,,4,5,6,or 7

the dollar Sign '$' enforces the end of word boundary
^DQ[0:7]$

PartBuilder will expand to a list of matches

^DQ0$, ^DQ1$, ^DQ2$... ^DQ7$

and will only match DQ0,DQ1,DQ2,DQ3...DQ7...

Would not match L_DQ0, DQ00, DQ01 .....

The caret '^' says it must start with the D and the $ says it must end with the digit at the end

IO_.*?_35

or

IO_*_35

PartBuilder will match any pin that contains IO_, and _35

it would match:

IO__35, IO_A_35, IO1_PIN1_35,

IO_THIS_IS_A_LONG_NAME_35

it would not match IO_A_36, IO_A_37

nor would it match IO35 or IO_35 (since we need 2 underscores)


the '.*?' (which could also be be entered as '*') looks for any number of any of characters

partBuilder converts the '*' to a '.*?' to make it easier to enter wildcards for those not familiar with

Regular Expressions. The ? is special and necessary because it makes the match stop if it sees the _35 after it.


This particular regular Expression is very powerful when building parts with Pins that have

similar names grouped into numeric banks like FPGAs and CPLDS.

IO\d+_\d+

Would match:

IO0_5, IO7324_8910

Would not match:

IO0A_5 because it is not looking for the 'A'

or IO_5 because we need a digit after the IO

the \d+ finds 1 or more consecutive digits in a row.

if we used "IO\d*_\d+", it would match IO_5 because \d* says find 0 or more consecutive digits.

SPACER_COMMANDS

SPACER_COMMANDS allow the user to easily control spacing between groups of pins

There are 3 types:

  • SINGLE_SPACERS:
    • LOCATOR=>Spacer,
  • MULTIPLE_SPACERS:
    • LOCATOR=>SPACER[5:0]
  • and SPACER_DIRECTIVES:
    • !BALANCE_SYMBOL_SIDES+n (or !BSS+n)

The first 2 resemble the MATCH_STATEMENTS pretty closely

LOOP_DIRECTIVES AND VARIABLE SUBSTITUTION

SDL Loop Constructs and Variables can really enhance the efficiency of creating parts that contain multiple similar interfaces like a microprocessor with 2 DRAM busses or an FPGA with multiple IO Banks with the same number and types of pins.  They can also be used to quickly break up busses into nicely structured sub-busses 

Part Builder first scans the SDL file searching to see if it contains  LOOP _DIRECTIVES or Variable Substitution. If it finds any, it creates a new, expanded version of the input SDL file which it saves to the local directory and then uses that for further processing. The benefit of this is it allows the user to clearly see how the loops were expanded, and possibly catch any unintended consequences of the loops.

VARIABLE Value Assignment and Substitution

The user can use variables within Loops or just globally change a of a set of PIN_MATCHES in some MATCH_STATEMENTS that they cut and paste.

VARIABLES can be substituted anywhere in the SDL including in Comments, SYMBOL_NAME_DEFINITIONS and MATCH_STATEMENTS.

A Variable is assigned with the following statement:

`LET VAR_NAME=SOMETHING

The VAR_NAME cannot contain spaces, but it can consist of The SOMETHING can be a number or a string.  

There are 4 main types of loop constructs. Each Construct starts with the backtick '`' characater to tell partPartbuilder that this is a special line

`FOR (var=start;var<=end;var inc/dec) 

`FOR VAR_NAME IN LIST 

`FOR VAR_NAME_LIST IN LIST 

`REPEAT n LOOP



  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.