File tree Expand file tree Collapse file tree 4 files changed +47
-1
lines changed
regression/verilog/assert4 Expand file tree Collapse file tree 4 files changed +47
-1
lines changed Original file line number Diff line number Diff line change
1
+ module main ();
2
+ `define SIZE 31
3
+ `define plus_binary(a,b) \
4
+ a+ b
5
+
6
+ reg [`SIZE:0 ] x ;
7
+ wire clk;
8
+
9
+ initial x = 1 ;
10
+
11
+ always @(posedge clk) x <= `plus_binary(x ,1 );
12
+
13
+ always assert property1: x != 10 ;
14
+
15
+ endmodule
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.v
3
+ --module main --bound 20 --trace
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ ^Counterexample:$
7
+ \[main.property.property1\] .* FAILURE$
8
+ --
9
+ ^warning: ignoring
Original file line number Diff line number Diff line change 7
7
\*******************************************************************/
8
8
9
9
#include < sstream>
10
+ #include < iostream>
10
11
11
12
#include < util/suffix.h>
12
13
@@ -40,6 +41,10 @@ bool verilog_languaget::parse(
40
41
if (preprocess (instream, path, str))
41
42
return true ;
42
43
44
+ std::cerr << " --------------------------------------------------\n " ;
45
+ std::cerr << str.str ();
46
+ std::cerr << " \n --------------------------------------------------\n " ;
47
+
43
48
verilog_parser.set_file (path);
44
49
verilog_parser.in =&str;
45
50
verilog_parser.set_message_handler (get_message_handler ());
Original file line number Diff line number Diff line change @@ -496,18 +496,35 @@ void verilog_preprocessort::directive()
496
496
tptr++;
497
497
}
498
498
499
+ auto old_tptr = tptr;
500
+ // maybe skip whitespace between name and paramlist
501
+ while (*tptr == ' ' || *tptr == ' \t ' || *tptr == ' \n ' )
502
+ tptr++;
503
+
499
504
// is there a parameter list?
500
505
if (*tptr==' (' )
501
506
{
507
+ // we don't expect any extra parentheses inside parameter list
502
508
while (*(++tptr) != ' )' )
503
509
param_string.push_back (*tptr);
504
510
++tptr; // get past the closing parenthesis
505
- }
511
+ } else
512
+ tptr = old_tptr;
506
513
507
514
// skip whitespace
508
515
while (*tptr==' ' || *tptr==' \t ' ) tptr++;
509
516
510
517
value=tptr;
518
+ // handle multi-line macros
519
+ while (value.back () == ' \\ ' ) {
520
+ value.pop_back ();
521
+ files.back ().getline (line);
522
+ tptr = line.c_str ();
523
+ // remove indentation
524
+ while (*tptr == ' ' || *tptr == ' \t ' )
525
+ tptr++;
526
+ value += tptr;
527
+ }
511
528
512
529
// remove trailing whitespace
513
530
You can’t perform that action at this time.
0 commit comments