Skip to content

Commit de89a04

Browse files
committed
Verilog: introduce the Verilog indexer
This adds a recusive decent parser for quicky indexing large quantities of Verilog, tolerating parsing errors, for the purpose of creating overview data very quickly. A new executable, vlindex, is added to output it.
1 parent d3071f4 commit de89a04

10 files changed

+1260
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
nested_case1.v
3+
--bound 0
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
^\[main.property.p1\] .* PROVED up to bound 0$
7+
--
8+
^warning: ignoring
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module main(input x, input y);
2+
3+
reg result;
4+
5+
always @(x, y)
6+
case(x)
7+
0: result = 0;
8+
1:
9+
case(y)
10+
1: result = 1;
11+
0: result = 0;
12+
endcase
13+
endcase
14+
15+
always assert p1: result == (x && y);
16+
17+
endmodule

src/Makefile

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
DIRS = ebmc hw-cbmc temporal-logic trans-word-level trans-netlist \
2-
verilog vhdl smvlang ic3 aiger
2+
verilog vhdl smvlang ic3 aiger vlindex
33

44
EBMC_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
55
CPROVER_DIR:=../lib/cbmc/src
66

7-
all: hw-cbmc.dir ebmc.dir
7+
all: hw-cbmc.dir ebmc.dir vlindex.dir
88

99
.PHONY: $(patsubst %, %.dir, $(DIRS))
1010
$(patsubst %, %.dir, $(DIRS)):
@@ -21,6 +21,8 @@ ebmc.dir: trans-word-level.dir trans-netlist.dir verilog.dir vhdl.dir \
2121
hw-cbmc.dir: trans-word-level.dir trans-netlist.dir verilog.dir \
2222
vhdl.dir smvlang.dir cprover.dir temporal-logic.dir
2323

24+
vlindex.dir: cprover.dir verilog.dir
25+
2426
# building cbmc proper
2527
.PHONY: cprover.dir
2628
cprover.dir:

src/verilog/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ SRC = expr2verilog.cpp \
33
verilog_elaborate.cpp \
44
verilog_expr.cpp \
55
verilog_generate.cpp \
6+
verilog_indexer.cpp \
67
verilog_interfaces.cpp \
78
verilog_interpreter.cpp \
89
verilog_language.cpp \
@@ -53,4 +54,5 @@ verilog_preprocessor_lex.yy.cpp: verilog_preprocessor_tokenizer.l
5354
# extra dependencies
5455
verilog_y.tab$(OBJEXT): verilog_y.tab.cpp verilog_y.tab.h
5556
verilog_lex.yy$(OBJEXT): verilog_y.tab.cpp verilog_lex.yy.cpp verilog_y.tab.h
57+
verilog_indexer.cpp: verilog_y.tab.h
5658

0 commit comments

Comments
 (0)