Skip to content

Commit 4009058

Browse files
authored
Merge pull request #1546 from Pinata-Consulting/sed-bogus-error-nit
makefile: avoid bogus sed errors when there is no .sdc file
2 parents faed9d8 + 8ce4ee1 commit 4009058

File tree

7 files changed

+7
-12
lines changed

7 files changed

+7
-12
lines changed

flow/platforms/asap7/config.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ export LATCH_MAP_FILE = $(PLATFORM_DIR)/yoSys/cells_latch_R.v
5858
export CLKGATE_MAP_FILE = $(PLATFORM_DIR)/yoSys/cells_clkgate_R.v
5959
export ADDER_MAP_FILE ?= $(PLATFORM_DIR)/yoSys/cells_adders_R.v
6060

61-
# Set yosys-abc clock period to first "clk_period" value or "-period" value found in sdc file
62-
export ABC_CLOCK_PERIOD_IN_PS ?= $(shell sed -nE "s/^set\s+clk_period\s+(\S+).*|.*-period\s+(\S+).*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1}')
6361
export ABC_DRIVER_CELL = BUFx2_ASAP7_75t_R
6462

6563
# BUF_X1, pin (A) = 0.974659. Arbitrarily multiply by 4

flow/platforms/gf180/config.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ export RC_FILE = $(PLATFORM_DIR)/setRC.tcl
4444
export TIEHI_CELL_AND_PORT = gf180mcu_fd_sc_mcu$(TRACK_OPTION)$(POWER_OPTION)__tieh Z
4545
export TIELO_CELL_AND_PORT = gf180mcu_fd_sc_mcu$(TRACK_OPTION)$(POWER_OPTION)__tiel ZN
4646

47-
# Set yosys-abc clock period to first "clk_period" value or "-period" value found in sdc file
48-
export ABC_CLOCK_PERIOD_IN_PS ?= $(shell sed -nE "s/^set\s+clk_period\s+(\S+).*|.*-period\s+(\S+).*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1*1000}')
4947
export ABC_DRIVER_CELL = gf180mcu_fd_sc_mcu$(TRACK_OPTION)$(POWER_OPTION)__buf_4
5048
export ABC_LOAD_IN_FF = 0.01343
5149

flow/platforms/nangate45/config.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ export LATCH_MAP_FILE = $(PLATFORM_DIR)/cells_latch.v
3737
export CLKGATE_MAP_FILE = $(PLATFORM_DIR)/cells_clkgate.v
3838
export ADDER_MAP_FILE ?= $(PLATFORM_DIR)/cells_adders.v
3939
#
40-
# Set yosys-abc clock period to first "-period" found in sdc file
41-
export ABC_CLOCK_PERIOD_IN_PS ?= $(shell sed -nE "s/^set clk_period (.+)|.* -period (.+) .*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1*1000}')
4240
export ABC_DRIVER_CELL = BUF_X1
4341
# BUF_X1, pin (A) = 0.974659. Arbitrarily multiply by 4
4442
export ABC_LOAD_IN_FF = 3.898

flow/platforms/sky130hd/config.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ export ADDER_MAP_FILE ?= $(PLATFORM_DIR)/cells_adders_hd.v
7777
# Define ABC driver and load
7878
export ABC_DRIVER_CELL = sky130_fd_sc_hd__buf_1
7979
export ABC_LOAD_IN_FF = 5
80-
# Set yosys-abc clock period to first "clk_period" value or "-period" value found in sdc file
81-
export ABC_CLOCK_PERIOD_IN_PS ?= $(shell sed -nE "s/^set clk_period (.+)|.* -period (.+) .*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1*1000}')
8280
#--------------------------------------------------------
8381
# Floorplan
8482
# -------------------------------------------------------

flow/platforms/sky130hd_fakestack/config.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ export ADDER_MAP_FILE ?= $(PLATFORM_DIR)/cells_adders_hd.v
7878
# Define ABC driver and load
7979
export ABC_DRIVER_CELL = sky130_fd_sc_hd__buf_1
8080
export ABC_LOAD_IN_FF = 5
81-
# Set yosys-abc clock period to first "clk_period" value or "-period" value found in sdc file
82-
export ABC_CLOCK_PERIOD_IN_PS ?= $(shell sed -nE "s/^set clk_period (.+)|.* -period (.+) .*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1*1000}')
8381
#--------------------------------------------------------
8482
# Floorplan
8583
# -------------------------------------------------------

flow/platforms/sky130hs/config.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ export ADDER_MAP_FILE ?= $(PLATFORM_DIR)/cells_adders_hs.v
3939
# Define ABC driver and load
4040
export ABC_DRIVER_CELL = sky130_fd_sc_hs__buf_1
4141
export ABC_LOAD_IN_FF = 5
42-
# Set yosys-abc clock period to first "clk_period" value or "-period" value found in sdc file
43-
export ABC_CLOCK_PERIOD_IN_PS ?= $(shell sed -nE "s/^set clk_period (.+)|.* -period (.+) .*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1*1000}')
4442
#--------------------------------------------------------
4543
# Floorplan
4644
# -------------------------------------------------------

flow/util/utils.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,10 @@ endif
152152
.PHONY: update_sdc_clocks
153153
update_sdc_clocks: $(RESULTS_DIR)/route.guide
154154
cp $(RESULTS_DIR)/updated_clks.sdc $(SDC_FILE)
155+
156+
# Set yosys-abc clock period to first "clk_period" value or "-period" value found in sdc file
157+
ifeq ($(origin ABC_CLOCK_PERIOD_IN_PS), undefined)
158+
ifneq ($(wildcard $(SDC_FILE)),)
159+
export ABC_CLOCK_PERIOD_IN_PS := $(shell sed -nE "s/^set\s+clk_period\s+(\S+).*|.*-period\s+(\S+).*/\1\2/p" $(SDC_FILE) | head -1 | awk '{print $$1}')
160+
endif
161+
endif

0 commit comments

Comments
 (0)