From e3a6c1ac6b63550669f89f1430051d6cfc770cba Mon Sep 17 00:00:00 2001 From: Matt Guthaus Date: Tue, 12 Dec 2017 15:50:45 -0800 Subject: [PATCH] Rewrite CONTRIBUTING.md to add changes relative to dev. Add small changes from orbe7947. --- CONTRIBUTING.md | 61 ++++++++++++++------------ compiler/contact.py | 9 ++-- compiler/gdsMill/gdsMill/gds2writer.py | 2 +- compiler/gdsMill/gdsMill/vlsiLayout.py | 3 ++ compiler/utils.py | 10 ++++- 5 files changed, 51 insertions(+), 34 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8d0eea6f..f92a17b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,7 +53,17 @@ the tests on your contributions before they will be accepted. if you previously added the one with the git@github that required authentication. -5. Make your own branch. The number one rule is to put each piece of +5. Start with dev: +``` + git checkout dev +``` + "dev" is the name of the branch that + is the development version. You should submit all contributions as changes + to the dev branch. "master" is the name of the branch that is the release version of the + code (in your fork of the repository). You can check out the released + code with "git checkout master”. + +6. Make your own branch from dev. The number one rule is to put each piece of work on its own branch: ``` git checkout -b useful-branch-name @@ -63,61 +73,56 @@ the tests on your contributions before they will be accepted. git branch useful-branch-name git checkout useful-branch-name ``` - "master" is the name of the branch that is the release version of the - code (in your fork of the repository). You can check out the released - code with "git checkout master" or go back to your ranch with - "gitcheckout useful-branch-name". -6. Edit your code and make commits like normal: +7. Edit your code and make commits: ``` - git add + git add git commit -m "Useful comment" ``` OR (sparingly, to commit all changes): ``` git status - + git commit -a -m "Useful comment" ``` Run the unit tests entirely. Fix all bugs. -7. After you are done (or while you are editing and you see changes in - MY master branch) make sure you have the most recent from MY master - and merge any changes. Pull the updated copy from MY master branch in +8. After you are done (or while you are editing and you see changes in + MY dev branch) make sure you have the most recent from MY dev + and merge any changes. Pull the updated copy from MY master dev in MY repository: ``` - git pull upstream master + git pull upstream dev ``` - This is important because we may have had other updates that conflict - with your changes and you must resolve them with current state of - master (the released, working code). You may have to merge changes if - they overlap your changes, so do this often to avoid the problem. You - now need to push this to the master of YOUR forked repository as well: -``` - git push origin master -``` - if you are on your master branch. Otherwise, just git push. -8. Push your branch to YOUR repository: +9. Merge the changes from dev into your branch ``` + git merge dev +``` +10. After you are done, rebase your branch to minimize the number of commits if you +had a lot. I prefer a single commit that you contribute. After this, +push your branch to YOUR repository: +``` + git rebase dev git push -u origin useful-branch-name ``` Remember origin is your copy on github and useful-branch-name is the branch that you made to contain all your changes. The -u flag links this branch with the remote one, so that in the - future, you can simply type git push origin. + future, you can simply type git push origin. Do not rebase after you push + the branch! -9. When you are done, go to GitHub and you will see a button to notify +11. When you are done, go to GitHub and you will see a button to notify me. Press the button and it will notify me of your pushed branch. This will have you fill in a form for the contribution that gets sent to me. -10. I will review the request and may have you fix stuff if the tests - don't pass, you didn't merge all my changes in master from other +12. I will review the request and may have you fix stuff if the tests + don't pass, you didn't merge all my changes in dev from other contributions, or your style of code is bad. -11. Go back to step 3 for your next contribution. Remember, you can +13. Go back to step 3 for your next contribution. Remember, you can push/pull work to your repository all the time and can pull from my - master as well. Make sure to add large features so that You don't have + dev as well. Make sure to add large features so that You don't have to add lots of pull requests. diff --git a/compiler/contact.py b/compiler/contact.py index 66d99ab0..7708da1b 100644 --- a/compiler/contact.py +++ b/compiler/contact.py @@ -1,5 +1,6 @@ import design import debug +import utils from tech import drc from vector import vector @@ -53,15 +54,15 @@ class contact(design.design): # FIME break this up self.first_layer_horizontal_enclosure = max((drc["minwidth_{0}".format(self.first_layer_name)] - self.contact_array_width) / 2, drc["{0}_enclosure_{1}".format(self.first_layer_name, self.via_layer_name)]) - self.first_layer_vertical_enclosure = max((drc["minarea_{0}".format(self.first_layer_name)] - / (self.contact_array_width + 2 * self.first_layer_horizontal_enclosure) - self.contact_array_height) / 2, + self.first_layer_vertical_enclosure = max(utils.ceil((drc["minarea_{0}".format(self.first_layer_name)] + / (self.contact_array_width + 2 * self.first_layer_horizontal_enclosure) - self.contact_array_height) / 2), (drc["minheight_{0}".format(self.first_layer_name)] - self.contact_array_height) / 2, drc["{0}_extend_{1}".format(self.first_layer_name, self.via_layer_name)]) self.second_layer_horizontal_enclosure = max((drc["minwidth_{0}".format(self.second_layer_name)] - self.contact_array_width) / 2, drc["{0}_enclosure_{1}".format(self.second_layer_name, self.via_layer_name)]) - self.second_layer_vertical_enclosure = max((drc["minarea_{0}".format(self.second_layer_name)] - / (self.contact_array_width + 2 * self.second_layer_horizontal_enclosure) - self.contact_array_height) / 2, + self.second_layer_vertical_enclosure = max(utils.ceil((drc["minarea_{0}".format(self.second_layer_name)] + / (self.contact_array_width + 2 * self.second_layer_horizontal_enclosure) - self.contact_array_height) / 2), (drc["minheight_{0}".format(self.second_layer_name)] - self.contact_array_height) / 2, drc["{0}_extend_{1}".format(self.second_layer_name, self.via_layer_name)]) # offset for the via array diff --git a/compiler/gdsMill/gdsMill/gds2writer.py b/compiler/gdsMill/gdsMill/gds2writer.py index 5e761960..e435c740 100644 --- a/compiler/gdsMill/gdsMill/gds2writer.py +++ b/compiler/gdsMill/gdsMill/gds2writer.py @@ -126,7 +126,7 @@ class Gds2writer: if (len(self.layoutObject.info["libraryName"]) % 2 != 0): libraryName = self.layoutObject.info["libraryName"] + "\0" else: - libraryName = self.layoutObject.info["libraryName"] + "\0" + libraryName = self.layoutObject.info["libraryName"] self.writeRecord(idBits+libraryName) ## reference libraries if("referenceLibraries" in self.layoutObject.info): diff --git a/compiler/gdsMill/gdsMill/vlsiLayout.py b/compiler/gdsMill/gdsMill/vlsiLayout.py index 0c047c0e..e2a5960f 100644 --- a/compiler/gdsMill/gdsMill/vlsiLayout.py +++ b/compiler/gdsMill/gdsMill/vlsiLayout.py @@ -696,6 +696,9 @@ class VlsiLayout: """ pin_boundaries=self.getAllPinShapesInStructureList(coordinate, layer) + if len(pin_boundaries) == 0: + debug.warning("Did not find pin on layer {0} at coordinate {1}".format(layer, coordinate)) + # sort the boundaries, return the max area pin boundary pin_boundaries.sort(cmpBoundaryAreas,reverse=True) pin_boundary=pin_boundaries[0] diff --git a/compiler/utils.py b/compiler/utils.py index 9c40ddac..cb63b68a 100644 --- a/compiler/utils.py +++ b/compiler/utils.py @@ -1,12 +1,20 @@ import os import gdsMill -import tech +import tech +import math import globals from vector import vector from pin_layout import pin_layout OPTS = globals.OPTS +def ceil(decimal): + """ + Performs a ceiling function on the decimal place specified by the DRC grid. + """ + grid = tech.drc["grid"] + return math.ceil(decimal * 1 / grid) / (1 / grid) + def round_to_grid(number): """ Rounds an arbitrary number to the grid.