Skip to content
Snippets Groups Projects
Commit a2a93eb4 authored by Jingyan Ling's avatar Jingyan Ling
Browse files

testing parallel traces

parent 4bb9fb03
Branches
No related merge requests found
## ENGINEERING JOURNAL ## ENGINEERING JOURNAL
### Jingyan Ling ### Jingyan Ling
### 08/09/2019
- Potential problem:
- drawing pre-processing has two goals: 1. put different intensity cuts on different layers for accurate fabrication 2. make line to 4 nodes path for auto-router treating as obstacles.
- Two goal may conflict within single process
- potential solution: send 4 nodes path to auto-router and draw wiring paths on drawing with signed layers.
- Solving parallel traces math computation
### 08/08/2019
- `block` class in `ezdxf` generates symbol in `inkscape`. Check if it can be made to path from script
- ![](journal_media/cross_cut.png)
- Changed the way of drawing `cross-cut` to path directly instead of using inserting block class (see [paperbot_draw.py](paperbot_ee_autoroute/paperbot_draw.py) for detail)
- Parallel traces are not computed correctly
- ![](journal_media/parallel_trace_error.png)
### 08/07/2019 ### 08/07/2019
- Working on drawing details regarding fabrication for electrical design - Working on drawing details regarding fabrication for electrical design
- A block was created for 'cross cut' to fit pin insertions - A block was created for 'cross cut' to fit pin insertions
......
This diff is collapsed.
journal_media/cross_cut.png

35.1 KiB

journal_media/parallel_trace_error.png

9.17 KiB

No preview for this file type
No preview for this file type
...@@ -24,6 +24,8 @@ class pre_process(): ...@@ -24,6 +24,8 @@ class pre_process():
self.remove_wheels() ##remove wheel drawings for this design, no need to call for other designs self.remove_wheels() ##remove wheel drawings for this design, no need to call for other designs
self.center_arr=self.find_pin() self.center_arr=self.find_pin()
self.cross_cut(2,self.center_arr)
self.dwg.saveas(self.save_name) self.dwg.saveas(self.save_name)
def create_layer(self,layer_name,color): def create_layer(self,layer_name,color):
...@@ -71,7 +73,22 @@ class pre_process(): ...@@ -71,7 +73,22 @@ class pre_process():
center_arr=np.unique(center_arr,axis=0) center_arr=np.unique(center_arr,axis=0)
center_arr=center_arr[1:] center_arr=center_arr[1:]
return center_arr return center_arr
# def cross_cut_block(self)
def cross_cut(self,cross_size,pin_loc):
"""
cross_size= lenght of bounding box of the cross cut
"""
tipat=cross_size/2
for pt in pin_loc:
x=pt[0]
y=pt[1]
cross_s1=(x-tipat,y-tipat)
cross_e1=(x+tipat,y+tipat)
cross_s2=(x-tipat,y+tipat)
cross_e2=(x+tipat,y-tipat)
self.msp.add_line(cross_s1,cross_e1,dxfattribs={'linetype':'DASHDOT', 'layer':'Circuit'})
self.msp.add_line(cross_s2,cross_e2,dxfattribs={'linetype':'DASHDOT', 'layer':'Circuit'})
# def line_to_path(self) # def line_to_path(self)
...@@ -87,8 +104,9 @@ class post_process(): ...@@ -87,8 +104,9 @@ class post_process():
self.convert_unit() self.convert_unit()
self.draw_wires() self.draw_wires()
self.parallel_trace(1)
self.dwg.save() self.dwg.saveas('route_text.dxf')
def convert_unit(self): def convert_unit(self):
for path in self._wiring: for path in self._wiring:
...@@ -101,4 +119,89 @@ class post_process(): ...@@ -101,4 +119,89 @@ class post_process():
self.msp.add_line(path[i],path[i+1],dxfattribs={ self.msp.add_line(path[i],path[i+1],dxfattribs={
'layer':'Circuit', 'layer':'Circuit',
'linetype':'DASHDOT'}) 'linetype':'DASHDOT'})
# def parallel_trace_block(self) def find_lind_eq(self,pt1,pt2):
\ No newline at end of file """
input: two points on a line
pt1:[x1,y1]
pt2:[x2,y2]
return: a,b,theta in terms of cy=ax+b
"""
x1,y1=pt1[0],pt1[1]
x2,y2=pt2[1],pt2[1]
if x1==x2:
theta=np.pi/2
#x= number
a=1
b=-x1
c=0
else:
theta=np.arctan((y2-y1)/(x2-x1))
A=np.array([[x1,1],[x2,1]])
k=np.array([y1,y2])
sol=np.linalg.solve(A,k)
a,b=sol[0],sol[1]
c=1
return a,b,c,theta
def parallel_trace(self,width):
halfw=width/2
for path in self.wiring:
for i in range(len(path)-1):
start_x,start_y=path[i][0],path[i][1]
end_x,end_y=path[i+1][0],path[i+1][1]
theta=self.find_lind_eq(path[i],path[i+1])[3]
sinw=np.sin(theta)*halfw
cosw=np.cos(theta)*halfw
s1i=[start_x-sinw,start_y+cosw]
s1o=[start_x+sinw,start_y-cosw]
e1i=[end_x-sinw,end_y+cosw]
e1o=[end_x+sinw,end_y-cosw]
line1i=self.find_lind_eq(s1i,e1i)
line1o=self.find_lind_eq(s1o,e1o)
if i==0:
s1=s1i
s2=s1o
else:
s1=e1
s2=e2
if i<len(path)-2:
next_x,next_y=path[i+2][0],path[i+2][1]
theta2=self.find_lind_eq(path[i+1],path[i+2])[3]
sinw2=np.sin(theta2)*halfw
cosw2=np.cos(theta2)*halfw
s2i=[end_x-sinw2,end_y+cosw2]
s2o=[end_x+sinw2,end_y-cosw2]
e2i=[next_x-sinw2,next_y+cosw2]
e2o=[next_x+sinw2,next_y-cosw2]
line2i=self.find_lind_eq(s2i,e2i)
line2o=self.find_lind_eq(s2o,e2o)
Ainteri=np.array([[line1i[0],-line1i[2]],[line2i[0],-line2i[2]]])
binteri=np.array([-line1i[1],-line2i[1]])
Aintero=np.array([[line1o[0],-line1o[2]],[line2o[0],-line2o[2]]])
bintero=np.array([-line1o[1],-line2o[1]])
e1=np.linalg.solve(Ainteri,binteri)
e2=np.linalg.solve(Aintero,bintero)
else:
#from last end point to this end
e1=[end_x-sinw,end_y+cosw]
e2=[end_x+sinw,end_y-cosw]
self.msp.add_line(s1,e1,dxfattribs={
'layer':'Circuit',
'linetype':'DASHDOT'})
self.msp.add_line(s2,e2,dxfattribs={
'layer':'Circuit',
'linetype':'DASHDOT'})
...@@ -35,10 +35,10 @@ class brd_design(): ...@@ -35,10 +35,10 @@ class brd_design():
def brd_general(self): def brd_general(self):
self.brd=dsnwritier.Dsn() self.brd=dsnwritier.Dsn()
self.layers=[ self.layers=[
dsnwritier.Layer('F.Cu'), dsnwritier.Layer('F.Cu')
dsnwritier.Layer('B.Cu'), # dsnwritier.Layer('B.Cu'),
dsnwritier.Layer('F.Mask'), # dsnwritier.Layer('F.Mask'),
dsnwritier.Layer('B.Mask') # dsnwritier.Layer('B.Mask')
] ]
self.parsers= dsnwritier.Parser() self.parsers= dsnwritier.Parser()
......
...@@ -12,28 +12,18 @@ ...@@ -12,28 +12,18 @@
(type signal) (type signal)
(property (property
(index 0))) (index 0)))
(layer B.Cu
(type signal)
(property
(index 1)))
(layer F.Mask
(type signal)
(property
(index 2)))
(layer B.Mask
(type signal)
(property
(index 3)))
(boundary (boundary
(path pcb 0 -26696.2760000000 -280310.9110000000 216684.7830000000 -280310.9110000000 216684.7830000000 19577.2840000000 -26696.2760000000 19577.2840000000)) (path pcb 0 -12458.2620000000 -280310.9110000000 222913.9010000000 -280310.9110000000 222913.9010000000 31145.6610000000 -12458.2620000000 31145.6610000000))
(keepout "" (keepout ""
( polygon signal 0 106000.2480000000 -113732.1160000000 106000.2480000000 -113467.5320000000 118999.9710000000 -113467.5320000000 118999.9710000000 -113732.1160000000)) ( polygon signal 0 106000.2480000000 -113732.1160000000 106000.2480000000 -113467.5320000000 118999.9710000000 -113467.5320000000 118999.9710000000 -113732.1160000000))
(keepout "" (keepout ""
( polygon signal 0 106000.2480000000 -151732.3810000000 106000.2480000000 -151467.7980000000 118999.9710000000 -151467.7980000000 118999.9710000000 -151732.3810000000)) ( polygon signal 0 106000.2480000000 -151732.3810000000 106000.2480000000 -151467.7980000000 118999.9710000000 -151467.7980000000 118999.9710000000 -151732.3810000000))
(keepout ""
( polygon signal 0 59999.9540000000 -31732.4810000000 59999.9540000000 -31467.8970000000))
(keepout "" (keepout ""
( polygon signal 0 35999.8700000000 -31732.4810000000 35999.8700000000 -31467.8970000000 59999.9540000000 -31467.8970000000 59999.9540000000 -31732.4810000000)) ( polygon signal 0 35999.8700000000 -31732.4810000000 35999.8700000000 -31467.8970000000 59999.9540000000 -31467.8970000000 59999.9540000000 -31732.4810000000))
(keepout "" (keepout ""
( polygon signal 0 0.0000000000 -31732.4810000000 0.0000000000 -31467.8970000000 24000.0850000000 -31467.8970000000 24000.0850000000 -31732.4810000000)) ( polygon signal 0 0.0000000000 -31732.4810000000 0.0000000000 -31467.8970000000 24000.0850000000 -31467.8970000000 24000.0850000000 -31732.4810000000 0.0000000000 -31732.4810000000 0.0000000000 -31467.8970000000))
(keepout "" (keepout ""
( polygon signal 0 106000.2480000000 -18132.2620000000 106000.2480000000 -17867.6790000000 110000.0050000000 -17867.6790000000 110000.0050000000 -18132.2620000000)) ( polygon signal 0 106000.2480000000 -18132.2620000000 106000.2480000000 -17867.6790000000 110000.0050000000 -17867.6790000000 110000.0050000000 -18132.2620000000))
(keepout "" (keepout ""
...@@ -181,9 +171,13 @@ ...@@ -181,9 +171,13 @@
(keepout "" (keepout ""
( polygon signal 0 36999.8100000000 -151732.3810000000 36999.8100000000 -151467.7980000000 81000.2240000000 -151467.7980000000 81000.2240000000 -151732.3810000000)) ( polygon signal 0 36999.8100000000 -151732.3810000000 36999.8100000000 -151467.7980000000 81000.2240000000 -151467.7980000000 81000.2240000000 -151732.3810000000))
(keepout "" (keepout ""
( polygon signal 0 153593.7260000000 -171693.4370000000 153406.6580000000 -171506.3680000000 158632.1780000000 -166280.8470000000 158632.1780000000 -171599.9040000000 158367.5950000000 -171599.9040000000 158367.5950000000 -166919.5670000000)) ( polygon signal 0 153593.7260000000 -171693.4370000000 153406.6580000000 -171506.3680000000 158406.3510000000 -166506.6750000000 158593.4200000000 -166693.7430000000))
(keepout "" (keepout ""
( polygon signal 0 158406.3510000000 -196693.4610000000 153367.8990000000 -191655.0080000000 153367.8990000000 -171599.9040000000 153632.4820000000 -171599.9040000000 153632.4820000000 -191545.4550000000 158593.4200000000 -196506.3920000000)) ( polygon signal 0 158367.5950000000 -171599.9040000000 158367.5950000000 -166600.2070000000 158632.1780000000 -166600.2070000000 158632.1780000000 -171599.9040000000))
(keepout ""
( polygon signal 0 158406.3510000000 -196693.4610000000 153406.6580000000 -191693.7670000000 153593.7260000000 -191506.6990000000 158593.4200000000 -196506.3920000000))
(keepout ""
( polygon signal 0 153367.8990000000 -191600.2310000000 153367.8990000000 -171599.9040000000 153632.4820000000 -171599.9040000000 153632.4820000000 -191600.2310000000))
(keepout "" (keepout ""
( polygon signal 0 158367.5950000000 -196599.9280000000 158367.5950000000 -191600.2310000000 158632.1780000000 -191600.2310000000 158632.1780000000 -196599.9280000000)) ( polygon signal 0 158367.5950000000 -196599.9280000000 158367.5950000000 -191600.2310000000 158632.1780000000 -191600.2310000000 158632.1780000000 -196599.9280000000))
(keepout "" (keepout ""
...@@ -199,7 +193,9 @@ ...@@ -199,7 +193,9 @@
(keepout "" (keepout ""
( polygon signal 0 103367.8510000000 -236933.3820000000 103367.8510000000 -224266.4540000000 103632.4340000000 -224266.4540000000 103632.4340000000 -236933.3820000000)) ( polygon signal 0 103367.8510000000 -236933.3820000000 103367.8510000000 -224266.4540000000 103632.4340000000 -224266.4540000000 103632.4340000000 -236933.3820000000))
(keepout "" (keepout ""
( polygon signal 0 103406.6070000000 -224359.9900000000 98632.2220000000 -219586.1210000000 98632.2220000000 -224266.4540000000 98367.6380000000 -224266.4540000000 98367.6380000000 -218947.4010000000 103593.6780000000 -224172.9220000000)) ( polygon signal 0 98367.6380000000 -224266.4540000000 98367.6380000000 -219266.7610000000 98632.2220000000 -219266.7610000000 98632.2220000000 -224266.4540000000))
(keepout ""
( polygon signal 0 103406.6070000000 -224359.9900000000 98406.3970000000 -219360.2940000000 98593.4650000000 -219173.2250000000 103593.6780000000 -224172.9220000000))
(keepout "" (keepout ""
( polygon signal 0 31750.0000000000 -35982.3400000000 31750.0000000000 -35717.7570000000 32250.2270000000 -35717.7570000000 32250.2270000000 -35982.3400000000)) ( polygon signal 0 31750.0000000000 -35982.3400000000 31750.0000000000 -35717.7570000000 32250.2270000000 -35717.7570000000 32250.2270000000 -35982.3400000000))
(keepout "" (keepout ""
...@@ -223,9 +219,13 @@ ...@@ -223,9 +219,13 @@
(keepout "" (keepout ""
( polygon signal 0 101999.9760000000 -31632.2300000000 101999.9760000000 -31367.6470000000 113999.7590000000 -31367.6470000000 113999.7590000000 -31632.2300000000)) ( polygon signal 0 101999.9760000000 -31632.2300000000 101999.9760000000 -31367.6470000000 113999.7590000000 -31367.6470000000 113999.7590000000 -31632.2300000000))
(keepout "" (keepout ""
( polygon signal 0 129117.7010000000 -208982.1160000000 129117.7010000000 -181717.6310000000 137382.3110000000 -181717.6310000000 137382.3110000000 -181849.9230000000 137382.3110000000 -208982.1160000000)) ( polygon signal 0 137117.7280000000 -208849.8240000000 137117.7280000000 -181849.9230000000 137382.3110000000 -181849.9230000000 137382.3110000000 -208849.8240000000))
(keepout ""
( polygon signal 0 129249.9930000000 -208982.1160000000 129249.9930000000 -208717.5320000000 137250.0190000000 -208717.5320000000 137250.0190000000 -208982.1160000000))
(keepout "" (keepout ""
( polygon signal 0 129382.2850000000 -208717.5320000000 137117.7280000000 -208717.5320000000 137117.7280000000 -181982.2150000000 129382.2850000000 -181982.2150000000)) ( polygon signal 0 129117.7010000000 -208849.8240000000 129117.7010000000 -181849.9230000000 129382.2850000000 -181849.9230000000 129382.2850000000 -208849.8240000000))
(keepout ""
( polygon signal 0 129249.9930000000 -181982.2150000000 129249.9930000000 -181717.6310000000 137250.0190000000 -181717.6310000000 137250.0190000000 -181982.2150000000))
(keepout "" (keepout ""
( polygon signal 0 98000.2190000000 -132.3410000000 98000.2190000000 132.2430000000 118000.0340000000 132.2430000000 118000.0340000000 -132.3410000000)) ( polygon signal 0 98000.2190000000 -132.3410000000 98000.2190000000 132.2430000000 118000.0340000000 132.2430000000 118000.0340000000 -132.3410000000))
(keepout "" (keepout ""
...@@ -283,9 +283,13 @@ ...@@ -283,9 +283,13 @@
(keepout "" (keepout ""
( polygon signal 0 158593.4200000000 -83875.5400000000 158406.3510000000 -83688.4720000000 163406.5630000000 -78688.2620000000 163593.6320000000 -78875.3300000000)) ( polygon signal 0 158593.4200000000 -83875.5400000000 158406.3510000000 -83688.4720000000 163406.5630000000 -78688.2620000000 163593.6320000000 -78875.3300000000))
(keepout "" (keepout ""
( polygon signal 0 98367.6380000000 -242252.9540000000 98367.6380000000 -236933.3820000000 98632.2220000000 -236933.3820000000 98632.2220000000 -241613.7180000000 103406.6070000000 -236839.8490000000 103593.6780000000 -237026.9170000000)) ( polygon signal 0 98593.4660000000 -242027.1290000000 98406.3970000000 -241839.5420000000 103406.6070000000 -236839.8490000000 103593.6780000000 -237026.9170000000))
(keepout ""
( polygon signal 0 98367.6380000000 -241933.0780000000 98367.6380000000 -236933.3820000000 98632.2220000000 -236933.3820000000 98632.2220000000 -241933.0780000000))
(keepout ""
( polygon signal 0 137999.8460000000 -113732.1160000000 137999.8460000000 -113467.5320000000 151000.0840000000 -113467.5320000000 151000.0840000000 -113732.1160000000 137999.8460000000 -113732.1160000000 137999.8460000000 -113467.5320000000))
(keepout "" (keepout ""
( polygon signal 0 137999.8460000000 -113732.1160000000 137999.8460000000 -113467.5320000000 151000.0840000000 -113467.5320000000 151000.0840000000 -113732.1160000000)) ( polygon signal 0 77999.8890000000 -113732.1160000000 77999.8890000000 -113467.5320000000))
(keepout "" (keepout ""
( polygon signal 0 96999.7640000000 -113732.1160000000 96999.7640000000 -113467.5320000000 118999.9710000000 -113467.5320000000 118999.9710000000 -113732.1160000000)) ( polygon signal 0 96999.7640000000 -113732.1160000000 96999.7640000000 -113467.5320000000 118999.9710000000 -113467.5320000000 118999.9710000000 -113732.1160000000))
(keepout "" (keepout ""
......
...@@ -11,30 +11,12 @@ ...@@ -11,30 +11,12 @@
(via_costs 50) (via_costs 50)
(plane_via_costs 5) (plane_via_costs 5)
(start_ripup_costs 100) (start_ripup_costs 100)
(start_pass_no 80) (start_pass_no 81)
(layer_rule F.Cu (layer_rule F.Cu
(active on)
(preferred_direction vertical)
(preferred_direction_trace_costs 1.8)
(against_preferred_direction_trace_costs 3.0)
)
(layer_rule B.Cu
(active on)
(preferred_direction horizontal)
(preferred_direction_trace_costs 1.0)
(against_preferred_direction_trace_costs 1.8)
)
(layer_rule F.Mask
(active on) (active on)
(preferred_direction vertical) (preferred_direction vertical)
(preferred_direction_trace_costs 1.0) (preferred_direction_trace_costs 1.0)
(against_preferred_direction_trace_costs 2.2) (against_preferred_direction_trace_costs 2.3)
)
(layer_rule B.Mask
(active on)
(preferred_direction horizontal)
(preferred_direction_trace_costs 1.8)
(against_preferred_direction_trace_costs 2.6)
) )
) )
(rule (rule
...@@ -55,7 +37,7 @@ ...@@ -55,7 +37,7 @@
(width 1000.0) (width 1000.0)
) )
(circuit (circuit
(use_layer F.Cu B.Cu F.Mask B.Mask) (use_layer F.Cu)
) )
) )
) )
\ No newline at end of file
...@@ -23,23 +23,23 @@ ...@@ -23,23 +23,23 @@
(network_out (network_out
(net 3v3 (net 3v3
(wire (wire
(path F.Mask 10000 (path F.Cu 10000
890300 -600650
918654 -629004
1049358 -629004
1131600 -711246
1131600 -816500 1131600 -816500
1131600 -694273
1066334 -629007
918657 -629007
890300 -600650
) )
) )
) )
(net NET1 (net NET1
(wire (wire
(path B.Cu 10000 (path F.Cu 10000
864900 -600650 864900 -600650
916308 -652058 914245 -649995
1072390 -652058 1070350 -649995
1086143 -665811 1086128 -665773
1086143 -760357 1086128 -760372
1030000 -816500 1030000 -816500
) )
) )
......
This diff is collapsed.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment