OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

Adding obstructions shapes to write_abstract_lef

Open niv280 opened this issue 3 years ago • 24 comments

The write_abstract_left is dumping the shapes rects obstruction instead of the whole layer rect. The new steps:

  1. collect all the shapes per layer
  2. Bloat all the shapes
  3. Merged all the shapes if overlap ( per layer)
  4. Shrink back the merged polygon
  5. Decomposed the polygon into rects

( The process is in the image below)

The size of the bloat can be determine by the user ( with the -bloat flag), adding it also in the tcl procs, while the default amount is 2*pitch.

This is my first PR, so if there is any comment, suggest for improvement please let me know and I will work to improve it.

image

niv280 avatar Sep 09 '22 17:09 niv280

Super cool stuff! I wrote the original version of this code, and it's so cool to see it improved

QuantamHD avatar Sep 09 '22 22:09 QuantamHD

I wrote an abstract for ng45/gcd and I see

	 LAYER metal4 ;  
	   RECT 0.0 0.0 70.11 70.0 ;  
	 LAYER metal5 ;  
	   RECT 0.0 0.0 70.11 70.0 ;  
	 LAYER metal6 ;  
	   RECT 0.0 0.0 70.11 70.0 ;  
	 LAYER metal7 ;  
	   RECT 0.0 0.0 70.11 70.0 ;  
	 LAYER metal8 ;  
	   RECT 0.0 0.0 70.11 70.0 ;  
	 LAYER metal9 ;  
	   RECT 0.0 0.0 70.11 70.0 ;  
	 LAYER metal10 ;  
	   RECT 0.0 0.0 70.11 70.0 ;  

which makes no sense since those layer are mostly empty but here they are fully blocked. How have you tested this?

maliberty avatar Sep 10 '22 02:09 maliberty

You are pretty close to having it right. Thanks for working on this.

maliberty avatar Sep 10 '22 03:09 maliberty

Hi, I have fixed the issues that you mention.

niv280 avatar Sep 10 '22 17:09 niv280

for ng45/gcd the blockage for metal3 under various bloat choices: 0: image

2: image

5: image

15: image

The last looks like a reasonable model. I think the others are too detailed. I'm curious what others think...

maliberty avatar Sep 10 '22 18:09 maliberty

Rather than gather all the obs and then merge them it would be better to merge them as you go. The set of objects to be merged could be huge on a large design.

maliberty avatar Sep 10 '22 18:09 maliberty

This is an interesting abstract strategy but generally it seems undesirable. For most macros being abstracted, you want to mark any internal layers as "cover" blockages - the entire layer is covered with a blockage if any shapes exist on that layer. The reasons for this are that:

1, Computation is easier for the router 2. The LEF file size is reduced 3. It disallows routing near the internal nets of the macro, which could cause signal integrity violations that won't be caught by almost any other means. 4. Most macros should be metal filled before abstracting to ensure that the extracted parasitics and therefore timing models are accurate. In this case, the layer will be entirely blocked anyways.

It seems this PR changes the default abstraction method to bloating. I definitely think that if there is no bloating, the old method (which I believe is "all layers are cover layers") should be used.

rovinski avatar Sep 10 '22 20:09 rovinski

for ng45/gcd the blockage for metal3 under various bloat choices: 0: image

2: image

5: image

15: image

The last looks like a reasonable model. I think the others are too detailed. I'm curious what others think...

15 looks better. Is there a good way to determine the largest bloat factor that would basically create a single sheet for each layer?

gadfort avatar Sep 10 '22 22:09 gadfort

I think it is reasonable to have an option to just block the entire area as we do currently. I think that is a different option than -bloat_factor and a different 'algorithm'.

maliberty avatar Sep 11 '22 00:09 maliberty

1, Computation is easier for the router

the point of the bloating is to trade off simplicity versus accuracy. Its why I objected to bloat 0.

  1. The LEF file size is reduced

Same as above

  1. It disallows routing near the internal nets of the macro, which could cause signal integrity violations that won't be caught by almost any other means.

We can easily add a final bloat option to increase the spacing as desired.

  1. Most macros should be metal filled before abstracting to ensure that the extracted parasitics and therefore timing models are accurate. In this case, the layer will be entirely blocked anyways.

Not if you want to be able to route through the area in question which is a goal here. Additional spacing / shielding removes most of the RC extraction concerns (inter-layer effects are still possible but can be conservatively modelled as they are smaller).

maliberty avatar Sep 11 '22 01:09 maliberty

I'm not objecting to the functionality as long as the default behavior of write_lef_abstract is to generate obstructions for the whole layer. I think bloating is very useful in perhaps a few circumstances.

An ideal interface to me would look like

write_lef_abstract [-bloat_factor bloat_factor [-layers {layers}]]

Examples:

# Write an abstract LEF with cover obstructions on each layer
# There are still cutouts for pins
write_lef_abstract

# Write an abstract LEF with bloat factor of 15 on each layer
write_lef_abstract -bloat 15

# Write an abstract LEF with bloat factor of 15 on M4, M5
# All other layers use cover obstructions
write_lef_abstract -bloat 15 -layers {M4 M5}

# Write an abstract LEF with bloat factor of 15 on M4, M5
# Bloat factor of 0 on M6, M7
# All other layers use cover obstructions
write_lef_abstract -bloat 15 -layers {M4 M5} -bloat 0 -layers {M6 M7}

rovinski avatar Sep 11 '22 07:09 rovinski

There is no need for pin cutouts unless they are not on the macro edge

maliberty avatar Sep 11 '22 15:09 maliberty

There is no need for pin cutouts unless they are not on the macro edge

It would be nice for consistency/compatibility with other abstracting/P&R tools. It is standard for IP to have pin cutouts.

rovinski avatar Sep 11 '22 20:09 rovinski

There is no need for pin cutouts unless they are not on the macro edge

It would be nice for consistency/compatibility with other abstracting/P&R tools. It is standard for IP to have pin cutouts.

It is perhaps common but it isn't standard - you can see plenty of cases where that isn't true. lef/def specifically allow you to access pins covered by an obs.

maliberty avatar Sep 11 '22 21:09 maliberty

Do we really need layer specific bloating? I'd rather not add complexity unless someone will actually use it.

maliberty avatar Sep 11 '22 22:09 maliberty

What if someone doesn't want to allow routing on lower layers but is fine with routing on upper layers?

An example: top-level power mesh is on M6-M7. Signal routing is on M1-M5. Designer is fine with allowing external signals to pass through on M6-M7 but doesn't want signals passing through M1-M5.

Doing all-or-nothing bloating for the whole block seems like kind of extreme.

rovinski avatar Sep 12 '22 00:09 rovinski

Just speaking personally, I would use this feature if I could free up routing resources on upper layers. I would probably not use it if I couldn't block all of the lower layers.

rovinski avatar Sep 12 '22 00:09 rovinski

Ok if there is value we should add it. I am also ok to push it into a follow on PR.

maliberty avatar Sep 12 '22 02:09 maliberty

You should update the src/README as this change would make the warning there obsolete.

QuantamHD avatar Sep 12 '22 12:09 QuantamHD

Hi, I did some changes:

  1. Merge the polygon as we go, which supposed to easier for large design.
  2. I added insts ITerms to the obstructions
  3. Added the insts obstructions to the lef ( I am not sure about this one, please let me know if that what you meant )

There was other discussion about the this, but I don't understand what the conclusion, If you rather to do some change of the bloat_factor default please let me know.

niv280 avatar Sep 18 '22 10:09 niv280

There is a request to have an option for the old behavior. I don't like calling that '-bloat 0' and suggest we just add a different option like -block_occupied_layers. In a later PR we can allow users to choose the new or old style on a per layer basis.

maliberty avatar Sep 19 '22 04:09 maliberty

So what is the next step here? Should I add this option to this PR and the next one? Any change needed regarding the previous requests?

niv280 avatar Sep 19 '22 07:09 niv280

I think you should add that change here as otherwise it would represent a loss of functionality for those who prefer the older style. Also you need to fix the CI errors.

maliberty avatar Sep 19 '22 11:09 maliberty

I added the bloat_occupied_layers option, to cover the whole layer same as the previous functionality.

I would like to get some help with the CI errors, it seems that the build of the project are ok but it failed on certain test ( TestGuide) with undefine reference for dbITermShapeItr. I don't understand why it's failing since all the correct include are there and the build don't throw error on this.

niv280 avatar Sep 22 '22 15:09 niv280

The dependencies in odb are off. I'll fix that up and you can merge afterwards.

maliberty avatar Sep 26 '22 21:09 maliberty

If you merge master to your branch this problem should be fixed (after you resolve the merge conflicts).

maliberty avatar Sep 26 '22 22:09 maliberty

I merge with master and it looks like it passing now, except the lef test that failed as expected.

niv280 avatar Sep 28 '22 06:09 niv280

For the LEF tests - please verify that the new results are correct and update the test. You can use the save_ok script to do so.

maliberty avatar Sep 28 '22 17:09 maliberty

Added the new LEF for test

niv280 avatar Oct 02 '22 20:10 niv280

I used the save_ok script to change the log too. But the DCO check always failed even when I use git commit -s, any idea why?

niv280 avatar Oct 03 '22 18:10 niv280