From 897326dbdb6eb93028a0c7c53ab35e94f12b4323 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Sun, 21 Aug 2022 12:41:19 -0400 Subject: [PATCH] Move default_nettype/timescale declaration to common.vh We will need this in every verilog file, so consolidate things a bit. In terms of timescale, we need to modify the post-synthesis verilog generation a bit in order to avoid the module's timecale being inadverdently overwritten. Signed-off-by: Sean Anderson --- Makefile | 5 +++-- rtl/common.vh | 3 +++ rtl/pcs.v | 2 -- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4c62df3..6968114 100644 --- a/Makefile +++ b/Makefile @@ -17,10 +17,11 @@ FORCE: $(SYNTH) -q -E $@.d -p "synth_ice40 -top $(*F)" -b json -o $@ -f verilog $< %.post.v: %.json %.v - ( grep timescale $*.v && echo '`include "common.vh"' && \ + ( echo '`include "common.vh"'; grep timescale $*.v; \ $(SYNTH) -q -b verilog -f json $< ) | sed 's/endmodule/`DUMP(1)\n\0/g' > $@ -IFLAGS := -g2012 -Wall +# Don't warn about including the timescale from common.vh +IFLAGS := -g2012 -Wall -Wno-timescale define run-icarus = $(ICARUS) $(IFLAGS) -I$( */ -`default_nettype none - `include "common.vh" /* 4b5b code groups */