-
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.
Merge pull request #410 from diffblue/force-system-verilog
ebmc: add --systemverilog command-line option
- Loading branch information
Showing
7 changed files
with
53 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CORE | ||
main1.v | ||
--systemverilog | ||
^EXIT=10$ | ||
^SIGNAL=0$ | ||
^no properties$ | ||
-- | ||
^warning: ignoring |
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,5 @@ | ||
module main; | ||
// 'logic' is a SystemVerilog keyword | ||
logic some_logic; | ||
initial some_logic = 1; | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ Author: Daniel Kroening, [email protected] | |
#include <util/get_module.h> | ||
#include <util/message.h> | ||
#include <util/namespace.h> | ||
#include <util/options.h> | ||
#include <util/unicode.h> | ||
|
||
#include <langapi/language.h> | ||
|
@@ -107,6 +108,11 @@ int preprocess(const cmdlinet &cmdline, message_handlert &message_handler) | |
return 1; | ||
} | ||
|
||
optionst options; | ||
options.set_option("force-systemverilog", cmdline.isset("systemverilog")); | ||
|
||
language->set_language_options(options, message_handler); | ||
|
||
if(language->preprocess(infile, filename, std::cout, message_handler)) | ||
{ | ||
message.error() << "PREPROCESSING FAILED" << messaget::eom; | ||
|
@@ -116,7 +122,8 @@ int preprocess(const cmdlinet &cmdline, message_handlert &message_handler) | |
return 0; | ||
} | ||
|
||
bool parse( | ||
static bool parse( | ||
const cmdlinet &cmdline, | ||
const std::string &filename, | ||
language_filest &language_files, | ||
message_handlert &message_handler) | ||
|
@@ -147,6 +154,11 @@ bool parse( | |
|
||
languaget &language = *lf.language; | ||
|
||
optionst options; | ||
options.set_option("force-systemverilog", cmdline.isset("systemverilog")); | ||
|
||
language.set_language_options(options, message_handler); | ||
|
||
message.status() << "Parsing " << filename << messaget::eom; | ||
|
||
if(language.parse(infile, filename, message_handler)) | ||
|
@@ -167,7 +179,7 @@ bool parse( | |
{ | ||
for(unsigned i = 0; i < cmdline.args.size(); i++) | ||
{ | ||
if(parse(cmdline.args[i], language_files, message_handler)) | ||
if(parse(cmdline, cmdline.args[i], language_files, message_handler)) | ||
return true; | ||
} | ||
return false; | ||
|
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 |
---|---|---|
|
@@ -20,6 +20,25 @@ Author: Daniel Kroening, [email protected] | |
|
||
/*******************************************************************\ | ||
Function: verilog_languaget::set_language_options | ||
Inputs: | ||
Outputs: | ||
Purpose: | ||
\*******************************************************************/ | ||
|
||
void verilog_languaget::set_language_options( | ||
const optionst &options, | ||
message_handlert &message_handler) | ||
{ | ||
force_systemverilog = options.get_bool_option("force-systemverilog"); | ||
} | ||
|
||
/*******************************************************************\ | ||
Function: verilog_languaget::parse | ||
Inputs: | ||
|
@@ -46,8 +65,8 @@ bool verilog_languaget::parse( | |
verilog_parser.in=&str; | ||
verilog_parser.log.set_message_handler(message_handler); | ||
verilog_parser.grammar=verilog_parsert::LANGUAGE; | ||
if(has_suffix(path, ".sv")) | ||
|
||
if(has_suffix(path, ".sv") || force_systemverilog) | ||
verilog_parser.mode=verilog_parsert::SYSTEM_VERILOG; | ||
|
||
verilog_scanner_init(); | ||
|
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