-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds 1800 2017 6.14 chandle.
- Loading branch information
Showing
15 changed files
with
168 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
chandle1.sv | ||
--bound 0 | ||
^\[main\.p0\] always main\.some_handle == null: PROVED up to bound 0$ | ||
^\[main\.p1\] always 56'h6368616E646C65 == 56'h6368616E646C65: PROVED up to bound 0$ | ||
^EXIT=0$ | ||
^SIGNAL=0$ | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module main; | ||
|
||
// IEEE 1800-2017 6.14 | ||
chandle some_handle = null; | ||
|
||
p0: assert final (some_handle == null); | ||
p1: assert final ($typename(some_handle) == "chandle"); | ||
|
||
endmodule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ Author: Daniel Kroening, [email protected] | |
#include "aval_bval_encoding.h" | ||
#include "verilog_bits.h" | ||
#include "verilog_expr.h" | ||
#include "verilog_types.h" | ||
|
||
/// If applicable, lower the three Verilog real types to floatbv. | ||
typet lower_verilog_real_types(typet type) | ||
|
@@ -183,9 +184,26 @@ exprt verilog_lowering(exprt expr) | |
// no need to change value | ||
expr.type() = lower_verilog_real_types(expr.type()); | ||
} | ||
else if(expr.type().id() == ID_verilog_chandle) | ||
{ | ||
// this is 'null' | ||
return to_verilog_chandle_type(expr.type()).null_expr(); | ||
} | ||
|
||
return expr; | ||
} | ||
else if(expr.id() == ID_symbol) | ||
{ | ||
auto &symbol_expr = to_symbol_expr(expr); | ||
if(expr.type().id() == ID_verilog_chandle) | ||
{ | ||
auto &chandle_type = to_verilog_chandle_type(expr.type()); | ||
return symbol_exprt{ | ||
symbol_expr.get_identifier(), chandle_type.encoding()}; | ||
} | ||
else | ||
return expr; | ||
} | ||
else if(expr.id() == ID_concatenation) | ||
{ | ||
if( | ||
|
@@ -421,6 +439,8 @@ typet verilog_lowering(typet type) | |
{ | ||
if(type.id() == ID_verilog_signedbv || type.id() == ID_verilog_unsignedbv) | ||
return lower_to_aval_bval(type); | ||
else if(type.id() == ID_verilog_chandle) | ||
return to_verilog_chandle_type(type).encoding(); | ||
else | ||
return type; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*******************************************************************\ | ||
Module: Verilog Types | ||
Author: Daniel Kroening, [email protected] | ||
\*******************************************************************/ | ||
|
||
#include "verilog_types.h" | ||
|
||
#include <util/std_expr.h> | ||
|
||
constant_exprt verilog_chandle_typet::null_expr() const | ||
{ | ||
return encoding().all_zeros_expr(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters