Region based subcircuit generation

Currently I am trying to get all of the nets from a layout for analysis, however, I haven't found a good way to distinguish between chips. The chip isn't contained in a single cell, so when creating a spice file the nets are extracting into different subcircuits.

Is there a way to use a layer, that is the bounding box of a chip, and create a new cell/subcircuit with all shapes/objects and/or nets within it?

Comments

  • Hi @blueman_44,

    sorry, I don't get it ... so does you chip have a single top cell? So there is one circuit with multiple subcircuits and you want them to become combined?

    You're saying you want to distinguish, but then you say you want to combine ... so you basically want to select some circuits? You can try deleting all the circuits you're not interested in in that case.

    Some example was helpful.

    Matthias

  • Thank you for the response @Matthias,

    Here is an example and I'll also include my GDS/LVS deck:

    In the example I have arrays for both the pads and devices with each being labeled respectively.

    When I run the LVS deck flat the output spice file basically tells me some pads connect to some devices as shown here:

    However, I would like some way to map the nets back to a specific 'chip' it represents. Say net 92 with Device, Pad as the components are actually 'Chip_C'.

    I've mostly done custom MEMs devices so working with connectivity and LVS is new for me lol

  • Hi @blueman_44,

    Thanks for the test case. I had to remove the "deep" statement to see the comments you mention, but then it is getting pretty slow ...

    I don't know if that the right approach, as the netlist is made from nodes only. There is nothing "functional" (no active devices like FETs).

    Usually you would attach a label (here chip name) to net by placing it on the net. In that case, that would be on the "routing" line. Now it is placed on a separate marker on layer 11.

    If your "chip" contains a single net, you can include this marker in the connectivity and transfer the label this way. But caution: this will short all nets within one marker area:

    chip_mask     = input(11, 0)
    
    ...
    
    # Caution shortens metal1 within chip_mask.
    # but attaches labels 
    connect(chip_mask, metal1)
    

    This gives me in deep mode:

    .SUBCKT TOP
    * net 1 Chip_A
    * net 2 Chip_B
    * net 3 Chip_C
    * cell instance $1 r0 *1 0,0
    X$1 1 Pad
    * cell instance $2 r0 *1 0,0
    X$2 1 routing
    * cell instance $3 r0 *1 0,-150
    X$3 1 Device
    * cell instance $4 r0 *1 150,0
    X$4 2 Pad
    ...
    

    So net 1 is connecting Pad at 0,0 with routing at 0, 0 and device at 0,-150 and corresponds to Chip_A.

    Matthias

  • edited July 17

    Thanks @Matthias!

    There are multiple nets per chip so I added a bit of code to map the chip text to the appropriate pad text:

    ...
    chip_mask     = input(11, 0)
    
    #Derived Layers
    chip_mask = chip_mask.merged
    
    #Flatten text to top level - makes parsing the data a bit easier
    flat
    pad_text      = labels(5, 0)
    device_text   = labels(0, 0)
    chip_mask_text = labels(11, 0)
    
    #Map chip text to pad text
    strings = []
    chip_mask.data.each {|chip|
        chip_mask_text.data.each {|text|
            if chip.inside?(text.position)
                pad_text.data.each {|bmp|
                    if chip.inside?(bmp.position)
                        bmp.string = bmp.string + '_' + text.string
                        strings.append(bmp)
                    end
                }
            end
        }
    }
    
    #Replaces pad text with mapped chip to pad text
    pad_text.data.clear
    strings.each {|text|
       pad_text.data.insert(text) 
    }
    ...
    

    For this example:

    I get this result:

    * cell TOP
    .SUBCKT TOP
    * net 1 dev,pad_Chip_A
    * net 2 dev,pad_Chip_B
    * net 3 dev,pad_Chip_C
    * net 4 dev,pad_Chip_C
    * net 5 dev
    ...
    
  • I see.

    But then you can't differentiated the two pads and dev's of Chip_C, right?

    Matthias

  • edited July 18

    Oops I didn't include everything - I still can: (I'll include output file for reference)

    * cell TOP
    .SUBCKT TOP
    * net 1 dev,pad_Chip_A
    * net 2 dev,pad_Chip_B
    * net 3 dev,pad_Chip_C
    * net 4 dev,pad_Chip_C
    ...
    * cell instance $1 r0 *1 0,0
    X$1 1 Pad
    * cell instance $2 r0 *1 0,0
    X$2 1 routing
    * cell instance $3 r0 *1 0,-150
    X$3 1 Device
    * cell instance $4 r0 *1 150,0
    X$4 2 Pad
    * cell instance $5 r0 *1 150,0
    X$5 2 routing
    * cell instance $6 r0 *1 150,-150
    X$6 2 Device
    * cell instance $7 r0 *1 300,0
    X$7 3 Pad
    * cell instance $8 r0 *1 300,0
    X$8 3 routing
    * cell instance $9 r0 *1 300,-150
    X$9 3 Device
    * cell instance $10 r0 *1 450,0
    X$10 4 Pad
    * cell instance $11 r0 *1 450,0
    X$11 4 routing
    * cell instance $12 r0 *1 450,-150
    X$12 4 Device
    * cell instance $13 r0 *1 600,0
    ...
    

    This example was simplified - normally the pads are written uniquely as "PAD_#" and devices are "DEVICE_TYPE_#". That way I only need to parse out the nets to see which pads are connected to which devices.

Sign In or Register to comment.