mirror of
https://github.com/VLSIDA/OpenRAM.git
synced 2026-08-31 10:15:46 +02:00
Make purposes argument to gdsMill. Create prefixGDS.py script.
This commit is contained in:
@@ -79,7 +79,7 @@ class Gds2reader:
|
||||
recordLength = struct.unpack(">h",recordLengthAscii) #gives us a tuple with a short int inside
|
||||
offset_int = int(recordLength[0]) # extract length
|
||||
offset += offset_int # count offset
|
||||
if(self.debugToTerminal==1):
|
||||
if(self.debugToTerminal==1):
|
||||
print("Offset: " + str(offset)) #print out the record numbers for de-bugging
|
||||
record = self.fileHandle.read(recordLength[0]-2) #read the rest of it (first 2 bytes were already read)
|
||||
return record
|
||||
@@ -669,11 +669,11 @@ class Gds2reader:
|
||||
else:
|
||||
print("There was an error parsing the GDS header. Aborting...")
|
||||
|
||||
def loadFromFile(self, fileName):
|
||||
def loadFromFile(self, fileName, special_purposes={}):
|
||||
self.fileHandle = open(fileName,"rb")
|
||||
self.readGds2()
|
||||
self.fileHandle.close()
|
||||
self.layoutObject.initialize()
|
||||
self.layoutObject.initialize(special_purposes)
|
||||
|
||||
##############################################
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ from datetime import *
|
||||
import numpy as np
|
||||
import math
|
||||
import debug
|
||||
from tech import use_purpose
|
||||
|
||||
|
||||
class VlsiLayout:
|
||||
"""Class represent a hierarchical layout"""
|
||||
@@ -81,6 +81,12 @@ class VlsiLayout:
|
||||
coordinatesRotate.extend((newX,newY))
|
||||
return coordinatesRotate
|
||||
|
||||
def prefixAll(self, prefix):
|
||||
for name in self.structures:
|
||||
if name == self.rootStructureName:
|
||||
continue
|
||||
self.structures[prefix + name] = self.structures[name]
|
||||
|
||||
def rename(self,newName):
|
||||
# take the root structure and copy it to a new structure with the new name
|
||||
self.structures[newName] = self.structures[self.rootStructureName]
|
||||
@@ -211,17 +217,17 @@ class VlsiLayout:
|
||||
del transformPath[-1]
|
||||
return
|
||||
|
||||
def initialize(self):
|
||||
def initialize(self, special_purposes={}):
|
||||
self.deduceHierarchy()
|
||||
# self.traverseTheHierarchy()
|
||||
self.populateCoordinateMap()
|
||||
#only ones with text
|
||||
# only ones with text
|
||||
for layerNumber in self.layerNumbersInUse:
|
||||
#if layerNumber not in no_pin_shape:
|
||||
if layerNumber in use_purpose:
|
||||
self.processLabelPins((layerNumber, use_purpose[layerNumber]))
|
||||
else:
|
||||
self.processLabelPins((layerNumber, None))
|
||||
# if layerNumber not in no_pin_shape:
|
||||
if layerNumber in special_purposes:
|
||||
self.processLabelPins((layerNumber, special_purposes[layerNumber]))
|
||||
else:
|
||||
self.processLabelPins((layerNumber, None))
|
||||
|
||||
def populateCoordinateMap(self):
|
||||
def addToXyTree(startingStructureName = None,transformPath = None):
|
||||
|
||||
Reference in New Issue
Block a user