Skip to content

Commit 0f605ee

Browse files
committed
Merge remote-tracking branch 'origin/master' into HEAD
2 parents 507225f + 5902cec commit 0f605ee

20 files changed

+557
-574
lines changed

docs/conf.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959

6060
# The suffix(es) of source filenames.
6161
# You can specify multiple suffix as a list of string:
62-
#
63-
# source_suffix = ['.rst', '.md']
6462
source_suffix = ['.md']
6563

6664
# The master toctree document.
@@ -94,6 +92,10 @@
9492
html_theme_options = {
9593
"repository_url": "https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts",
9694
"repository_branch": "master",
95+
"show_navbar_depth": 2,
96+
"use_edit_page_button": True,
97+
"use_source_button": True,
98+
"use_issues_button": True,
9799
"use_download_button": True,
98100

99101
# list for more fine-grained ordering of icons

docs/toc.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
root: index
22
entries:
33

4-
- file: /dev/null
5-
title: ORFS Documentation
4+
- file: user/UserGuide.md
5+
title: User Guide
66
entries:
77
- file: user/BuildWithDocker
88
title: Build With Docker
@@ -13,8 +13,8 @@ entries:
1313
title: Build With Pre-built Binaries
1414
- file: user/BuildLocally.md
1515
title: Build Locally
16-
- file: user/UserGuide.md
17-
title: User Guide
16+
- file: user/BuildWithWSL.md
17+
title: Build With WSL
1818
- file: user/FlowVariables.md
1919
title: Flow Variables
2020
- file: contrib/Metrics.md

docs/user/BuildWithPrebuilt.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Instructions for installing:
99

1010
```{tip} Unfortunately KLayout maintainers do not provide Debian 10/11 compatible packages. You can follow the build-from-sources instruction (Version >=0.25) and Ubuntu 22 instructions [here](https://www.klayout.de/build.html#:~:text=Building%20KLayout%20on%20Linux%20(Version%20%3E%3D%200.25)).
1111
```
12+
1213
## Install OpenROAD
1314
Download pre-built binaries with self-contained dependencies
1415
included from the Precision Innovations' Github releases
@@ -28,22 +29,30 @@ Step 2: Download the artifacts for your distribution.
2829

2930
Step 3: Run the install command based on platform use package installer.
3031
For example Ubuntu 20.04 use:
32+
3133
```shell
3234
sudo apt install ./openroad_2.0_amd64-ubuntu20.04.deb
3335
```
36+
3437
You can install these binaries within docker as well.
3538

3639

3740
## Verify Installation
3841
You may clone the OpenROAD-flow-scripts repository non-recursively.
42+
3943
```
4044
git clone https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts.git
4145
```
46+
4247
Export path variables accordingly.
48+
4349
```
44-
export PATH="<yosys_location>/bin:$PATH"
45-
export PATH="<klayout_location>/bin:$PATH" # only if built from source
46-
export LD_LIBRARY_PATH="<klayout_location>/bin:$PATH" # only if built from source
50+
# these variables are used in flow/Makefile. Do make sure the yosys path is sourced.
51+
export OPENROAD_EXE=$(command -v openroad)
52+
export YOSYS_CMD=$(shell command -v yosys)
53+
54+
# only if KLayout is built from source
55+
export LD_LIBRARY_PATH="<klayout_location>/bin:$PATH"
4756
4857
yosys -help
4958
openroad -help

flow/Makefile

Lines changed: 77 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -267,21 +267,16 @@ endif
267267

268268
# The following determine the executable location for each tool used by this flow.
269269
# Priority is given to
270-
# 1 user include path to the executable prior to running make
271-
# 2 user explicit set with variable in Makefile or command line
272-
export OPENROAD_EXE ?= $(shell command -v openroad)
273-
ifeq ($(OPENROAD_EXE),)
274-
export OPENROAD_EXE = $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/openroad)
275-
endif
270+
# 1 user explicit set with variable in Makefile or command line, for instance setting OPENROAD_EXE
271+
# 2 ORFS compiled tools: openroad, yosys
272+
export OPENROAD_EXE ?= $(abspath $(FLOW_HOME)/../tools/install/OpenROAD/bin/openroad)
273+
276274
OPENROAD_ARGS = -no_init $(OR_ARGS)
277275
OPENROAD_CMD = $(OPENROAD_EXE) -exit $(OPENROAD_ARGS)
278276
OPENROAD_NO_EXIT_CMD = $(OPENROAD_EXE) $(OPENROAD_ARGS)
279277
OPENROAD_GUI_CMD = $(OPENROAD_EXE) -gui $(OR_ARGS)
280278

281-
YOSYS_CMD ?= $(shell command -v yosys)
282-
ifeq ($(YOSYS_CMD),)
283-
YOSYS_CMD = $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
284-
endif
279+
YOSYS_CMD ?= $(abspath $(FLOW_HOME)/../tools/install/yosys/bin/yosys)
285280

286281
KLAYOUT_CMD ?= $(shell command -v klayout)
287282

@@ -463,6 +458,18 @@ UNSET_AND_MAKE = @bash -c 'for var in $(UNSET_VARIABLES_NAMES); do unset $$var;
463458
#
464459
# A "do-synth" step would be welcomed, but it isn't strictly necessary
465460
# for the Bazel use-case.
461+
#
462+
# do-floorplan, do-place, do-cts, do-route, do-finish are the
463+
# supported interface to execute those stages without checking
464+
# for dependencies.
465+
#
466+
# The do- substeps of each of these stages are subject to change.
467+
#
468+
# $(1) stem, e.g. 2_1_floorplan
469+
# $(2) dependencies
470+
# $(3) tcl script step
471+
# $(4) extension of result, default .odb
472+
# $(5) folder of target, default $(RESULTS_DIR)
466473
define do-step
467474
$(if $(5),$(5),$(RESULTS_DIR))/$(1)$(if $(4),$(4),.odb): $(2)
468475
$$(UNSET_AND_MAKE) do-$(1)
@@ -472,6 +479,25 @@ do-$(1):
472479
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/$(3).tcl -metrics $(LOG_DIR)/$(1).json) 2>&1 | tee $(LOG_DIR)/$(1).log
473480
endef
474481

482+
# generate make rules to copy a file, if a dependency change and
483+
# a do- sibling rule that copies the file unconditionally.
484+
#
485+
# The file is copied within the $(RESULTS_DIR)
486+
#
487+
# $(1) stem of target, e.g. 2_2_floorplan_io
488+
# $(2) basename of file to be copied
489+
# $(3) further dependencies
490+
# $(4) target extension, default .odb
491+
define do-copy
492+
$(RESULTS_DIR)/$(1)$(if $(4),$(4),.odb): $(RESULTS_DIR)/$(2) $(3)
493+
$$(UNSET_AND_MAKE) do-$(1)$(if $(4),$(4),)
494+
495+
.PHONY: do-$(1)$(if $(4),$(4),)
496+
do-$(1)$(if $(4),$(4),):
497+
cp $(RESULTS_DIR)/$(2) $(RESULTS_DIR)/$(1)$(if $(4),$(4),.odb)
498+
endef
499+
500+
475501
# STEP 1: Translate verilog to odb
476502
#-------------------------------------------------------------------------------
477503
$(eval $(call do-step,2_1_floorplan,$(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_synth.sdc $(TECH_LEF) $(SC_LEF) $(ADDITIONAL_LEFS) $(FOOTPRINT) $(SIG_MAP_FILE) $(FOOTPRINT_TCL),floorplan))
@@ -481,18 +507,15 @@ $(eval $(call do-step,2_1_floorplan,$(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_sy
481507
ifndef IS_CHIP
482508
$(eval $(call do-step,2_2_floorplan_io,$(RESULTS_DIR)/2_1_floorplan.odb $(IO_CONSTRAINTS),io_placement_random))
483509
else
484-
$(RESULTS_DIR)/2_2_floorplan_io.odb: $(RESULTS_DIR)/2_1_floorplan.odb $(IO_CONSTRAINTS)
485-
cp $< $@
510+
$(eval $(call do-copy,2_2_floorplan_io,2_1_floorplan.odb,$(IO_CONSTRAINTS)))
486511
endif
487512

488513
# STEP 3: Timing Driven Mixed Sized Placement
489514
#-------------------------------------------------------------------------------
490515
ifeq ($(MACRO_PLACEMENT),)
491516
$(eval $(call do-step,2_3_floorplan_tdms,$(RESULTS_DIR)/2_2_floorplan_io.odb $(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_synth.sdc $(LIB_FILES),tdms_place))
492517
else
493-
$(RESULTS_DIR)/2_3_floorplan_tdms.odb: $(RESULTS_DIR)/2_2_floorplan_io.odb $(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_synth.sdc $(LIB_FILES)
494-
$(info [INFO][FLOW] Using manual macro placement file $(MACRO_PLACEMENT))
495-
cp $< $@
518+
$(eval $(call do-copy,2_3_floorplan_tdms,2_2_floorplan_io.odb,$(RESULTS_DIR)/1_synth.v $(RESULTS_DIR)/1_synth.sdc $(LIB_FILES)))
496519
endif
497520

498521
# STEP 4: Macro Placement
@@ -507,11 +530,13 @@ $(eval $(call do-step,2_5_floorplan_tapcell,$(RESULTS_DIR)/2_4_floorplan_macro.o
507530
#-------------------------------------------------------------------------------
508531
$(eval $(call do-step,2_6_floorplan_pdn,$(RESULTS_DIR)/2_5_floorplan_tapcell.odb $(PDN_TCL),pdn))
509532

510-
$(RESULTS_DIR)/2_floorplan.odb: $(RESULTS_DIR)/2_6_floorplan_pdn.odb
511-
cp $< $@
533+
$(eval $(call do-copy,2_floorplan,2_6_floorplan_pdn.odb,))
512534

513535
$(RESULTS_DIR)/2_floorplan.sdc: $(RESULTS_DIR)/2_1_floorplan.odb
514536

537+
.PHONY: do-floorplan
538+
do-floorplan:
539+
$(UNSET_AND_MAKE) do-2_1_floorplan do-2_2_floorplan_io do-2_3_floorplan_tdms do-2_4_floorplan_macro do-2_5_floorplan_tapcell do-2_6_floorplan_pdn do-2_floorplan
515540

516541
.PHONY: clean_floorplan
517542
clean_floorplan:
@@ -539,8 +564,7 @@ $(eval $(call do-step,3_1_place_gp_skip_io,$(RESULTS_DIR)/2_floorplan.odb $(RESU
539564
ifndef IS_CHIP
540565
$(eval $(call do-step,3_2_place_iop,$(RESULTS_DIR)/3_1_place_gp_skip_io.odb $(IO_CONSTRAINTS),io_placement))
541566
else
542-
$(RESULTS_DIR)/3_2_place_iop.odb: $(RESULTS_DIR)/3_1_place_gp_skip_io.odb $(IO_CONSTRAINTS)
543-
cp $< $@
567+
$(eval $(call do-copy,3_2_place_iop,3_1_place_gp_skip_io.odb,$(IO_CONSTRAINTS)))
544568
endif
545569

546570
# STEP 3: Global placement with placed IOs, timing-driven, and routability-driven.
@@ -559,11 +583,13 @@ clean_resize:
559583
#-------------------------------------------------------------------------------
560584
$(eval $(call do-step,3_5_place_dp,$(RESULTS_DIR)/3_4_place_resized.odb,detail_place))
561585

562-
$(RESULTS_DIR)/3_place.odb: $(RESULTS_DIR)/3_5_place_dp.odb
563-
cp $< $@
586+
$(eval $(call do-copy,3_place,3_5_place_dp.odb,))
564587

565-
$(RESULTS_DIR)/3_place.sdc: $(RESULTS_DIR)/2_floorplan.sdc
566-
cp $< $@
588+
$(eval $(call do-copy,3_place,2_floorplan.sdc,,.sdc))
589+
590+
.PHONY: do-place
591+
do-place:
592+
$(UNSET_AND_MAKE) do-3_1_place_gp_skip_io do-3_2_place_iop do-3_3_place_gp do-3_4_place_resized do-3_5_place_dp do-3_place do-3_place.sdc
567593

568594
# Clean Targets
569595
#-------------------------------------------------------------------------------
@@ -598,8 +624,11 @@ $(eval $(call do-step,4_2_cts_fillcell,$(RESULTS_DIR)/4_1_cts.odb,fillcell))
598624

599625
$(RESULTS_DIR)/4_cts.sdc: $(RESULTS_DIR)/4_cts.odb
600626

601-
$(RESULTS_DIR)/4_cts.odb: $(RESULTS_DIR)/4_2_cts_fillcell.odb
602-
cp $< $@
627+
$(eval $(call do-copy,4_cts,4_2_cts_fillcell.odb))
628+
629+
.PHONY: do-cts
630+
do-cts:
631+
$(UNSET_AND_MAKE) do-4_1_cts do-4_2_cts_fillcell do-4_cts
603632

604633
.PHONY: clean_cts
605634
clean_cts:
@@ -633,11 +662,13 @@ else
633662
$(eval $(call do-step,5_2_route,$(RESULTS_DIR)/4_cts.odb,detail_route))
634663
endif
635664

636-
$(RESULTS_DIR)/5_route.odb: $(RESULTS_DIR)/5_2_route.odb
637-
cp $< $@
665+
$(eval $(call do-copy,5_route,5_2_route.odb))
638666

639-
$(RESULTS_DIR)/5_route.sdc: $(RESULTS_DIR)/4_cts.sdc
640-
cp $< $@
667+
$(eval $(call do-copy,5_route,4_cts.sdc,,.sdc))
668+
669+
.PHONY: do-route
670+
do-route:
671+
$(UNSET_AND_MAKE) do-5_1_grt do-5_2_route do-5_route do-5_route.sdc
641672

642673
$(RESULTS_DIR)/5_route.v:
643674
@export OR_DB=5_route ;\
@@ -693,20 +724,21 @@ elapsed:
693724
ifneq ($(USE_FILL),)
694725
$(eval $(call do-step,6_1_fill,$(RESULTS_DIR)/5_route.odb $(FILL_CONFIG),density_fill))
695726
else
696-
$(RESULTS_DIR)/6_1_fill.odb: $(RESULTS_DIR)/5_route.odb
697-
cp $< $@
727+
$(eval $(call do-copy,6_1_fill,5_route.odb))
698728
endif
699729

700-
$(RESULTS_DIR)/6_1_fill.sdc: $(RESULTS_DIR)/5_route.sdc
701-
cp $< $@
730+
$(eval $(call do-copy,6_1_fill,5_route.sdc,,.sdc))
702731

703-
$(RESULTS_DIR)/6_final.sdc: $(RESULTS_DIR)/5_route.sdc
704-
cp $< $@
732+
$(eval $(call do-copy,6_final,5_route.sdc,,.sdc))
705733

706734
$(eval $(call do-step,6_report,$(RESULTS_DIR)/6_1_fill.odb $(RESULTS_DIR)/6_1_fill.sdc,final_report,.log,$(LOG_DIR)))
707735

708736
$(RESULTS_DIR)/6_final.def: $(LOG_DIR)/6_report.log
709737

738+
# NOTE! No GDS file for now
739+
.PHONY: do-finish
740+
do-finish:
741+
$(UNSET_AND_MAKE) do-6_1_fill do-6_1_fill.sdc do-6_final.sdc do-6_report elapsed
710742

711743
# Skipping resize can be useful for mock abstracts
712744
.PHONY: skip_resize
@@ -735,9 +767,17 @@ skip_route: $(RESULTS_DIR)/4_cts.odb $(RESULTS_DIR)/4_cts.sdc
735767
#
736768
# make skip_resize skip_cts skip_route generate_abstract
737769
.PHONY: generate_abstract
738-
generate_abstract: $(RESULTS_DIR)/6_final.gds $(RESULTS_DIR)/6_final.def $(RESULTS_DIR)/6_final.v
770+
generate_abstract: $(RESULTS_DIR)/6_final.gds $(RESULTS_DIR)/6_final.def $(RESULTS_DIR)/6_final.v $(RESULTS_DIR)/6_final.sdc
771+
$(UNSET_AND_MAKE) do-generate_abstract
772+
773+
.PHONY: do-generate_abstract
774+
do-generate_abstract:
739775
($(TIME_CMD) $(OPENROAD_CMD) $(SCRIPTS_DIR)/generate_abstract.tcl -metrics $(LOG_DIR)/generate_abstract.json) 2>&1 | tee $(LOG_DIR)/generate_abstract.log
740776

777+
.PHONY: clean_abstract
778+
clean_abstract:
779+
rm -f $(RESULTS_DIR)/$(DESIGN_NAME).lib $(RESULTS_DIR)/$(DESIGN_NAME).lef
780+
741781
# Merge wrapped macros using Klayout
742782
#-------------------------------------------------------------------------------
743783
$(WRAPPED_GDSOAS): $(OBJECTS_DIR)/klayout_wrap.lyt $(WRAPPED_LEFS)
@@ -837,7 +877,7 @@ clean:
837877
@echo
838878

839879
.PHONY: clean_all
840-
clean_all: clean_synth clean_floorplan clean_place clean_cts clean_route clean_finish clean_metadata
880+
clean_all: clean_synth clean_floorplan clean_place clean_cts clean_route clean_finish clean_metadata clean_abstract
841881
rm -rf $(OBJECTS_DIR)
842882

843883
.PHONY: nuke

0 commit comments

Comments
 (0)