Skip to content

Commit

Permalink
Giving up on Latex in circuit diagram for now (there is a bug in rsvg…
Browse files Browse the repository at this point in the history
…-convert which messes up the fonts)
  • Loading branch information
hpretl committed Aug 20, 2024
1 parent 605fde4 commit f12dcfd
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 44 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
/sizing/techsweep_*_files
/sizing/*.out.ipynb
/xschem/simulations
*.fdb_latexmk
18 changes: 6 additions & 12 deletions figures/_fig_middlebrook_current.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ with sd.Drawing(canvas='svg') as d:
d.config(unit=2)
d.config(fontsize=16)
elm.Ground()
elm.SourceI().up().label(r'$I_\mathrm{test}$').dot()
#elm.SourceI().up().label(r'$I_\mathrm{test}$').dot()
elm.SourceI().up().label('Itest').dot()
d.push()
line_left=elm.Line().left().length(2).dot(open=True)
elm.CurrentLabelInline(direction='in', ofst=-0.15).at(line_left).label(r'$I_\mathrm{f}$')
#elm.CurrentLabelInline(direction='in', ofst=-0.15).at(line_left).label(r'$I_\mathrm{f}$')
elm.CurrentLabelInline(direction='in', ofst=-0.15).at(line_left).label('If')
d.pop()
line_right=elm.Line().right().length(2).dot(open=True)
elm.CurrentLabelInline(direction='out', ofst=-0.15).at(line_right).label(r'$I_\mathrm{r}$')
# elm.Vdd()
# elm.SourceI().down().label(r'$I_\mathrm{bias}$', ofst=-2)
# elm.Dot()
# M1 = elm.AnalogNFet(offset_gate=False).drop('source').theta(0).reverse().label('$W/L$', loc='right')
# elm.Ground()
# elm.Line().left().at(M1.gate).length(0.5)
# elm.Line().up().toy(M1.drain)
# elm.Line().right().to(M1.drain)
# elm.Arrow().at(M1.drain, dx=1.5).down().length(2).label(r'$V_\mathrm{GS}$', ofst=-1)
#elm.CurrentLabelInline(direction='out', ofst=-0.15).at(line_right).label(r'$I_\mathrm{r}$')
elm.CurrentLabelInline(direction='out', ofst=-0.15).at(line_right).label('Ir')
```
9 changes: 6 additions & 3 deletions figures/_fig_middlebrook_voltage.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ with sd.Drawing(canvas='svg') as d:
d.config(unit=2)
d.config(fontsize=16)
d.push()
elm.SourceV().left().label(r'$V_\mathrm{test}$')
elm.Line().left().length(1).dot(open=True).label(r'$V_\mathrm{f}$')
#elm.SourceV().left().label(r'$V_\mathrm{test}$')
elm.SourceV().left().label('Vtest')
#elm.Line().left().length(1).dot(open=True).label(r'$V_\mathrm{f}$')
elm.Line().left().length(1).dot(open=True).label('Vf')
d.pop()
elm.Line().right().length(1).dot(open=True).label(r'$V_\mathrm{r}$')
#elm.Line().right().length(1).dot(open=True).label(r'$V_\mathrm{r}$')
elm.Line().right().length(1).dot(open=True).label('Vr')
```
9 changes: 6 additions & 3 deletions figures/_fig_mosfet_diode.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ with sd.Drawing(canvas='svg') as d:
d.config(unit=2)
d.config(fontsize=16)
elm.Vdd()
elm.SourceI().down().label(r'$I_\mathrm{bias}$', ofst=-2)
#elm.SourceI().down().label(r'$I_\mathrm{bias}$', ofst=-2)
elm.SourceI().down().label('Ibias', ofst=-2)
elm.Dot()
M1 = elm.AnalogNFet(offset_gate=False).drop('source').theta(0).reverse().label('$W/L$', loc='right')
#M1 = elm.AnalogNFet(offset_gate=False).drop('source').theta(0).reverse().label('$W/L$', loc='right')
M1 = elm.AnalogNFet(offset_gate=False).drop('source').theta(0).reverse().label('W/L', loc='right')
elm.Ground()
elm.Line().left().at(M1.gate).length(0.5)
elm.Line().up().toy(M1.drain)
elm.Line().right().to(M1.drain)
elm.Arrow().at(M1.drain, dx=1.5).down().length(2).label(r'$V_\mathrm{GS}$', ofst=-1)
#elm.Arrow().at(M1.drain, dx=1.5).down().length(2).label(r'$V_\mathrm{GS}$', ofst=-1)
elm.Arrow().at(M1.drain, dx=-2).down().length(2).label('VGS')
```
18 changes: 12 additions & 6 deletions figures/_fig_mosfet_diode_openloop.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,37 @@ import schemdraw.elements as elm
with sd.Drawing(canvas='svg') as d:
d.config(unit=2)
d.config(fontsize=16)
Cgs = elm.Capacitor().up().label(r'$C_\mathrm{gs}$')
#Cgs = elm.Capacitor().up().label(r'$C_\mathrm{gs}$')
Cgs = elm.Capacitor().up().label('Cgs')
d.push()
elm.Line().right().length(0.5)
elm.DotDotDot()
elm.Line().right().length(0.5).dot()
Ids1 = elm.SourceI().down().label(r'$g_\mathrm{m} \cdot v_\mathrm{in}$').dot()
#Ids1 = elm.SourceI().down().label(r'$g_\mathrm{m} \cdot v_\mathrm{in}$').dot()
Ids1 = elm.SourceI().down().label('gm vin').dot()
elm.Ground()
d.push()
elm.Line().left().length(3)
d.pop()
elm.Line().right().length(3).dot()
Gds = elm.Resistor().up().dot().label(r'$g_\mathrm{ds}$')
#Gds = elm.Resistor().up().dot().label(r'$g_\mathrm{ds}$')
Gds = elm.Resistor().up().dot().label('gds')
d.push()
elm.Line().left().length(3)
d.pop()
elm.Line().right().length(3)
d.move(dx=0, dy=-2)
d.push()
Cgs_dummy = elm.Capacitor().up().label(r'$C_\mathrm{gs}^{*}$')
#Cgs_dummy = elm.Capacitor().up().label(r'$C_\mathrm{gs}^{*}$')
Cgs_dummy = elm.Capacitor().up().label('Cgs*')
d.move(dx=1.5, dy=0)
elm.Arrow().down().length(2).label(r'$v_\mathrm{out}$')
#elm.Arrow().down().length(2).label(r'$v_\mathrm{out}$')
elm.Arrow().down().length(2).label('vout')
d.pop()
elm.Line().left().length(3)
d.pop()
d.move(dx=-1.5, dy=0)
elm.Arrow().down().length(2).label(r'$v_\mathrm{in}$')
#elm.Arrow().down().length(2).label(r'$v_\mathrm{in}$')
elm.Arrow().down().length(2).label('vin')
```
15 changes: 10 additions & 5 deletions figures/_fig_mosfet_diode_small_signal.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,31 @@ import schemdraw.elements as elm
with sd.Drawing(canvas='svg') as d:
d.config(unit=2)
d.config(fontsize=16)
Cgs = elm.Capacitor().up().label(r'$C_\mathrm{gs}$')
#Cgs = elm.Capacitor().up().label(r'$C_\mathrm{gs}$')
Cgs = elm.Capacitor().up().label('Cgs')
d.push()
elm.Line().right().length(3).dot()
Ids1 = elm.SourceI().down().label(r'$g_\mathrm{m} \cdot v_\mathrm{gs}$').dot()
#Ids1 = elm.SourceI().down().label(r'$g_\mathrm{m} \cdot v_\mathrm{gs}$').dot()
Ids1 = elm.SourceI().down().label('gm vgs').dot()
elm.Ground()
d.push()
elm.Line().left().length(3)
d.pop()
elm.Line().right().length(3).dot()
Gds = elm.Resistor().up().dot().label(r'$g_\mathrm{ds}$')
#Gds = elm.Resistor().up().dot().label(r'$g_\mathrm{ds}$')
Gds = elm.Resistor().up().dot().label('gds')
d.push()
elm.Line().left().length(3)
d.pop()
elm.Line().right().length(3)
d.move(dx=0, dy=-2)
d.push()
In = elm.SourceI().up().label(r'$i_\mathrm{bias}$')
#In = elm.SourceI().up().label(r'$i_\mathrm{bias}$')
In = elm.SourceI().up().label('ibias')
d.pop()
elm.Line().left().length(3)
d.pop()
d.move(dx=-1.5, dy=0)
elm.Arrow().down().length(2).label(r'$v_\mathrm{gs}$')
#elm.Arrow().down().length(2).label(r'$v_\mathrm{gs}$')
elm.Arrow().down().length(2).label('vgs')
```
15 changes: 10 additions & 5 deletions figures/_fig_mosfet_diode_small_signal_w_noise.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,28 @@ import schemdraw.elements as elm
with sd.Drawing(canvas='svg') as d:
d.config(unit=2)
d.config(fontsize=16)
Cgs = elm.Capacitor().up().label(r'$C_\mathrm{gs}$')
#Cgs = elm.Capacitor().up().label(r'$C_\mathrm{gs}$')
Cgs = elm.Capacitor().up().label('Cgs')
d.push()
elm.Line().right().length(3).dot()
Ids1 = elm.SourceI().down().label(r'$g_\mathrm{m} \cdot v_\mathrm{gs}$').dot()
#Ids1 = elm.SourceI().down().label(r'$g_\mathrm{m} \cdot v_\mathrm{gs}$').dot()
Ids1 = elm.SourceI().down().label('gm vgs').dot()
elm.Ground()
d.push()
elm.Line().left().length(3)
d.pop()
elm.Line().right().length(3).dot()
Gds = elm.Resistor().up().dot().label(r'$g_\mathrm{ds}$')
#Gds = elm.Resistor().up().dot().label(r'$g_\mathrm{ds}$')
Gds = elm.Resistor().up().dot().label('gds')
d.push()
elm.Line().left().length(3)
d.pop()
elm.Line().right().length(3)
In = elm.SourceSin().down().label(r'$\overline{I_\mathrm{n,d}^2}$')
#In = elm.SourceSin().down().label(r'$\overline{I_\mathrm{n,d}^2}$')
In = elm.SourceSin().down().label('In,d2')
elm.Line().left().length(3)
d.pop()
d.move(dx=-1.5, dy=0)
elm.Arrow().down().length(2).label(r'$v_\mathrm{gs}$')
#elm.Arrow().down().length(2).label(r'$v_\mathrm{gs}$')
elm.Arrow().down().length(2).label('vgs')
```
9 changes: 6 additions & 3 deletions figures/_fig_mosfet_large_signal_model.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@ with sd.Drawing(canvas='svg') as d:
elm.Line().left().length(1).dot(open=True).label('G', 'left').idot()
d.pop()
d.push()
Cgs = elm.Capacitor().down().label(r'$C_\mathrm{GS}$')
#Cgs = elm.Capacitor().down().label(r'$C_\mathrm{GS}$')
Cgs = elm.Capacitor().down().label('CGS')
elm.Line().right().length(6).dot()
l1 = elm.Line().down().length(1).dot(open=True).label('S', 'left')
d.pop()
Cgd = elm.Capacitor().right().length(6).label(r'$C_\mathrm{GD}$').dot()
#Cgd = elm.Capacitor().right().length(6).label(r'$C_\mathrm{GD}$').dot()
Cgd = elm.Capacitor().right().length(6).label('CGD').dot()
d.push()
Ids = elm.SourceI().down().label(r'$I_\mathrm{DS} = f(V_\mathrm{GS}, V_\mathrm{DS}, V_\mathrm{SB})$')
#Ids = elm.SourceI().down().label(r'$I_\mathrm{DS} = f(V_\mathrm{GS}, V_\mathrm{DS}, V_\mathrm{SB})$')
Ids = elm.SourceI().down().label('IDS = f(VGS, VDS, VSB)$')
d.pop()
elm.Line().right().dot(open=True).length(2).label('D', 'right')
d.move(dy=-2, dx=0)
Expand Down
18 changes: 12 additions & 6 deletions figures/_fig_mosfet_small_signal_model.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,29 @@ with sd.Drawing(canvas='svg') as d:
elm.Line().left().length(1).dot(open=True).label('G', 'left').idot()
d.pop()
d.push()
Cgs = elm.Capacitor().down().label(r'$C_\mathrm{gs}$')
#Cgs = elm.Capacitor().down().label(r'$C_\mathrm{gs}$')
Cgs = elm.Capacitor().down().label('Cgs')
elm.Line().right().length(3).dot()
l1 = elm.Line().down().length(1).dot(open=True).label('S', 'left')
d.pop()
Cgd = elm.Capacitor().right().length(3).label(r'$C_\mathrm{gd}$').dot()
#Cgd = elm.Capacitor().right().length(3).label(r'$C_\mathrm{gd}$').dot()
Cgd = elm.Capacitor().right().length(3).label('Cgd').dot()
d.push()
Ids1 = elm.SourceI().down().label(r'$g_\mathrm{m} \cdot v_\mathrm{gs}$')
#Ids1 = elm.SourceI().down().label(r'$g_\mathrm{m} \cdot v_\mathrm{gs}$')
Ids1 = elm.SourceI().down().label('gm vgs')
elm.Line().right().length(3).dot()
d.push()
Ids2 = elm.SourceI().up().label(r'$g_\mathrm{mb} \cdot v_\mathrm{sb}$').dot()
#Ids2 = elm.SourceI().up().label(r'$g_\mathrm{mb} \cdot v_\mathrm{sb}$').dot()
Ids2 = elm.SourceI().up().label('gmb vsb').dot()
d.pop()
elm.Line().right().length(3).dot()
d.push()
Rds = elm.Resistor().up().dot().label(r'$g_\mathrm{ds}$')
#Rds = elm.Resistor().up().dot().label(r'$g_\mathrm{ds}$')
Rds = elm.Resistor().up().dot().label('gds')
d.pop()
elm.Line().right().length(3)
In = elm.SourceSin().up().label(r'$\overline{I_\mathrm{n}^2}$').dot()
#In = elm.SourceSin().up().label(r'$\overline{I_\mathrm{n}^2}$').dot()
In = elm.SourceSin().up().label('In2').dot()
d.pop()
elm.Line().right().dot(open=True).length(12).label('D', 'right')
d.move(dy=-2, dx=0)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jupyter
schemdraw[svgmath]
schemdraw
numpy==1.26.4
pandas
matplotlib

0 comments on commit f12dcfd

Please sign in to comment.