Skip to content

Commit

Permalink
Smallfix
Browse files Browse the repository at this point in the history
  • Loading branch information
akashlevy committed Sep 22, 2024
1 parent 89f9035 commit d655766
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions frontends/verific/verific.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3736,14 +3736,15 @@ struct VerificPass : public Pass {
veri_file::DefineMacro(is_formal ? "FORMAL" : "SYNTHESIS");
*/

// SILIMATE: VHDL processing
// SILIMATE: VHDL processing using GHDL
int i;
FOREACH_ARRAY_ITEM(file_names, i, filename) {
std::string file_name_str = filename;
// Convert filename to std::string
std::string filename_str = filename;

// Check if file is VHDL
if (file_name_str.substr(file_name_str.find_last_of(".") + 1) == "vhd") goto is_vhdl;
if (file_name_str.substr(file_name_str.find_last_of(".") + 1) == "vhdl") goto is_vhdl;
if (filename_str.substr(filename_str.find_last_of(".") + 1) == "vhd") goto is_vhdl;
if (filename_str.substr(filename_str.find_last_of(".") + 1) == "vhdl") goto is_vhdl;
continue;

// Convert to Verilog
Expand All @@ -3763,17 +3764,17 @@ struct VerificPass : public Pass {
if (!FileSystem::PathExists(ghdl_path.c_str())) ghdl_path = "ghdl";

// Run command to convert VHDL to Verilog
std::string top = file_name_str.substr(0, std::string(FileSystem::Basename(filename)).find_last_of("."));
std::string top = filename_str.substr(0, std::string(FileSystem::Basename(filename)).find_last_of("."));
std::string outfile = "preqorsor/data/" + top + ".v";
std::string ghdl_cmd = ghdl_path + " --synth --no-formal --out=verilog " + file_name_str + " -e " + top + " > " + outfile;
std::string ghdl_cmd = ghdl_path + " --synth --no-formal --out=verilog " + filename_str + " -e " + top + " > " + outfile;
log("Running command: %s\n", ghdl_cmd.c_str());
if (system(ghdl_cmd.c_str()) != 0) {
verific_error_msg.clear();
log_cmd_error("Could not convert VHDL file %s to Verilog.\n", filename);
}

// Add file
file_names->Insert(i, outfile.c_str());
file_names->Insert(i, Strings::save(outfile.c_str()));
}

if (!veri_file::AnalyzeMultipleFiles(file_names, analysis_mode, work.c_str(), veri_file::MFCU)) {
Expand Down

0 comments on commit d655766

Please sign in to comment.