mirror of https://github.com/VLSIDA/OpenRAM.git
Rework macros to run ROM tests too.
This commit is contained in:
parent
eec0f02bb8
commit
041c738cb2
|
|
@ -17,29 +17,38 @@ endif
|
||||||
# Verbosity
|
# Verbosity
|
||||||
OPENRAM_OPTS += -v --keeptemp
|
OPENRAM_OPTS += -v --keeptemp
|
||||||
|
|
||||||
CONFIG_DIR = configs
|
SRAM_CONFIG_DIR = sram_configs
|
||||||
SRCS=$(filter-out disabled-% %_common.py,$(sort $(notdir $(wildcard $(CONFIG_DIR)/*.py))))
|
SRAM_SRCS=$(filter-out disabled-% %_common.py,$(sort $(notdir $(wildcard $(SRAM_CONFIG_DIR)/*.py))))
|
||||||
DIRS=$(basename $(SRCS))
|
SRAM_DIRS=$(basename $(SRAM_SRCS))
|
||||||
STAMPS=$(addsuffix .ok,$(DIRS))
|
SRAM_STAMPS=$(addsuffix .ok,$(SRAM_DIRS))
|
||||||
|
|
||||||
|
ROM_CONFIG_DIR = rom_configs
|
||||||
|
ROM_SRCS=$(filter-out disabled-% %_common.py,$(sort $(notdir $(wildcard $(ROM_CONFIG_DIR)/*.py))))
|
||||||
|
ROM_DIRS=$(basename $(ROM_SRCS))
|
||||||
|
ROM_STAMPS=$(addsuffix .ok,$(ROM_DIRS))
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
@echo
|
@echo
|
||||||
@echo "Using OpenRAM at $(OPENRAM_HOME)"
|
@echo "Using OpenRAM at $(OPENRAM_HOME)"
|
||||||
@echo " (which is version $$(cd $(OPENRAM_HOME); git describe --tags))"
|
@echo " (which is version $$(cd $(OPENRAM_HOME); git describe --tags))"
|
||||||
@echo
|
@echo
|
||||||
@echo "Configurations:"
|
@echo "SRAM Configurations:"
|
||||||
@for D in $(DIRS); do echo " - $$D"; done
|
@for D in $(SRAM_DIRS); do echo " - $$D"; done
|
||||||
|
@echo "ROM Configurations:"
|
||||||
|
@for D in $(ROM_DIRS); do echo " - $$D"; done
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
.PHONY: configs
|
.PHONY: configs
|
||||||
|
|
||||||
BROKEN :=
|
BROKEN :=
|
||||||
|
|
||||||
WORKING_STAMPS=$(filter-out $(addsuffix .ok, $(BROKEN)), $(STAMPS))
|
WORKING_SRAM_STAMPS=$(filter-out $(addsuffix .ok, $(BROKEN)), $(SRAM_STAMPS))
|
||||||
EXAMPLE_STAMPS=$(filter example%, $(WORKING_STAMPS))
|
WORKING_ROM_STAMPS=$(filter-out $(addsuffix .ok, $(BROKEN)), $(ROM_STAMPS))
|
||||||
SKY130_STAMPS=$(filter sky130%, $(WORKING_STAMPS))
|
|
||||||
FREEPDK45_STAMPS=$(filter freepdk45%, $(WORKING_STAMPS))
|
EXAMPLE_STAMPS=$(filter example%, $(WORKING_SRAM_STAMPS)) $(filter example%, $(WORKING_ROM_STAMPS))
|
||||||
SCN4M_SUBM_STAMPS=$(filter scn4m_subm%, $(WORKING_STAMPS))
|
SKY130_STAMPS=$(filter sky130%, $(WORKING_SRAM_STAMPS)) $(filter sky130%, $(WORKING_ROM_STAMPS))
|
||||||
|
FREEPDK45_STAMPS=$(filter freepdk45%, $(WORKING_STAMPS)) $(filter freepdk45%, $(WORKING_ROM_STAMPS))
|
||||||
|
SCN4M_SUBM_STAMPS=$(filter scn4m_subm%, $(WORKING_STAMPS)) $(filter scn4m_subm%, $(WORKING_ROM_STAMPS))
|
||||||
|
|
||||||
all: | configs
|
all: | configs
|
||||||
@echo
|
@echo
|
||||||
|
|
@ -61,11 +70,21 @@ freepdk45: $(FREEPDK45_STAMPS)
|
||||||
scn4m_subm: $(SCN4M_SUBM_STAMPS)
|
scn4m_subm: $(SCN4M_SUBM_STAMPS)
|
||||||
.PHONY: scn4m_subm
|
.PHONY: scn4m_subm
|
||||||
|
|
||||||
OPENRAM_TMP=$(MACRO_DIR)/$*/tmp
|
rom: $(WORKING_ROM_STAMPS)
|
||||||
%.ok: configs/%.py
|
.PHONY: rom
|
||||||
|
|
||||||
|
sram: $(WORKING_SRAM_STAMPS)
|
||||||
|
.PHONY: sram
|
||||||
|
|
||||||
|
%.ok: sram_configs/%.py
|
||||||
@echo "Building $*"
|
@echo "Building $*"
|
||||||
@mkdir -p $*
|
@mkdir -p $*
|
||||||
@python3 -u $(OPENRAM_COMPILER) $(OPENRAM_OPTS) -o $* -p $(MACRO_DIR)/$* $(MACRO_DIR)/$< && touch $@
|
@python3 -u $(SRAM_COMPILER) $(OPENRAM_OPTS) -o $* -p $(MACRO_DIR)/$* $(MACRO_DIR)/$< && touch $@
|
||||||
|
|
||||||
|
%.ok: rom_configs/%.py
|
||||||
|
@echo "Building $*"
|
||||||
|
@mkdir -p $*
|
||||||
|
@python3 -u $(ROM_COMPILER) $(OPENRAM_OPTS) -o $* -p $(MACRO_DIR)/$* $(MACRO_DIR)/$< && touch $@
|
||||||
|
|
||||||
.DELETE_ON_ERROR: $(STAMPS)
|
.DELETE_ON_ERROR: $(STAMPS)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,12 +8,13 @@
|
||||||
|
|
||||||
word_size = 1
|
word_size = 1
|
||||||
|
|
||||||
tech_name = "sky130"
|
|
||||||
|
|
||||||
nominal_corner_only = True
|
nominal_corner_only = True
|
||||||
|
|
||||||
output_name = "rom"
|
|
||||||
|
|
||||||
spice_name = "ngspice"
|
rom_data = "rom_configs/example_1kbyte.dat"
|
||||||
|
|
||||||
rom_data = "macros/rom_example_data/rom_data_1kB"
|
output_name = "rom_1kbyte"
|
||||||
|
output_path = "macro/{output_name}".format(**locals())
|
||||||
|
|
||||||
|
import os
|
||||||
|
exec(open(os.path.join(os.path.dirname(__file__), 'sky130_rom_common.py')).read())
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
OPENRAM_HOME := $(abspath $(TOP_DIR)/compiler)
|
OPENRAM_HOME := $(abspath $(TOP_DIR)/compiler)
|
||||||
OPENRAM_TECH := $(abspath $(TOP_DIR)/technology)
|
OPENRAM_TECH := $(abspath $(TOP_DIR)/technology)
|
||||||
OPENRAM_COMPILER := $(abspath $(TOP_DIR)/sram_compiler.py)
|
SRAM_COMPILER := $(abspath $(TOP_DIR)/sram_compiler.py)
|
||||||
|
ROM_COMPILER := $(abspath $(TOP_DIR)/rom_compiler.py)
|
||||||
|
|
||||||
PDK_ROOT ?= $(TOP_DIR)
|
PDK_ROOT ?= $(TOP_DIR)
|
||||||
|
|
||||||
ifeq (,$(wildcard $(OPENRAM_COMPILER)))
|
ifeq (,$(wildcard $(SRAM_COMPILER)))
|
||||||
$(error Did not find '$(OPENRAM_COMPILER)' in '$(OPENRAM_HOME)' (from $$OPENRAM_HOME))
|
$(error Did not find '$(SRAM_COMPILER)' in '$(OPENRAM_HOME)' (from $$OPENRAM_HOME))
|
||||||
endif
|
endif
|
||||||
export OPENRAM_HOME
|
export OPENRAM_HOME
|
||||||
export OPENRAM_TECH
|
export OPENRAM_TECH
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue