Skip to content

Schematic Group

The schematic-group statement is a tool to organize the components and modules in a JITX design. This statement is the primary tool for constructing the module hierarchy in the schematic.

This statement is only valid in the pcb-module context.

Signature

There are two major forms of the schematic-group statement:

  1. Assignment
  2. Same Group Association

Schematic Group Assignment

  ; Assign Schematic Group
  schematic-group(<INST>) = <Ref>
  schematic-group(<Seqable<INST>>) = <Ref>

  ; Assign Schematic Group to Symbol Unit
  schematic-group(<INST>, <UNIT:Int>) = <GROUP:Ref>
  • &lt;INST> - A component or module instance as defined in this pcb-module context.
  • &lt;Seqable<INST>> - A Seqable of instances that allow schematic group assignment for mutiple instances at a time.
  • &lt;Group:Ref> - The name of a schematic group. This must be a valid Ref in the JITX runtime. This will be used as part of the schematic group names in the Schematic UI.
  • &lt;UNIT:Int> - Symbol Unit Index for identifying sub-parts of a multi-part symbol. Note that this value is not necessarily the same as the Int|Ref used to identify a symbol unit bank in the pin-properties table.

Same Schematic Group Association

  ; Copy Schematic Group
  <SCH-GROUP-STMT> = schematic-group(<ANCHOR>)
  <SCH-GROUP-STMT> = schematic-group(<ANCHOR>, <UNIT:Int>)
  • &lt;SCH-GROUP-STMT> - This has the same syntax as the left side of the schematic group assignment statements described above. This identifies the component instance to which a group will be assigned.
  • &lt;ANCHOR> - This identifies a component instance in the current module context that already has a group. This statement assigns this component existing groupt to the instance in the &lt;SCH-GROUP-STMT>
  • &lt;UNIT:Int> - Optional Symbol Unit Index to refer to a particular sub-part of the ANCHOR instance.

Usage

The schematic-group statement is a tool for organizing the schematic by grouping like components together. For example, when creating a wrapper for a complex component like an FPGA, you might have many bypass capacitors. It can be useful to group these capacitors together and work with them as a block.

pcb-module FPGA : 

  inst U1 : Xilinx-XC7

  for i in 0 to length(U1.VCCINT) do: 
    val cap = bypass-cap-strap(U1.VCCINT[i], U1.GND, 0.1e-6)
    schematic-group(cap) = bypass-caps-VCCINT

In this example, we instantiate multiple bypass capacitors, one for each of the VCCINT pins of the FPGA, and then add each capacitor to the bypass-caps-VCCINT schematic group. Notice that the group is assigned to a component instance not the definition.

This makes an organizational group in the schematic for these bypass capacitors. This bypass-caps-VCCINT group will be a child group of the FPGA parent group.

Multiple Component Assignment

To make schematic group assignment less verbose, the user can assign a group to multiple component instances simultaneously.

pcb-module some-circuit: 

  inst amp : SingleOpAmp 
  inst R1 : chip-resistor(13.3e3)
  inst R2 : chip-resistor(47.0e3)
  inst C1 : ceramic-cap(0.1e-6)
  ...

  schematic-group([amp, R1, R2]) = anti-alias-filter
  schematic-group(C1) = anti-alias-filter

This will construct a group anti-alias-filter and add the amp, R1, R2, and C1 component instances to that group. Notice that once a schematic group is created, it is not closed. You can add additional components to that group by adding additional schematic-group statements.

Multi-part Symbol Components

For components with multi-part schematic symbols, an optional second argument can be provided which will map only a particular symbol unit by Int. (Currently, symbol units using Ref identifiers are not supported).

This is often useful when dealing with large, complex components like FPGAs (see A2F200M3F-FGG256I.stanza). For the Microsemi A2F200 FPGA, the pcb-component defines multiple banks, such as the supply, jtag, and analog banks.

  inst fpga : ocdb/components/microsemi/A2F200M3F-FGG256I/component

  schematic-group(fpga, 0) = power-config  ; supply
  schematic-group(fpga, 1) = sensors       ; analog
  schematic-group(fpga, 2) = power-config  ; osc
  schematic-group(fpga, 3) = power-config  ; jtag

In this example, the second argument to schematic-group is the symbol unit index for the bank in question. The symbol unit index is incremented monotonically for every bank.

If the optional second argument is not provided for a multi-part symbol, then all parts of the symbol for that component instance will be associated with the given group.

Implicit Schematic Group for pcb-module

For each pcb-module definition, there is an implicit schematic-group statement. It is effectively:

pcb-module mod-name :
  ...

  schematic-group(self) = mod-name

This means that for most circuits you won't need to use the schematic-group statement at all. Just by constructing a design using pcb-module definitions, we can create a design hierarchy that makes sense.

This also means that any manually created schematic-group statements inside this pcb-module will effectively be prefixed with mod-name in their Ref.

Same Group Association

The same group association form of this statement looks a bit funny. On its face, it doesn't look super useful. Where this form of group assignment shines is when you are writing a generator function.

defn add-some-pullups (comp:Instance, rail:JITXObject, resistance:Double = 4.7e3):
  inside pcb-module:
    inst R : chip-resistor(resistance)[2]

    for i in 0 to length(R) do:
      net (R[i], rail)

    net (comp.sda, R[0])
    net (comp.scl, R[1])

    schematic-group([R[0], R[1]]) = schematic-group(comp)

The idea here is that we have a function that accepts a component instance as an argument and adds some new components, in this case pull-up resistors, to that component. We want those new pull-up resistors to end up in the same schematic group as the comp instance. But we have a problem - we don't know what group the user might have used in the pcb-module context where comp was instantiated.

Use the "Same Group Association" form, we can pull the group association from the existing component.