-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate primitives with multiple aspect ratios and then use the placer to decide which to choose. #671
Conversation
@kkunal1408 @parijatm @soneryaldiz @arvuce22 @854768750 @Lastdayends
If this is okay, I'm going to change the interface data structure a little bit (at the align.main level, creating both a mapping file and a primitive file) and then ask various of you to move the adapters into the appropriate modules. |
@stevenmburns , let's chat about this in our 1:1. The interface between the core and pdk has to change anyway to accommodate the We should really retire or move any custom hacks to netlist preprocessing. It might be good to allow a PDK to register a netlist preprocessor. |
I can add something in PnR when multiple aspect ratio is generated. |
For PnR, multiple aspect ratio needs the modification of input files:
lef file:
verilog file:
|
@parijatm I'm now proposing that we modify the master name fields in the placement.verilog.json after placement and we have choose concrete layouts for each of the leaf cells. This PR is doing that now for capacitors. Since this is different semantics than usual, we might want to replace the This is what the current map file is meant to do, but that functionality has slowly died (not it is always a one-to-one mapping.) Also, we don't current write out the placement_verilog_json anywhere |
…_name (for leaves)
All the proposed changes sound good to me. Note that we haven't yet formalized any constraints that force two primitive instances of the same (abstract) template name to have the same layout. SymmetricBlocks comes to mind but I am yet to review exactly what PnR does for these. I am not quite clear where the list of possible |
Right now I'm generate more options by modifying the entries in the original primitives.json (from the topology generator), for example by switching the X and Y values (for values that are different) and running that through the primitive generation flow. This should be the job of the topology generator (or at least it is generating the one size now) or a new flow stage that decides what different aspect ratio might make sense. |
It seems that we could add the information in primitives.json to our verilog_json file for communication between stages. |
…ithin PnR engine; currently fails
@854768750 This is ready to rewrote the PnR code for the new map file.
It is crashing with some LEF fetching errors --- I think this is to be expected until we use the information in the map file correctly.
|
I see. I will do some changes to the PnR code. |
@@ -82,7 +82,8 @@ class PnRdatabase | |||
int unitScale; | |||
map<string, vector<PnRDB::lefMacro> > lefData; //map from Macro name to Macro Instance | |||
public: | |||
map<string, string> gdsData; //map from gds name to gds file | |||
map<string, string> gdsData; //map from gds name to gds file (won't need this one after being replaced by gdsData2) | |||
map<string, vector<string> > gdsData2; //map from gds name to multiple gds file (abstract to multiple concrete) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@854768750 I added this as the C++ data structure of the new mapping.
with (d / mapname).open( "rt") as fp: | ||
for line in fp: | ||
line = line.rstrip('\n') | ||
m = p.match(line) | ||
assert m | ||
k, v = m.groups() | ||
tbl[k] = str(d / v) | ||
return tbl | ||
tbl2[k].append( str(d / v)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@854768750 Here tbl2 is the python version of the map from abstract name to list of concrete names.
align/pnr/build_pnr_model.py
Outdated
@@ -189,7 +143,11 @@ def PnRdatabase( path, topcell, vname, lefname, mapname, drname): | |||
DB.ReadPDKJSON( path + '/' + drname) | |||
|
|||
_ReadLEF( DB, path, lefname) | |||
DB.gdsData = _ReadMap( path, mapname) | |||
DB.gdsData, DB.gdsData2 = _ReadMap( path, mapname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@854768750 Here is were the Python map get copied to the C++ map. (and the printed out so we can see it is doing the right thing.)
@854768750 I added some more stuff that you should feel free to ignore. It might be helpful if you haven't started, but probably will not be helpful if you have. |
ok, I am solving the merge conflicts. |
ok, then capacitors are like other primitives, multiple aspect ratio of capacitor is before PnR |
That is what we want eventually. I wasn't going to move the capacitors to the primitive stage in this PR, but soon. |
ok, I will do some changes of name mapping in capplacer |
I did something simple. Ignore this check in if you have something better. |
@854768750 That seemed to fix things up well. Maybe we can wait on more fixes until another PR. |
const string abstract_template_name = node.Blocks[i].instance.front().master; | ||
|
||
if (gdsData2.find(abstract_template_name) == gdsData2.end()) { | ||
if (abstract_template_name.find("Cap") != std::string::npos || abstract_template_name.find("cap") != std::string::npos || !node.Blocks[i].instance.back().isLeaf) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@854768750 I just fir checked if the abstract_template_name was in gdsData2. If not, I'll skip the whole process if cap is in the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this does not cause error on capacitor because capplacer is not functioning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine because, seems in BUFFER_VREFP1, Dcap is just like other ordinary primitives.
I ran the regression through and there are some other corner cases to deal with. There are three that used to work that don't anymore: I'm looking to see if they have anything in common. |
Some of these broke with the last PR merge. @kkunal1408 is looking into it now. This is the current list: FAILED tests/integration/test_all.py::test_A[20-FinFET14nm_Mock_PDK-SW_Cres_v3_5]
FAILED tests/integration/test_all.py::test_A[20-FinFET14nm_Mock_PDK-Sanitized_Coarse_Comp_CK]
FAILED tests/integration/test_all.py::test_A[20-FinFET14nm_Mock_PDK-COMP_GM_STAGE_0415]
FAILED tests/integration/test_all.py::test_A[20-FinFET14nm_Mock_PDK-powertrain_binary]
FAILED tests/integration/test_all.py::test_A[20-FinFET14nm_Mock_PDK-telescopic_ota_guard_ring]
FAILED tests/integration/test_all.py::test_A[20-FinFET14nm_Mock_PDK-vco_dtype_12_hierarchical]
FAILED tests/integration/test_all.py::test_A[20-FinFET14nm_Mock_PDK-test_vga]
FAILED tests/integration/test_all.py::test_A[20-FinFET14nm_Mock_PDK-vco_dtype_12_hierarchical_res] |
I guess I'll keep looking into: |
@parijatm @854768750 This is ready to check in. |
@@ -33,6 +36,59 @@ def build_steps( flow_start, flow_stop): | |||
return steps_to_run | |||
|
|||
|
|||
def gen_more_primitives( primitives, topology_dir, subckt): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kkunal1408 @arvuce22 This is the code that needs to be moved upstream in the flow, either topology, or primitives or both.
@parijatm Ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of great changes in this PR.
Looks good to go !
- [x] Set up a simple test framework where we hack in extra primitives and make the placer work