mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-09-05 09:03:53 +02:00
Merge branch 'dev' into characterizer_bug_fixes
This commit is contained in:
@@ -26,8 +26,14 @@ class design(hierarchy_design):
|
||||
# This allows us to use different GDS/spice circuits for hard cells instead of the default ones
|
||||
# Except bitcell names are generated automatically by the globals.py setup_bitcells routines
|
||||
# depending on the number of ports.
|
||||
|
||||
if name in props.names:
|
||||
cell_name = props.names[name]
|
||||
if type(props.names[name]) is list:
|
||||
num_ports = OPTS.num_rw_ports + OPTS.num_r_ports + OPTS.num_w_ports - 1
|
||||
cell_name = props.names[name][num_ports]
|
||||
else:
|
||||
cell_name = props.names[name]
|
||||
|
||||
elif not cell_name:
|
||||
cell_name = name
|
||||
super().__init__(name, cell_name)
|
||||
|
||||
@@ -21,22 +21,6 @@ class hierarchy_design(hierarchy_spice.spice, hierarchy_layout.layout):
|
||||
name_map = []
|
||||
|
||||
def __init__(self, name, cell_name):
|
||||
self.gds_file = OPTS.openram_tech + "gds_lib/" + cell_name + ".gds"
|
||||
self.sp_file = OPTS.openram_tech + "sp_lib/" + cell_name + ".sp"
|
||||
|
||||
# If we have a separate lvs directory, then all the lvs files
|
||||
# should be in there (all or nothing!)
|
||||
try:
|
||||
lvs_subdir = tech.lvs_lib
|
||||
except AttributeError:
|
||||
lvs_subdir = "lvs_lib"
|
||||
lvs_dir = OPTS.openram_tech + lvs_subdir + "/"
|
||||
|
||||
if os.path.exists(lvs_dir):
|
||||
self.lvs_file = lvs_dir + cell_name + ".sp"
|
||||
else:
|
||||
self.lvs_file = self.sp_file
|
||||
|
||||
self.drc_errors = "skipped"
|
||||
self.lvs_errors = "skipped"
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@ class layout():
|
||||
self.name = name
|
||||
self.cell_name = cell_name
|
||||
|
||||
self.gds_file = OPTS.openram_tech + "gds_lib/" + cell_name + ".gds"
|
||||
|
||||
self.width = None
|
||||
self.height = None
|
||||
self.bounding_box = None
|
||||
@@ -375,7 +377,7 @@ class layout():
|
||||
"""
|
||||
Return a pin list of all pins
|
||||
"""
|
||||
return self.pin_map.keys()
|
||||
return self.pins
|
||||
|
||||
def copy_layout_pin(self, instance, pin_name, new_name=""):
|
||||
"""
|
||||
|
||||
@@ -10,6 +10,7 @@ import re
|
||||
import os
|
||||
import math
|
||||
import tech
|
||||
from globals import OPTS
|
||||
from pprint import pformat
|
||||
from delay_data import delay_data
|
||||
from wire_spice_model import wire_spice_model
|
||||
@@ -32,6 +33,21 @@ class spice():
|
||||
self.name = name
|
||||
self.cell_name = cell_name
|
||||
|
||||
self.sp_file = OPTS.openram_tech + "sp_lib/" + cell_name + ".sp"
|
||||
|
||||
# If we have a separate lvs directory, then all the lvs files
|
||||
# should be in there (all or nothing!)
|
||||
try:
|
||||
lvs_subdir = tech.lvs_lib
|
||||
except AttributeError:
|
||||
lvs_subdir = "lvs_lib"
|
||||
lvs_dir = OPTS.openram_tech + lvs_subdir + "/"
|
||||
|
||||
if os.path.exists(lvs_dir):
|
||||
self.lvs_file = lvs_dir + cell_name + ".sp"
|
||||
else:
|
||||
self.lvs_file = self.sp_file
|
||||
|
||||
self.valid_signal_types = ["INOUT", "INPUT", "OUTPUT", "POWER", "GROUND"]
|
||||
# Holds subckts/mods for this module
|
||||
self.mods = []
|
||||
|
||||
@@ -84,7 +84,6 @@ class verilog:
|
||||
self.vf.write("endmodule\n")
|
||||
self.vf.close()
|
||||
|
||||
|
||||
def register_inputs(self, port):
|
||||
"""
|
||||
Register the control signal, address and data inputs.
|
||||
@@ -129,7 +128,7 @@ class verilog:
|
||||
if port in self.write_ports:
|
||||
self.vf.write(" din{0}_reg = din{0};\n".format(port))
|
||||
if port in self.read_ports:
|
||||
self.vf.write(" dout{0} = {1}'bx;\n".format(port,self.word_size))
|
||||
self.vf.write(" dout{0} = {1}'bx;\n".format(port, self.word_size))
|
||||
if port in self.readwrite_ports:
|
||||
self.vf.write(" if ( !csb{0}_reg && web{0}_reg ) \n".format(port))
|
||||
self.vf.write(" $display($time,\" Reading %m addr{0}=%b dout{0}=%b\",addr{0}_reg,mem[addr{0}_reg]);\n".format(port))
|
||||
@@ -151,7 +150,6 @@ class verilog:
|
||||
|
||||
self.vf.write(" end\n\n")
|
||||
|
||||
|
||||
def add_inputs_outputs(self, port):
|
||||
"""
|
||||
Add the module input and output declaration for a port.
|
||||
@@ -191,14 +189,14 @@ class verilog:
|
||||
|
||||
if self.write_size:
|
||||
remainder_bits = self.word_size % self.write_size
|
||||
for mask in range(0,self.num_wmasks):
|
||||
for mask in range(0, self.num_wmasks):
|
||||
lower = mask * self.write_size
|
||||
if (remainder_bits and mask == self.num_wmasks - 1):
|
||||
upper = lower + remainder_bits - 1
|
||||
else:
|
||||
upper = lower + self.write_size - 1
|
||||
self.vf.write(" if (wmask{0}_reg[{1}])\n".format(port,mask))
|
||||
self.vf.write(" mem[addr{0}_reg][{1}:{2}] = din{0}_reg[{1}:{2}];\n".format(port,upper,lower))
|
||||
self.vf.write(" if (wmask{0}_reg[{1}])\n".format(port, mask))
|
||||
self.vf.write(" mem[addr{0}_reg][{1}:{2}] = din{0}_reg[{1}:{2}];\n".format(port, upper, lower))
|
||||
self.vf.write(" end\n")
|
||||
else:
|
||||
self.vf.write(" mem[addr{0}_reg] = din{0}_reg;\n".format(port))
|
||||
@@ -220,9 +218,6 @@ class verilog:
|
||||
self.vf.write(" dout{0} <= #(DELAY) mem[addr{0}_reg];\n".format(port))
|
||||
self.vf.write(" end\n")
|
||||
|
||||
self.vf.write(" always @(csb{0})\n".format(port))
|
||||
self.vf.write(" dout{0} = 0)\n".format(port))
|
||||
|
||||
def add_address_check(self, wport, rport):
|
||||
""" Output a warning if the two addresses match """
|
||||
# If the rport is actually reading... and addresses match.
|
||||
@@ -235,8 +230,8 @@ class verilog:
|
||||
else:
|
||||
wport_control = "!csb{0}".format(wport)
|
||||
|
||||
self.vf.write(" if ({1} && {3} && (addr{0} == addr{2}))\n".format(wport,wport_control,rport,rport_control))
|
||||
self.vf.write(" $display($time,\" WARNING: Writing and reading addr{0}=%b and addr{1}=%b simultaneously!\",addr{0},addr{1});\n".format(wport,rport))
|
||||
self.vf.write(" if ({1} && {3} && (addr{0} == addr{2}))\n".format(wport, wport_control, rport, rport_control))
|
||||
self.vf.write(" $display($time,\" WARNING: Writing and reading addr{0}=%b and addr{1}=%b simultaneously!\",addr{0},addr{1});\n".format(wport, rport))
|
||||
|
||||
def add_write_read_checks(self, rport):
|
||||
"""
|
||||
@@ -247,4 +242,4 @@ class verilog:
|
||||
if wport == rport:
|
||||
continue
|
||||
else:
|
||||
self.add_address_check(wport,rport)
|
||||
self.add_address_check(wport, rport)
|
||||
|
||||
Reference in New Issue
Block a user