mirror of https://github.com/VLSIDA/OpenRAM.git
Code format fixes
This commit is contained in:
parent
aefe46394c
commit
242d90f543
|
|
@ -44,9 +44,6 @@ class bank(design):
|
||||||
# The local control signals are gated when we have bank select logic,
|
# The local control signals are gated when we have bank select logic,
|
||||||
# so this prefix will be added to all of the input signals to create
|
# so this prefix will be added to all of the input signals to create
|
||||||
# the internal gated signals.
|
# the internal gated signals.
|
||||||
#if self.num_banks>1:
|
|
||||||
# self.prefix="gated_"
|
|
||||||
#else:
|
|
||||||
self.prefix=""
|
self.prefix=""
|
||||||
|
|
||||||
self.create_netlist()
|
self.create_netlist()
|
||||||
|
|
@ -98,9 +95,6 @@ class bank(design):
|
||||||
|
|
||||||
# For more than one bank, we have a bank select and name
|
# For more than one bank, we have a bank select and name
|
||||||
# the signals gated_*.
|
# the signals gated_*.
|
||||||
#if self.num_banks > 1:
|
|
||||||
# for port in self.all_ports:
|
|
||||||
# self.add_pin("bank_sel{}".format(port), "INPUT")
|
|
||||||
for port in self.read_ports:
|
for port in self.read_ports:
|
||||||
self.add_pin("s_en{0}".format(port), "INPUT")
|
self.add_pin("s_en{0}".format(port), "INPUT")
|
||||||
for port in self.all_ports:
|
for port in self.all_ports:
|
||||||
|
|
@ -128,8 +122,6 @@ class bank(design):
|
||||||
self.route_port_address(port)
|
self.route_port_address(port)
|
||||||
self.route_column_address_lines(port)
|
self.route_column_address_lines(port)
|
||||||
self.route_control_lines(port)
|
self.route_control_lines(port)
|
||||||
#if self.num_banks > 1:
|
|
||||||
# self.route_bank_select(port)
|
|
||||||
|
|
||||||
self.route_supplies()
|
self.route_supplies()
|
||||||
|
|
||||||
|
|
@ -171,7 +163,6 @@ class bank(design):
|
||||||
self.create_port_data()
|
self.create_port_data()
|
||||||
self.create_port_address()
|
self.create_port_address()
|
||||||
self.create_column_decoder()
|
self.create_column_decoder()
|
||||||
#self.create_bank_select()
|
|
||||||
|
|
||||||
def compute_instance_offsets(self):
|
def compute_instance_offsets(self):
|
||||||
"""
|
"""
|
||||||
|
|
@ -252,8 +243,6 @@ class bank(design):
|
||||||
y_offset = min(self.column_decoder_offsets[port].y, self.port_data[port].column_mux_offset.y)
|
y_offset = min(self.column_decoder_offsets[port].y, self.port_data[port].column_mux_offset.y)
|
||||||
else:
|
else:
|
||||||
y_offset = self.port_address_offsets[port].y
|
y_offset = self.port_address_offsets[port].y
|
||||||
#if self.num_banks > 1:
|
|
||||||
# y_offset += self.bank_select.height + drc("well_to_well")
|
|
||||||
self.bank_select_offsets[port] = vector(-x_offset, -y_offset)
|
self.bank_select_offsets[port] = vector(-x_offset, -y_offset)
|
||||||
|
|
||||||
def compute_instance_port1_offsets(self):
|
def compute_instance_port1_offsets(self):
|
||||||
|
|
@ -311,12 +300,11 @@ class bank(design):
|
||||||
self.place_port_address(self.port_address_offsets)
|
self.place_port_address(self.port_address_offsets)
|
||||||
|
|
||||||
self.place_column_decoder(self.column_decoder_offsets)
|
self.place_column_decoder(self.column_decoder_offsets)
|
||||||
#self.place_bank_select(self.bank_select_offsets)
|
# self.place_bank_select(self.bank_select_offsets)
|
||||||
|
|
||||||
def compute_sizes(self):
|
def compute_sizes(self):
|
||||||
""" Computes the required sizes to create the bank """
|
""" Computes the required sizes to create the bank """
|
||||||
|
|
||||||
|
|
||||||
self.num_words_per_bank = self.num_words / self.num_banks
|
self.num_words_per_bank = self.num_words / self.num_banks
|
||||||
self.num_bits_per_bank = self.word_size * self.num_words_per_bank
|
self.num_bits_per_bank = self.word_size * self.num_words_per_bank
|
||||||
|
|
||||||
|
|
@ -355,12 +343,8 @@ class bank(design):
|
||||||
# These will be outputs of the gaters if this is multibank, if not, normal signals.
|
# These will be outputs of the gaters if this is multibank, if not, normal signals.
|
||||||
self.control_signals = []
|
self.control_signals = []
|
||||||
for port in self.all_ports:
|
for port in self.all_ports:
|
||||||
#if self.num_banks > 1:
|
|
||||||
# self.control_signals.append(["gated_" + str for str in self.input_control_signals[port]])
|
|
||||||
#else:
|
|
||||||
self.control_signals.append(self.input_control_signals[port])
|
self.control_signals.append(self.input_control_signals[port])
|
||||||
|
|
||||||
|
|
||||||
# The central bus is the column address (one hot) and row address (binary)
|
# The central bus is the column address (one hot) and row address (binary)
|
||||||
if self.col_addr_size>0:
|
if self.col_addr_size>0:
|
||||||
self.num_col_addr_lines = 2**self.col_addr_size
|
self.num_col_addr_lines = 2**self.col_addr_size
|
||||||
|
|
@ -370,8 +354,8 @@ class bank(design):
|
||||||
|
|
||||||
# Gap between decoder and array
|
# Gap between decoder and array
|
||||||
self.decoder_gap = max(2 * drc("pwell_to_nwell") + drc("nwell_enclose_active"),
|
self.decoder_gap = max(2 * drc("pwell_to_nwell") + drc("nwell_enclose_active"),
|
||||||
2 * self.m2_pitch,
|
2 * self.m2_pitch,
|
||||||
drc("nwell_to_nwell"))
|
drc("nwell_to_nwell"))
|
||||||
|
|
||||||
def add_modules(self):
|
def add_modules(self):
|
||||||
""" Add all the modules using the class loader """
|
""" Add all the modules using the class loader """
|
||||||
|
|
@ -409,9 +393,6 @@ class bank(design):
|
||||||
port=port,
|
port=port,
|
||||||
bit_offsets=self.bit_offsets))
|
bit_offsets=self.bit_offsets))
|
||||||
|
|
||||||
#if(self.num_banks > 1):
|
|
||||||
# self.bank_select = factory.create(module_type="bank_select")
|
|
||||||
|
|
||||||
def create_bitcell_array(self):
|
def create_bitcell_array(self):
|
||||||
""" Creating Bitcell Array """
|
""" Creating Bitcell Array """
|
||||||
self.bitcell_array_inst=self.add_inst(name="bitcell_array",
|
self.bitcell_array_inst=self.add_inst(name="bitcell_array",
|
||||||
|
|
@ -607,7 +588,7 @@ class bank(design):
|
||||||
self.copy_layout_pin(inst, "gnd")
|
self.copy_layout_pin(inst, "gnd")
|
||||||
|
|
||||||
if 'vpb' in self.bitcell_array_inst.mod.pins and 'vnb' in self.bitcell_array_inst.mod.pins:
|
if 'vpb' in self.bitcell_array_inst.mod.pins and 'vnb' in self.bitcell_array_inst.mod.pins:
|
||||||
for pin_name, supply_name in zip(['vnb','vpb'],['gnd','vdd']):
|
for pin_name, supply_name in zip(['vnb', 'vpb'], ['gnd', 'vdd']):
|
||||||
self.copy_layout_pin(self.bitcell_array_inst, pin_name, new_name=supply_name)
|
self.copy_layout_pin(self.bitcell_array_inst, pin_name, new_name=supply_name)
|
||||||
|
|
||||||
# If we use the pinvbuf as the decoder, we need to add power pins.
|
# If we use the pinvbuf as the decoder, we need to add power pins.
|
||||||
|
|
@ -688,7 +669,6 @@ class bank(design):
|
||||||
names=self.control_signals[0],
|
names=self.control_signals[0],
|
||||||
length=control_bus_length,
|
length=control_bus_length,
|
||||||
vertical=True,
|
vertical=True,
|
||||||
#make_pins=(self.num_banks==1),
|
|
||||||
make_pins=(True),
|
make_pins=(True),
|
||||||
pitch=self.m3_pitch)
|
pitch=self.m3_pitch)
|
||||||
|
|
||||||
|
|
@ -706,7 +686,6 @@ class bank(design):
|
||||||
names=list(reversed(self.control_signals[1])),
|
names=list(reversed(self.control_signals[1])),
|
||||||
length=control_bus_length,
|
length=control_bus_length,
|
||||||
vertical=True,
|
vertical=True,
|
||||||
#make_pins=(self.num_banks==1),
|
|
||||||
make_pins=(True),
|
make_pins=(True),
|
||||||
pitch=self.m3_pitch)
|
pitch=self.m3_pitch)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,12 +66,12 @@ class textSection(baseSection):
|
||||||
self.text = text
|
self.text = text
|
||||||
|
|
||||||
def expand(self, dict, fd):
|
def expand(self, dict, fd):
|
||||||
varRE = re.compile('\{\{ (\S*) \}\}')
|
varRE = re.compile(r'\{\{ (\S*) \}\}')
|
||||||
vars = varRE.finditer(self.text)
|
vars = varRE.finditer(self.text)
|
||||||
newText = self.text
|
newText = self.text
|
||||||
for var in vars:
|
for var in vars:
|
||||||
newText = newText.replace('{{ ' + var.group(1) + ' }}', str(dict[var.group(1)]))
|
newText = newText.replace('{{ ' + var.group(1) + ' }}', str(dict[var.group(1)]))
|
||||||
print(newText, end='', file=fd)
|
fd.write(newText)
|
||||||
|
|
||||||
|
|
||||||
class template:
|
class template:
|
||||||
|
|
@ -91,10 +91,10 @@ class template:
|
||||||
|
|
||||||
self.baseSectionSection = baseSection()
|
self.baseSectionSection = baseSection()
|
||||||
context = [self.baseSectionSection]
|
context = [self.baseSectionSection]
|
||||||
forRE = re.compile('\s*\{% for (\S*) in (\S*) %\}')
|
forRE = re.compile(r'\s*\{% for (\S*) in (\S*) %\}')
|
||||||
endforRE = re.compile('\s*\{% endfor %\}')
|
endforRE = re.compile(r'\s*\{% endfor %\}')
|
||||||
ifRE = re.compile('\s*{% if (.*) %\}')
|
ifRE = re.compile(r'\s*{% if (.*) %\}')
|
||||||
endifRE = re.compile('\s*\{% endif %\}')
|
endifRE = re.compile(r'\s*\{% endif %\}')
|
||||||
for line in lines:
|
for line in lines:
|
||||||
m = forRE.match(line)
|
m = forRE.match(line)
|
||||||
if m:
|
if m:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue