2016-11-08 18:57:35 +01:00
|
|
|
import design
|
|
|
|
|
import debug
|
|
|
|
|
import utils
|
|
|
|
|
from tech import GDS,layer
|
|
|
|
|
|
|
|
|
|
class sense_amp(design.design):
|
|
|
|
|
"""
|
|
|
|
|
This module implements the single sense amp cell used in the design. It
|
|
|
|
|
is a hand-made cell, so the layout and netlist should be available in
|
|
|
|
|
the technology library.
|
|
|
|
|
Sense amplifier to read a pair of bit-lines.
|
|
|
|
|
"""
|
|
|
|
|
|
2017-09-30 01:22:13 +02:00
|
|
|
pin_names = ["bl", "br", "dout", "en", "vdd", "gnd"]
|
2017-08-24 00:02:15 +02:00
|
|
|
(width,height) = utils.get_libcell_size("sense_amp", GDS["unit"], layer["boundary"])
|
|
|
|
|
pin_map = utils.get_libcell_pins(pin_names, "sense_amp", GDS["unit"], layer["boundary"])
|
2016-11-08 18:57:35 +01:00
|
|
|
|
|
|
|
|
def __init__(self, name):
|
|
|
|
|
design.design.__init__(self, name)
|
2017-11-14 22:24:14 +01:00
|
|
|
debug.info(2, "Create sense_amp")
|
2016-11-08 18:57:35 +01:00
|
|
|
|
2017-08-24 00:02:15 +02:00
|
|
|
self.width = sense_amp.width
|
|
|
|
|
self.height = sense_amp.height
|
|
|
|
|
self.pin_map = sense_amp.pin_map
|
2016-11-08 18:57:35 +01:00
|
|
|
|
2017-11-09 20:13:44 +01:00
|
|
|
def analytical_delay(self, slew, load=0.0):
|
2017-05-30 21:50:07 +02:00
|
|
|
from tech import spice
|
|
|
|
|
r = spice["min_tx_r"]/(10)
|
2017-07-06 17:42:25 +02:00
|
|
|
c_para = spice["min_tx_drain_c"]
|
|
|
|
|
result = self.cal_delay_with_rc(r = r, c = c_para+load, slew = slew)
|
|
|
|
|
return self.return_delay(result.delay, result.slew)
|
2017-05-30 21:50:07 +02:00
|
|
|
|
2018-02-27 01:32:28 +01:00
|
|
|
def analytical_power(self, proc, vdd, temp, load):
|
2018-03-02 08:34:15 +01:00
|
|
|
"""Returns dynamic and leakage power. Results in nW"""
|
|
|
|
|
#Power in this module currently not defined. Returns 0 nW (leakage and dynamic).
|
2018-02-23 04:35:54 +01:00
|
|
|
total_power = self.return_power()
|
|
|
|
|
return total_power
|