sch2mag

sch2mag is the schematic-to-layout entrypoint. It netlists the schematic, builds the connectivity graph, runs placement and routing, and writes both Magic and .cic layout output.

This fixture stays standalone for CI. The test driver clones the required repositories, then runs the local work/ flow inside lelo_temp_sky130a.

make test && printf 'Generated files:\n' && ls -1 lelo_temp_sky130a/design/LELO_TEMP_SKY130A/LELOTEMP_CMP.cic lelo_temp_sky130a/design/LELO_TEMP_SKY130A/LELOTEMP_CMP.mag
make[2]: Entering directory '/__w/cicpy/cicpy/tests/sch2mag'
cd lelo_temp_sky130a && git reset --hard
HEAD is now at d2c8848 docs: system.svg renders the same everywhere
cd lelo_temp_sky130a/work && cicpy sch2mag LELO_TEMP_SKY130A LELOTEMP_CMP
make[3]: Entering directory '/__w/cicpy/cicpy/tests/sch2mag/lelo_temp_sky130a/work'
xschem -q -x -b -s -n ../design/LELO_TEMP_SKY130A/LELOTEMP_CMP.sch -l xsch/xsch_LELOTEMP_CMP.log
cp xsch/LELOTEMP_CMP.spice xsch/LELOTEMP_CMP.spice.bak
cat xsch/LELOTEMP_CMP.spice.bak | perl ../tech/script/fixsubckt > xsch/LELOTEMP_CMP.spice
rm xsch/LELOTEMP_CMP.spice.bak
make[3]: Leaving directory '/__w/cicpy/cicpy/tests/sch2mag/lelo_temp_sky130a/work'
INFO     spi2mag: Loading rules ../tech/cic/sky130A.tech                        
INFO     spi2mag: Finding Magic cells in ../design/                             
INFO     spi2mag: Reading xsch/LELOTEMP_CMP.spice                               
INFO     LayoutCell: Assembling layout....                                      
INFO     LayoutCell: Running beforePlace from LELOTEMP_CMP.py                   
INFO     LayoutCell: place()                                                    
INFO     LayoutCell: addInstance(cktInst=xn_mirr_bias1,                         
         cellName=JNWATR_NCH_2C5F0 x=0, y=0)                                    
INFO     LayoutCell: addInstance(cktInst=xn_mirr_bias2<0>,                      
         cellName=JNWATR_NCH_2C5F0 x=0, y=40000.0)                              
INFO     LayoutCell: addInstance(cktInst=xn_mirr_bias2<1>,                      
         cellName=JNWATR_NCH_2C5F0 x=0, y=80000.0)                              
INFO     LayoutCell: addInstance(cktInst=xn_mirr_bias2<2>,                      
         cellName=JNWATR_NCH_2C5F0 x=0, y=120000.0)                             
INFO     LayoutCell: addInstance(cktInst=xn_mirr_bias2<3>,                      
         cellName=JNWATR_NCH_2C5F0 x=0, y=160000.0)                             
INFO     LayoutCell: addInstance(cktInst=xn_mirr_bias3,                         
         cellName=JNWATR_NCH_2C5F0 x=0, y=200000.0)                             
INFO     LayoutCell: addInstance(cktInst=xn_mirr_load0,                         
         cellName=JNWATR_NCH_2C5F0 x=51200.0, y=0)                              
INFO     LayoutCell: addInstance(cktInst=xn_mirr_load1,                         
         cellName=JNWATR_NCH_2C5F0 x=51200.0, y=40000.0)                        
INFO     LayoutCell: addInstance(cktInst=xn_mirr_load2,                         
         cellName=JNWATR_NCH_2C5F0 x=51200.0, y=80000.0)                        
INFO     LayoutCell: addInstance(cktInst=xn_mirr_load3,                         
         cellName=JNWATR_NCH_2C5F0 x=51200.0, y=120000.0)                       
INFO     LayoutCell: addInstance(cktInst=xn_mirr_load4,                         
         cellName=JNWATR_NCH_2C5F0 x=51200.0, y=160000.0)                       
INFO     LayoutCell: addInstance(cktInst=xn_mirr_load5,                         
         cellName=JNWATR_NCH_2C1F2 x=51200.0, y=200000.0)                       
INFO     LayoutCell: addInstance(cktInst=xp_diff1, cellName=JNWATR_PCH_2C1F2    
         x=102400.0, y=0)                                                       
INFO     LayoutCell: addInstance(cktInst=xp_diff2, cellName=JNWATR_PCH_2C1F2    
         x=102400.0, y=40000.0)                                                 
INFO     LayoutCell: addInstance(cktInst=xp_diff3<0>, cellName=JNWATR_PCH_2C1F2 
         x=102400.0, y=80000.0)                                                 
INFO     LayoutCell: addInstance(cktInst=xp_diff3<1>, cellName=JNWATR_PCH_2C1F2 
         x=102400.0, y=120000.0)                                                
INFO     LayoutCell: addInstance(cktInst=xp_diff3<2>, cellName=JNWATR_PCH_2C1F2 
         x=102400.0, y=160000.0)                                                
INFO     LayoutCell: addInstance(cktInst=xp_diff3<3>, cellName=JNWATR_PCH_2C1F2 
         x=102400.0, y=200000.0)                                                
INFO     LayoutCell: addInstance(cktInst=xp_mirr_tail1,                         
         cellName=JNWATR_PCH_2C5F0 x=153600.0, y=0)                             
INFO     LayoutCell: addInstance(cktInst=xp_mirr_tail1<0>,                      
         cellName=JNWATR_PCH_2C5F0 x=153600.0, y=40000.0)                       
INFO     LayoutCell: addInstance(cktInst=xp_mirr_tail2,                         
         cellName=JNWATR_PCH_2C5F0 x=153600.0, y=80000.0)                       
INFO     LayoutCell: addInstance(cktInst=xp_mirr_tail3<0>,                      
         cellName=JNWATR_PCH_2C5F0 x=153600.0, y=120000.0)                      
INFO     LayoutCell: addInstance(cktInst=xp_mirr_tail3<1>,                      
         cellName=JNWATR_PCH_2C5F0 x=153600.0, y=160000.0)                      
INFO     LayoutCell: addInstance(cktInst=xp_mirr_tail3<2>,                      
         cellName=JNWATR_PCH_2C5F0 x=153600.0, y=200000.0)                      
INFO     LayoutCell: Running afterPlace from LELOTEMP_CMP.py                    
ERROR    LayoutCell: LELOTEMP_CMP_N_MIRR_BIAS: beforePlace() raised:            
         'StackGroup' object has no attribute 'beforePlace'                     
         Traceback (most recent call last):                                     
           File                                                                 
         "/opt/eda/python3/lib/python3.14/site-packages/cicpy/core/subcell.py", 
         line 512, in _run_stack_pycell                                         
             grp.beforePlace(entry)                                             
             ^^^^^^^^^^^^^^^                                                    
         AttributeError: 'StackGroup' object has no attribute 'beforePlace'     
                                                                                
ERROR    LayoutCell: LELOTEMP_CMP_N_MIRR_BIAS: beforeRoute() raised:            
         'StackGroup' object has no attribute 'beforeRoute'                     
         Traceback (most recent call last):                                     
           File                                                                 
         "/opt/eda/python3/lib/python3.14/site-packages/cicpy/core/subcell.py", 
         line 517, in _run_stack_pycell                                         
             handled = bool(grp.beforeRoute(entry))                             
                            ^^^^^^^^^^^^^^^                                     
         AttributeError: 'StackGroup' object has no attribute 'beforeRoute'     
                                                                                
ERROR    LayoutCell: LELOTEMP_CMP_N_MIRR_LOAD: beforePlace() raised:            
         'StackGroup' object has no attribute 'beforePlace'                     
         Traceback (most recent call last):                                     
           File                                                                 
         "/opt/eda/python3/lib/python3.14/site-packages/cicpy/core/subcell.py", 
         line 512, in _run_stack_pycell                                         
             grp.beforePlace(entry)                                             
             ^^^^^^^^^^^^^^^                                                    
         AttributeError: 'StackGroup' object has no attribute 'beforePlace'     
                                                                                
ERROR    LayoutCell: LELOTEMP_CMP_N_MIRR_LOAD: beforeRoute() raised:            
         'StackGroup' object has no attribute 'beforeRoute'                     
         Traceback (most recent call last):                                     
           File                                                                 
         "/opt/eda/python3/lib/python3.14/site-packages/cicpy/core/subcell.py", 
         line 517, in _run_stack_pycell                                         
             handled = bool(grp.beforeRoute(entry))                             
                            ^^^^^^^^^^^^^^^                                     
         AttributeError: 'StackGroup' object has no attribute 'beforeRoute'     
                                                                                
ERROR    LayoutCell: LELOTEMP_CMP_P_DIFF: beforePlace() raised: 'StackGroup'    
         object has no attribute 'beforePlace'                                  
         Traceback (most recent call last):                                     
           File                                                                 
         "/opt/eda/python3/lib/python3.14/site-packages/cicpy/core/subcell.py", 
         line 512, in _run_stack_pycell                                         
             grp.beforePlace(entry)                                             
             ^^^^^^^^^^^^^^^                                                    
         AttributeError: 'StackGroup' object has no attribute 'beforePlace'     
                                                                                
ERROR    LayoutCell: LELOTEMP_CMP_P_DIFF: beforeRoute() raised: 'StackGroup'    
         object has no attribute 'beforeRoute'                                  
         Traceback (most recent call last):                                     
           File                                                                 
         "/opt/eda/python3/lib/python3.14/site-packages/cicpy/core/subcell.py", 
         line 517, in _run_stack_pycell                                         
             handled = bool(grp.beforeRoute(entry))                             
                            ^^^^^^^^^^^^^^^                                     
         AttributeError: 'StackGroup' object has no attribute 'beforeRoute'     
                                                                                
ERROR    LayoutCell: LELOTEMP_CMP_P_MIRR_TAIL: beforePlace() raised:            
         'StackGroup' object has no attribute 'beforePlace'                     
         Traceback (most recent call last):                                     
           File                                                                 
         "/opt/eda/python3/lib/python3.14/site-packages/cicpy/core/subcell.py", 
         line 512, in _run_stack_pycell                                         
             grp.beforePlace(entry)                                             
             ^^^^^^^^^^^^^^^                                                    
         AttributeError: 'StackGroup' object has no attribute 'beforePlace'     
                                                                                
ERROR    LayoutCell: LELOTEMP_CMP_P_MIRR_TAIL: beforeRoute() raised:            
         'StackGroup' object has no attribute 'beforeRoute'                     
         Traceback (most recent call last):                                     
           File                                                                 
         "/opt/eda/python3/lib/python3.14/site-packages/cicpy/core/subcell.py", 
         line 517, in _run_stack_pycell                                         
             handled = bool(grp.beforeRoute(entry))                             
                            ^^^^^^^^^^^^^^^                                     
         AttributeError: 'StackGroup' object has no attribute 'beforeRoute'     
                                                                                
INFO     LayoutCell: Running beforeRoute from LELOTEMP_CMP.py                   
INFO     LayoutCell: addRouteRing(layer=M3, name=VBP2, location=t, widthmult=2, 
         spacemult=2, useGridForSpace=True)                                     
INFO     LayoutCell: addRouteRing(layer=M1, name=VDD_1V8, location=t,           
         widthmult=3, spacemult=2, useGridForSpace=True)                        
INFO     LayoutCell: addRouteRing(layer=M1, name=VSS, location=b, widthmult=3,  
         spacemult=2, useGridForSpace=True)                                     
INFO     LayoutCell: addOrthogonalConnectivityRoute(verticalLayer=M2,           
         horizontalLayer=M3, regex=^IBP_1U$, options=track-2,onTopLeft,2cuts,   
         cuts=2, excludeInstances=,                                             
         includeInstances=^(xn_mirr_bias1|xn_mirr_bias2<0>|xn_mirr_bias2<1>|xn_m
         irr_bias2<2>|xn_mirr_bias2<3>|xn_mirr_bias3)$, includeGroups=)         
INFO     LayoutCell: addOrthogonalConnectivityRoute: node=IBP_1U                
INFO     LayoutCell: addOrthogonalConnectivityRoute: r=<class                   
         'cicpy.core.route.OrthogonalLayerRoute'>: layer= X=0 Y=0 W=0 H=0       
         name=IBP_1U                                                            
INFO     LayoutCell: addOrthogonalConnectivityRoute(verticalLayer=M4,           
         horizontalLayer=M3, regex=^PWRUP_N_1V8$,                               
         options=onTopLeft,track6,2cuts, cuts=2, excludeInstances=,             
         includeInstances=^(xn_mirr_load0|xn_mirr_load1|xn_mirr_load2|xn_mirr_lo
         ad3|xn_mirr_load4|xn_mirr_load5|xn_mirr_bias1|xn_mirr_bias2<0>|xn_mirr_
         bias2<1>|xn_mirr_bias2<2>|xn_mirr_bias2<3>|xn_mirr_bias3)$,            
         includeGroups=)                                                        
INFO     LayoutCell: addOrthogonalConnectivityRoute: node=PWRUP_N_1V8           
INFO     LayoutCell: addOrthogonalConnectivityRoute: r=<class                   
         'cicpy.core.route.OrthogonalLayerRoute'>: layer= X=0 Y=0 W=0 H=0       
         name=PWRUP_N_1V8                                                       
INFO     LayoutCell: addOrthogonalConnectivityRoute(verticalLayer=M4,           
         horizontalLayer=M3, regex=^VS$, options=track4,onTopLeft,2cuts, cuts=2,
         excludeInstances=,                                                     
         includeInstances=^(xp_mirr_tail1|xp_mirr_tail1<0>|xp_mirr_tail2|xp_mirr
         _tail3<0>|xp_mirr_tail3<1>|xp_mirr_tail3<2>|xp_diff1|xp_diff2|xp_diff3<
         0>|xp_diff3<1>|xp_diff3<2>|xp_diff3<3>)$, includeGroups=)              
INFO     LayoutCell: addOrthogonalConnectivityRoute: node=VS                    
INFO     LayoutCell: addOrthogonalConnectivityRoute: r=<class                   
         'cicpy.core.route.OrthogonalLayerRoute'>: layer= X=0 Y=0 W=0 H=0       
         name=VS                                                                
INFO     LayoutCell: addRouteConnection(path=^VBP2$, includeInstances=,         
         layer=M4, location=top, options=, routeTypeOverride=,                  
         excludeInstances=, includeGroups=)                                     
INFO     LayoutCell: addOrthogonalConnectivityRoute(verticalLayer=M4,           
         horizontalLayer=M3, regex=^VO1$, options=onTopLeft,track6,2cuts,       
         cuts=2, excludeInstances=, includeInstances=, includeGroups=)          
INFO     LayoutCell: addOrthogonalConnectivityRoute: node=VO1                   
INFO     LayoutCell: addOrthogonalConnectivityRoute: r=<class                   
         'cicpy.core.route.OrthogonalLayerRoute'>: layer= X=0 Y=0 W=0 H=0       
         name=VO1                                                               
INFO     LayoutCell: addOrthogonalConnectivityRoute(verticalLayer=M4,           
         horizontalLayer=M3, regex=^VO$, options=onTopLeft,track4,2cuts, cuts=2,
         excludeInstances=, includeInstances=, includeGroups=)                  
INFO     LayoutCell: addOrthogonalConnectivityRoute: node=VO                    
INFO     LayoutCell: addOrthogonalConnectivityRoute: r=<class                   
         'cicpy.core.route.OrthogonalLayerRoute'>: layer= X=0 Y=0 W=0 H=0       
         name=VO                                                                
INFO     LayoutCell: addOrthogonalConnectivityRoute(verticalLayer=M4,           
         horizontalLayer=M3, regex=^VBN1$, options=onTopLeft,track4,2cuts,      
         cuts=2, excludeInstances=, includeInstances=, includeGroups=)          
INFO     LayoutCell: addOrthogonalConnectivityRoute: node=VBN1                  
INFO     LayoutCell: addOrthogonalConnectivityRoute: r=<class                   
         'cicpy.core.route.OrthogonalLayerRoute'>: layer= X=0 Y=0 W=0 H=0       
         name=VBN1                                                              
INFO     LayoutCell: route()                                                    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     Route: route() called: net=VBP2, layer=M4, routeType=VERTICAL,         
         route=||, options=,onTopB,fillvcut                                     
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VBP2, layer=M4, startRects=1, stopRects=1    
INFO     LayoutCell: paint()                                                    
INFO     LayoutCell: Running resetOrigin with 1                                 
INFO     LayoutCell: addAllPorts()                                              
INFO     LayoutCell: addAllPorts()                                              
INFO     LayoutCell: Running afterPorts from LELOTEMP_CMP.py                    
INFO     LayoutCell: addPortOnEdge(layer=M2, node=VO, location=top,             
         routeType=||, options=)                                                
INFO     Route: route() called: net=VO, layer=M2, routeType=VERTICAL, route=||, 
         options=                                                               
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VO, layer=M2, startRects=1, stopRects=1      
INFO     LayoutCell: addPortOnEdge(layer=M3, node=IBP_1U, location=left,        
         routeType=|-, options=track0)                                          
INFO     Route: route() called: net=IBP_1U, layer=M3, routeType=U_LEFT,         
         route=|-, options=track0                                               
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeU()                                        
INFO     Route: routeU: net=IBP_1U, layer=M3, startRects=1, stopRects=1         
INFO     LayoutCell: addPortOnEdge(layer=M3, node=PWRUP_N_1V8, location=l,      
         routeType=-|--, options=track6)                                        
INFO     Route: route() called: net=PWRUP_N_1V8, layer=M3, routeType=LEFT,      
         route=-|--, options=track6                                             
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeOne()                                      
INFO     Route: routeOne: net=PWRUP_N_1V8, layer=M3, route=-|--, options=track6,
         startRects=1, stopRects=1                                              
INFO     LayoutCell: addPortOnEdge(layer=M2, node=VIN, location=bottom,         
         routeType=||, options=)                                                
INFO     Route: route() called: net=VIN, layer=M2, routeType=VERTICAL, route=||,
         options=                                                               
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeVertical()                                 
INFO     Route: routeVertical: net=VIN, layer=M2, startRects=1, stopRects=1     
INFO     LayoutCell: addPortOnEdge(layer=M3, node=PWRUP_1V8, location=right,    
         routeType=-|, options=offset_track0)                                   
INFO     Route: route() called: net=PWRUP_1V8, layer=M3, routeType=U_RIGHT,     
         route=-|, options=offset_track0                                        
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeU()                                        
INFO     Route: routeU: net=PWRUP_1V8, layer=M3, startRects=1, stopRects=1      
INFO     LayoutCell: addPortOnEdge(layer=M2, node=VIP, location=bottom,         
         routeType=--|-, options=offset_track-4,track4)                         
INFO     Route: route() called: net=VIP, layer=M2, routeType=RIGHT, route=--|-, 
         options=offset_track-4,track4                                          
INFO     Route:   startRects count: 1, stopRects count: 1                       
INFO     Route:   Routing with: routeOne()                                      
INFO     Route: routeOne: net=VIP, layer=M2, route=--|-,                        
         options=offset_track-4,track4, startRects=1, stopRects=1               
DEBUG    Design: Adding cut cut_M1M2_2x2                                        
DEBUG    Design: Adding cut cut_M1M2_1x2                                        
DEBUG    Design: Adding cut cut_M1M2_2x1                                        
DEBUG    Design: Adding cut cut_M2M3_2x1                                        
DEBUG    Design: Adding cut cut_M2M3_1x2                                        
DEBUG    Design: Adding cut cut_M3M4_1x2                                        
DEBUG    Design: Adding cut cut_M2M4_2x1                                        
DEBUG    Design: Adding cut cut_M3M4_2x1                                        
DEBUG    Design: Adding cut cut_M2M4_1x2                                        
INFO     MagicPrinter: Writing ../design/LELO_TEMP_SKY130A/LELOTEMP_CMP.mag     
make[2]: Leaving directory '/__w/cicpy/cicpy/tests/sch2mag'
Generated files:
lelo_temp_sky130a/design/LELO_TEMP_SKY130A/LELOTEMP_CMP.cic
lelo_temp_sky130a/design/LELO_TEMP_SKY130A/LELOTEMP_CMP.mag

Command under test:

cd lelo_temp_sky130a/work
cicpy sch2mag LELO_TEMP_SKY130A LELOTEMP_CMP

Standalone test driver:

Makefile:

PYTHON ?= python3

lelo_temp_sky130a:
	git clone https://github.com/wulffern/lelo_temp_sky130a lelo_temp_sky130a
	git clone https://github.com/analogicus/jnw_tr_sky130a jnw_tr_sky130a
	git clone https://github.com/wulffern/lelo_atr_sky130a lelo_atr_sky130a
	git clone https://github.com/analogicus/jnw_atr_sky130a jnw_atr_sky130a
	git clone https://github.com/wulffern/tech_sky130A tech_sky130A

test: lelo_temp_sky130a
	cd lelo_temp_sky130a && git reset --hard
	cd lelo_temp_sky130a/work && cicpy sch2mag LELO_TEMP_SKY130A LELOTEMP_CMP
	@test -f lelo_temp_sky130a/design/LELO_TEMP_SKY130A/LELOTEMP_CMP.cic
	@test -f lelo_temp_sky130a/design/LELO_TEMP_SKY130A/LELOTEMP_CMP.mag

svg: lelo_temp_sky130a
	cicpy svg lelo_temp_sky130a/design/LELO_TEMP_SKY130A/LELOTEMP_CMP.cic \
		lelo_temp_sky130a/tech/cic/sky130A.tech LELOTEMP_CMP \
		--I jnw_atr_sky130a/design/JNW_ATR_SKY130A.cic \
		--I jnw_tr_sky130a/design/JNW_TR_SKY130A.cic

clean:
	rm -rf lelo_temp_sky130a
	rm -rf jnw_tr_sky130a
	rm -rf jnw_atr_sky130a
	rm -rf lelo_atr_sky130a
	rm -rf tech_sky130A
	-rm -rf LELOTEMP_CMP_svg LELOTEMP_CMP_svg.html

docs:
	${PYTHON} ../gendoc.py sch2mag.md ../../docs/sch2mag.md

Excerpt from generated .cic:

lelo_temp_sky130a/design/LELO_TEMP_SKY130A/LELOTEMP_CMP.cic:

{
    "cells": [
        {
            "class": "cIcCore::Cell",
            "x1": 0,
            "y1": 0,
            "x2": 3800,
            "y2": 9600,
            "layer": "PR",
            "net": "",
            "name": "cut_M2M4_1x2",
            "has_pr": false,
            "abstract": false,
            "physicalOnly": false,
            "libcell": false,
            "ckt": {},
            "children": [
                {
                    "class": "Rect",
                    "x1": 0,
                    "y1": 0,
                    "x2": 3400,
                    "y2": 8800,
                    "layer": "M2",
                    "net": ""
                },
                {
                    "class": "Rect",
                    "x1": 300,
                    "y1": 600,
                    "x2": 3100,
                    "y2": 3400,
                    "layer": "VIA2",
                    "net": ""
                },
                {
                    "class": "Rect",
                    "x1": 300,
                    "y1": 5400,
                    "x2": 3100,
                    "y2": 8200,
                    "layer": "VIA2",
                    "net": ""
                },
                {
                    "class": "Rect",
                    "x1": 0,
                    "y1": 0,
                    "x2": 3400,
                    "y2": 8800,
                    "layer": "M3",
                    "net": ""
                },
                {
                    "class": "Rect",
                    "x1": 300,
                    "y1": 600,
                    "x2": 3100,
                    "y2": 3400,
                    "layer": "VIA3",
                    "net": ""
                },
                {
                    "class": "Rect",
                    "x1": 300,
                    "y1": 5400,
                    "x2": 3100,
                    "y2": 8200,
                    "layer": "VIA3",
                    "net": ""
                },
                {
                    "class": "Rect",
                    "x1": 0,
                    "y1": 0,
                    "x2": 3800,
                    "y2": 9600,
                    "layer": "M4",
                    "net": ""
                }

Rendered SVG from the generated layout data:

The top-cell .cic from sch2mag only contains LELOTEMP_CMP plus generated cut cells. For SVG rendering, the fixture uses cicpy svg --I ... to include the dependency libraries JNW_ATR_SKY130A.cic and JNW_TR_SKY130A.cic.

make svg