diff --git a/openfpga_flow/openfpga_cell_library/Makefile b/openfpga_flow/openfpga_cell_library/Makefile new file mode 100644 index 000000000..883aace7b --- /dev/null +++ b/openfpga_flow/openfpga_cell_library/Makefile @@ -0,0 +1,29 @@ +# +# OpenFPGA cell library Makefile +# ============================== +# +# Check correctness of the cell library files + +SHELL = bash +PYTHON_EXEC ?= python3 + +# Put it first so that "make" without argument is like "make help". +export COMMENT_EXTRACT + +# Put it first so that "make" without argument is like "make help". +help: + @${PYTHON_EXEC} -c "$$COMMENT_EXTRACT" + +compile_verilog: +# This command checks the compile compatibility of Verilog files + for f in `cat verilog_sources.f`; do iverilog $$f; done + +# Functions to extract comments from Makefiles +define COMMENT_EXTRACT +import re +with open ('Makefile', 'r' ) as f: + matches = re.finditer('^([a-zA-Z-_]*):.*\n#(.*)', f.read(), flags=re.M) + for _, match in enumerate(matches, start=1): + header, content = match[1], match[2] + print(f" {header:10} {content}") +endef diff --git a/openfpga_flow/openfpga_cell_library/verilog_sources.f b/openfpga_flow/openfpga_cell_library/verilog_sources.f new file mode 100644 index 000000000..f045187a1 --- /dev/null +++ b/openfpga_flow/openfpga_cell_library/verilog_sources.f @@ -0,0 +1,23 @@ +verilog/adder.v +verilog/aib.v +verilog/buf4.v +verilog/dff.v +verilog/dpram.v +verilog/dpram16k.v +verilog/dpram1k.v +verilog/dpram8k.v +verilog/dpram_2048x8.v +verilog/frac_mem_32k.v +verilog/frac_mult_16x16.v +verilog/gpio.v +verilog/inv.v +verilog/latch.v +verilog/lut6.v +verilog/mult_32x32.v +verilog/mult_36x36.v +verilog/mult_8x8.v +verilog/mux2.v +verilog/or2.v +verilog/spram_4x1.v +verilog/sram.v +verilog/tap_buf4.v