2.1 Reading 2.2 Prelab

advertisement
Neuromorphic Engineering II Lab 2, Spring 2013
Lab 2
1
February 26, 2013
SPICE
The objectives of this lab are to:
• Learn how to use SPICE for transient (time-stepping) circuit simulations. Unlike AC
simulations, which are linearized around a DC operating point, transient simulations
use the full nonlinear device model. As a result they are much slower but can reveal
large signal and transient (e.g. startup) behavior. They are also the only device-level
simulations possible for unstable or multistable circuits like clock generators, neuron
circuits, or flip-flops.
• Simulate an integrate and fire neuron circuit.
This week, we will use the software tool S-Edit to enter schematics and T-Spice to run
transient circuit simulations.
2.1
Reading
Read the lecture notes and revert to the online TSpice documentation (PDF files) when
looking for details.
2.2
Prelab
1. The prelab should be completed before any computer is touched.
2. This exercise asks you to write a spice netlist by hand. It is a tedious excercise, but
very useful.
a. Use the circuit diagram of Fig. 2.1 and write the circuit netlist using your favourite
text editor.
b. Use the labels nmos and pmos for the transistor models
c. Use a value of 500fF for the Capacitor.
d. As we will use the scale option, in the simulation, use dimensionless values for
L and W (e.g. W=12, L=6).
e. Save the file as myaxonhillock.sp
Neuromorphic Engineering II Lab 2, Spring 2013
2
Figure 2.1: Axon Hillock circuit.
f. Using the neuron circuit in Fig. 2.1, reason what happens to the membrane potential, Vmem, when a DC input current is injected in the node Vmem itself, and
charges up the membrane. Also explain how the spike output Vout of the circuit
behaves.
2.3
Simulation using Tspice
We will use the Tanner Tools to simulate the neuron circuit in Fig. 2.2. This is the first
VLSI integrate-and-fire circuit that was proposed by Carver Mead and colleagues in the
late ’eighties.
2.4
Experiments
The SPICE simulation will be run directly from within S-Edit: S-Edit can generate spice
files with both schematics and commands, in spice-format, and pass them to T-Spice. You
will learn to generate these files automatically, but also edit them by hand.
Experiment 2: Simulating the axon-hillock circuit
You will be running simulations from a file in which most of the work has already been
done for you. But you are requested to take notes of the simulations and hand-in a report in
which you print all the anwsers to the questions below and include the plots requested. In
the report, include the code of the “myaxonhillock.sp” file that you made in the prelab.
1. Open the file exercice3 provided by the TA.
Neuromorphic Engineering II Lab 2, Spring 2013
3
Figure 2.2: Axon Hillock circuit.
2. Open the cell “axonhillock” and study the circuit.
3. Study all of the options and settings in the Spice setup diag box (from the menu
Setup→Spice Simulation). What do the options in the “Additional spice commands”
mean? (hint: you can study the t-spice manual from the t-spice help menu.)
4. Run a Spice simulation, and study the output. Are the output waveforms like you
expect them to be from the pre-lab? Explain why (or why not).
5. Re-run the simulation with the “power-up” option in the transient analysis. Ho do the
simulations differ? What does this option do? (hint: see the t-spice manual.)
6. Change the value of the feedback capacitor and experiment with values ranging from
10fF to 500fF. Run the simulations for at least 3 different value settings. What
changes in the simulations? Can you eplain why?
7. Change the input current and re-run the simulation until you get 10 spikes in total.
Produce a plot the waveforms on separate windows, with a zoomed version of just 2
spikes (and include it as a figure in the report).
8. Now switch to T-Spice, and open the file “axonhillock.sp” from within the main TSpice window. Study it, and see if the main structure differs from the spice-file you
wrote by hand. From the t-spice manual find out how to measure the average current
flowing through the n-FET of the first inverter connected to Vmem, in the transient
analysis. Re-run the simulation, find the measurement and note it in the report. The
result of the measurement will be toward the end of the “axonhillock.out” file.
9. Find out how to measure the average power dissipated through the Vdd voltage
source, re-run the simulation, and print in the report the result obtained. What percentage of the total power budget is dissipated by the first inverter? (hint: use the
current measurement made above to compute it).
Neuromorphic Engineering II Lab 2, Spring 2013
4
Figure 2.3: Axon Hillock circuit.
Experiment 3: Low-power silicon neuron
Here you will run simulations on a new silicon-neuron circuit, and compare its power dissipation with the one of the standard axon-hillock circuit.
1. Copy the “axonhillock” into a new cell (e.g. soma lowpower).
2. Modify the new cell, and create a circuit exactly as shown in Fig. 2.3 (including the
values of the capacitors and biases).
3. Run the simulation and verify that the circuit works as a silicon neuron.
4. Find the value of the input current that produces the same number of spikes used in
the axonhillock simulations, where you computed the average power dissipation (10).
5. Measure the average power dissipation of this circuit, by adding the right command
in the “Additional spice commands” of the S-Edit Spice-Simulation dialog window.
6. How does this power dissipation figure compare to the one of the axon-hillock circuit? What is the reason for this behavior? Explain this in the report.
Congratulations, you have done your first transient simulation in SPICE. Perhaps now you
can understand why people both love and hate simulators. Never forget that this is only a
simulation, and even the best transistor models don’t capture everything that is important
for analog (or even digital) circuit performance.
Neuromorphic Engineering II Lab 2, Spring 2013
2.5
5
What we expect
How to use basic SPICE commands to simulate circuits. What are the limitations of circuit
simulators? What characteristics of circuits do they not model? What makes a low-power
silicon neuron so low-power?
2.6
Next Week
Layout using LEDIT.
Download