next up previous contents index
Next: Vectored Instances Up: Electrical Schematic Editing Previous: Connectivity Overview   Contents   Index

Net and Vector Expressions

The name of a net is parsed as an expression using a set of rules to be described. The result of this interpretation is that each conductor (``bit'') of the net has a well-defined name, which is associated by name with all other nets in the cell with bits of a matching name.

We say ``matching'' rather than ``the same'' as Xic will ignore the different subscripting characters. In Xic, square, curly, and angle brackets are accepted for subscripting, thus the forms foo<2>, foo[2], and foo{2} are equivalent ane can be freely intermixed in the design.

A net expression consists of one or more comma-separated terms.

net expression = term[,term]...

A term has the general form

subterm = name[vector expression]
multiplier = [*N], or
multiplier = N*
term = [multiplier]subterm, or
term = [multiplier](term[,term]...)

The basic element of a term is a subterm, which consists of a name optionally followed by a vector expression. The name is an alphanumeric text name. The vector expression represents subscripting to be described.

An optional multiplier can prefix the term. This is an integer N, and a literal asterisk, in one of the forms shown. Here, the literal square brackets can be replaced by curly brackets or angle brackets equivalently. Both forms of the multiplier prefix are equivalent. The effect of the multiplier is to repeat what follows N times.

The second form of the term allows for a list of terms, separated by commas and enclosed in parentheses. The commas and parentheses are literal. This allows the multiplier to cause repetition of the group of terms.

The multiplier provides a shorthand way to express repetitions, but is not required. Below are some examples and equivalences.

3*A = A,A,A
2*(A,B) = A,B,A,B
2*(A,2*B) = A,B,B,A,B,B

In each case, the shorthand on the left is equivalent to the ordering on the right. The A and B are scalar conductor names. The third line above, for example, describes a six-conductor net with the net bits connected to either net A or B in the order shown.

A vector expression represents a sequence on integers, each representing a conductor index.

bit = N
range = N:M[:S]
postmult = *N
vector expression = [bit| range[postmult][,...]]
vector expression = [(vector expression[,...])[postmult][,...]]

Again, where literal square brackets are shown, curly brackets and angle brackets are equivalent in Xic. The elemental decomposition of a vector expression is a comma-separated list of non-negative integers. A bit constitutes one such integer. A range is specified by two or three colon-separated non-negative integers. In the simplest and most common form, the range consists of two integers and represents the two integers and all intermediate integers, in order. If a third integer is given, this represents the increment. The number sequence consists of the start value, and multiples of the increment, terminating at the final value that would not fall outside of the range. Note that the increment is always a positive value, whether the range values are decreasing or increasing. Below are some examples.

[3:0] = [3,2,1,0]
[3:0:2] = [3,1]
[1:4] = [1,2,3,4]
[1:4:4] = [1]

Either can be followed by a postmult multiplier, which causes each element of the sequence to repeat.

[0*2] = [0,0]
[3:0*2] = [3,3,2,2,1,1,0,0]
[1:4:4*2] = [1,1]

The final form illustrates use of literal parentheses and commas to associate a list of vector expressions to a post-multiplier. The entire list will be repeated. The parentheses can be nested to arbitrary depth.

[(1,3:5)*3] = [1,3,4,5,1,3,4,5,1,3,4,5]
[(1,(2,3*2)*2,4:6)*2] = [1,2,3,3,2,3,3,4,5,6,1,2,3,3,2,3,3,4,5,6]

next up previous contents index
Next: Vectored Instances Up: Electrical Schematic Editing Previous: Connectivity Overview   Contents   Index
Stephen R. Whiteley 2022-05-28