mirror of https://github.com/VLSIDA/OpenRAM.git
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
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.
|
|
"""
|
|
|
|
pin_names = ["bl", "br", "dout", "en", "vdd", "gnd"]
|
|
(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"])
|
|
|
|
def __init__(self, name):
|
|
design.design.__init__(self, name)
|
|
debug.info(2, "Create sense_amp")
|
|
|
|
self.width = sense_amp.width
|
|
self.height = sense_amp.height
|
|
self.pin_map = sense_amp.pin_map
|
|
|
|
def analytical_delay(self, slew, load=0.0):
|
|
from tech import spice
|
|
r = spice["min_tx_r"]/(10)
|
|
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)
|
|
|
|
def analytical_power(self, slew, load=0.0):
|
|
#This is just skeleton code which returns a magic number. The sense amp consumes static
|
|
#power during its operation and some dynamic power due to the switching.
|
|
return 2
|