Closed lpawelcz closed 10 months ago
It is possible to finish the flow by moving the check_placement
step before filler_placement
so that the check won't fail. That is only for testing purpose of course. However, the result GDS looks a lot different than one I got straight from ORFS flow.
In GDS from ORFS flow filler cells are placed uniformly throughout the whole die and they cover the whole unused part of the layout. There are multiple types of filler cells used:
FILLERxp5_ASAP7_75t_R
,FILLER_ASAP7_75t_R
,DECAPx1_ASAP7_75t_R
,DECAPx2_ASAP7_75t_R
,DECAPx4_ASAP7_75t_R
,DECAPx6_ASAP7_75t_R
,DECAPx10_ASAP7_75t_R
.It looks like filler cells are placed along Power Delivery Network lines. In GDS from bazel_rules flow those cells are spaced between themselves - exactly 4 lengths/widths of the filler cell apart from each other. They are also limited to only one cell type (which is easy-to-fix problem with incorrect configuration here):
FILLERxp5_ASAP7_75t_R
PDN looks quite different - it has less power lines (horizontal, parallel lines from one edge of the die to other), the spacing between those lines in bazel_rules GDS is 4 times bigger than in GDS from ORFS.
I will attach here GDS files for comparison. counter_gds_files.zip Those were generated from 8-bit counter verilog, with clk_period 10ns with configuration for ORFS flow:
export DIE_AREA = 0 0 20 20
export CORE_AREA = 1 1 19 19
export PLACE_DENSITY = 0.65
and for bazel flow:
placement_density = "0.65",
core_padding_microns = 1,
die_width_microns = 20,
die_height_microns = 20,
Additional notes on attached GDS generated from bazel flow:
ASAP7 comes with 2 variants of the technology: regular and scaled (4 times bigger). However, ASAP7 does not provide all required files for the regular variant (e.g. technology LEF), all files required for RTL->GDS flow are available only for the scaled variant. ORFS uses regular variant. It doesn't have ASAP7 pinned as submodule or anything like that. Instead of that, at some point in history, the most important files from this PDK were imported straight into ORFS repository. Missing files for the regular variant were imported from scaled variant and manually converted to match regular variant. Then those files were updated with changes from upstream ASAP7 repository and probably with some additional external changes. Because of that it is hard to tell which version of ASAP7 is the closest to one used in ORFS.
On the other hand, bazel_rules_hdl in rules for ASAP7 uses scaled variant (even though cell library target is named asap7_rvt_1x) because it is the only one which has all the required files available directly in PDK repository.
I also noticed that ASAP7 version used in bazel_rules_hdl
is very old (The-OpenROAD-Project/asap7/157c92cf), for sure much older than one in ORFS. This could be the cause of some of the differences between layouts.
Having said that, I feel that most of the issues that I have now with the bazel flow with ASAP7 are caused by some possible inconsistencies in this scaling between two variants of the PDK.
For now, I think the most important question is to decide whether bazel flow implementation should be as close to ORFS implementation as possible (use regular PDK variant, modify missing files on the fly or fix upstream PDK) or should it just use what is currently available in the PDK (stick with the existing implementation, use scaled x4 variant of the PDK). @proppy and @QuantamHD I would greatly appreciate your opinion here.
ASAP7 comes with 2 variants of the technology: regular and scaled (4 times bigger). However, ASAP7 does not provide all required files for the regular variant (e.g. technology LEF), all files required for RTL->GDS flow are available only for the scaled variant. ORFS uses regular variant. It doesn't have ASAP7 pinned as submodule or anything like that. Instead of that, at some point in history, the most important files from this PDK were imported straight into ORFS repository. Missing files for the regular variant were imported from scaled variant and manually converted to match regular variant. Then those files were updated with changes from upstream ASAP7 repository and probably with some additional external changes. Because of that it is hard to tell which version of ASAP7 is the closest to one used in ORFS.
Is there already an issue in the ASAP7 repo to discuss reconciling the two version? It sounds like we should be able to import ORFS version in the ASAP7 repo since it's incomplete there.
I will attach here GDS files for comparison.
I think it would also be useful to compare the TCLs generated by bazel_rules_hdl with the ones coming from ORFS for ASAP7, to see how the two flows differ.
Is there already an issue in the ASAP7 repo to discuss reconciling the two version? It sounds like we should be able to import ORFS version in the ASAP7 repo since it's incomplete there.
There was https://github.com/The-OpenROAD-Project/asap7/issues/19 which touched the problem. There is a comment there that states the files are missing due to licensing issues.
I think it would also be useful to compare the TCLs generated by bazel_rules_hdl with the ones coming from ORFS for ASAP7, to see how the two flows differ.
I will check TCL scripts, compare them and post the results.
@QuantamHD for visilibility
I did an experiment with the following changes to bazel_rules_hdl flow:
open_road_pdk_configuration
asap7_tech_1x_201209.lef
filepdn_config.pdn
, rc_script.tcl
and tracks.tcl
in ASAP7 dependency_support directory according to ASAP7 PDK files in ORFSGDS file generated with such modified bazel flow is very similar to GDS generated with ORFS. The spacings between filler cells and PDN lines are the same now, however the flow still fails on check_placement
and in order to generate the GDS I had to comment out this check.
It is not yet clear to me what is the cause of those placement failures. What is even more interesting is that if you check the frames of filler cells that are reported in placement failure in bazel flow GDS, you would see that they indeed overlap each other but you would see exactly the same overlap in ORFS GDS and for some reason the placement check wont fail in case of ORFS flow.
bumped ASAP7 dependency to current upstream version
curious what happens if you use if you grab the ASAP7 bits from ORFS (https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/platforms/asap7) rather than the ASAP7 upstream repo? Do you still get the same failures?
GDS file generated with such modified bazel flow is very similar to GDS generated with ORFS
klayout has a gdstxt export which could be useful for diffing: https://github.com/KLayout/klayout/blob/master/src/buddies/src/bd/strm2gdstxt.cc
flow still fails on
placement_check
do you mean check_placement
?
for some reason the placement check wont fail in case of ORFS flow.
did you already compare the *_place_and_route_commands.tcl
file generated in bazel-bin
with the ORFS TCL scripts in https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/scripts?
do you mean check_placement?
Yes, sorry
did you already compare the *_place_and_route_commands.tcl file generated in bazel-bin with the ORFS TCL scripts in https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/tree/master/flow/scripts?
In bazel_rules_hdl filler cell placement is done in the same script as clock tree synthesis.
clock_tree_synthesis
command has additional -post_cts_disable
arg which seems to be obsolete, while in ORFS there are additional args: -sink_clustering_size
, -sink_clustering_max_diameter
, -distance_between_buffers
and -balance_levels
Then there is set_placement_padding
which had different values in bazel flow (-left 2 -right 2
) and ORFS (-left 1 -right 1
), I tried to set values from ORFS but it didn't change anything.
I will try to use ASAP7 files from ORFS and check this gdstxt
feature of klayout
@proppy I was able to finish the flow and pass check_placement
with setup described in https://github.com/hdl/bazel_rules_hdl/issues/172#issuecomment-1651225432 but without specifying more filler cell types in ASAP7 open_road_pdk_configuration (there was only FILLERxp5_ASAP7_75t_R
).
Now I will focus on isolating the fix which is probably one of the changes described in the linked comment. Then I will try to answer the question: Why those additional filler cells cause placement check failures in bazel flow? For that I will compare filler cells definitions from ORFS files with definitions from ASAP7 repository.
EDIT: The crucial changes required for enabling ASAP7 in bazel_rules_hdl flow are:
asap7_tech_1x_201209.lef
filepdn_config.pdn
, rc_script.tcl
and tracks.tcl
In order to enable processing designs targeting ASAP7 PDK and to achieve results similar to OpenROAD-flow-scripts
it is required to:
With recent updates to ASAP7:
From what I see, when it comes to ASAP7 support in
bazel_rules_hdl
the tests cover only the synthesis step: https://github.com/hdl/bazel_rules_hdl/blob/e30c65c618dabffdcdeb45ad66e27fbaa2dc573e/synthesis/tests/BUILD#L71-L78It would be good to add tests that will run
place_and_route
andgds_write
flows with the results fromverilog_counter_asap7_synth
as input. This is a blocker for https://github.com/google/xls/issues/996I started work on adding this but I encountered errors in Clock Tree Synthesis. Looks like there are problems with placing
FILLER
cells, here is the log:CC @proppy