File tree Expand file tree Collapse file tree 3 files changed +12
-19
lines changed
regression/verilog/synthesis Expand file tree Collapse file tree 3 files changed +12
-19
lines changed Original file line number Diff line number Diff line change 1
1
CORE
2
2
posedge_vector.v
3
3
--module main
4
- ^file posedge_vector.v line \d+: pos/negedge expected to have Boolean as operand, but got \[7:0\] $
5
- ^EXIT=2 $
4
+ ^no properties $
5
+ ^EXIT=10 $
6
6
^SIGNAL=0$
7
7
--
8
8
^warning: ignoring
Original file line number Diff line number Diff line change 1
1
module main (input [7 :0 ] data);
2
2
3
+ // Allowed; only the LSB will be considered.
3
4
always @(posedge data);
4
5
5
6
endmodule
Original file line number Diff line number Diff line change @@ -2729,22 +2729,6 @@ void verilog_synthesist::synth_event_guard(
2729
2729
<< " pos/negedge expected to have one operand" ;
2730
2730
}
2731
2731
2732
- if (to_unary_expr (*it).op ().id () != ID_symbol)
2733
- {
2734
- throw errort ().with_location (it->source_location ())
2735
- << " pos/negedge expected to have symbol as operand, "
2736
- " but got " +
2737
- to_unary_expr (*it).op ().pretty ();
2738
- }
2739
-
2740
- if (to_unary_expr (*it).op ().type ().id () != ID_bool)
2741
- {
2742
- throw errort ().with_location (it->source_location ())
2743
- << " pos/negedge expected to have Boolean as operand, "
2744
- " but got " +
2745
- to_string (to_unary_expr (*it).op ().type ());
2746
- }
2747
-
2748
2732
irep_idt identifier=" conf::clock_enable_mode" ;
2749
2733
2750
2734
// check symbol_table for clock guard
@@ -2753,7 +2737,15 @@ void verilog_synthesist::synth_event_guard(
2753
2737
{
2754
2738
// found! we make it a guard
2755
2739
2756
- guards.push_back (to_unary_expr (*it).op ());
2740
+ auto &op = to_unary_expr (*it).op ();
2741
+
2742
+ if (op.type ().id () == ID_bool)
2743
+ guards.push_back (op);
2744
+ else
2745
+ {
2746
+ // get LSB
2747
+ guards.push_back (extractbit_exprt{op, integer_typet{}.zero_expr ()});
2748
+ }
2757
2749
2758
2750
throw errort () << " Notice: using clock guard " << identifier;
2759
2751
}
You can’t perform that action at this time.
0 commit comments