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 <seanga2@gmail.com>
This commit is contained in:
parent
799aeb92d6
commit
897326dbdb
5
Makefile
5
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$(<D) -M$@.pre -s $(TOP) -o $@ $< $(EXTRA_V) && \
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
`ifndef COMMON_VH
|
||||
`define COMMON_VH
|
||||
|
||||
`default_nettype none
|
||||
`timescale 1ns/1ns
|
||||
|
||||
`ifdef SYNTHESIS
|
||||
`define DUMP(levels)
|
||||
`else
|
||||
|
|
Loading…
Reference in New Issue