Skip to content

Commit

Permalink
sta support (#218)
Browse files Browse the repository at this point in the history
Co-authored-by: Alain Dargelas <[email protected]>
  • Loading branch information
alain-rs and alaindargelas authored Nov 12, 2022
1 parent 9a41f63 commit 3da0d59
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
30 changes: 30 additions & 0 deletions src/Compiler/CompilerRS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,36 @@ void FOEDAG::TclArgs_setRsSynthesisOptions(const std::string &argsStr) {
}
}

std::string CompilerRS::BaseStaCommand() {
std::string command = m_staExecutablePath.string();
return command;
}

std::string CompilerRS::BaseStaScript(std::string libFileName,
std::string netlistFileName,
std::string sdfFileName,
std::string sdcFileName) {
std::string script =
std::string("read_liberty ") + libFileName +
std::string("\n") + // add lib for test only, need to research on this
std::string("read_verilog ") + netlistFileName + std::string("\n") +
std::string("link_design ") +
ProjManager()->getDesignTopModule().toStdString() + std::string("\n") +
std::string("read_sdf ") + sdfFileName + std::string("\n") +
std::string("read_sdc ") + sdcFileName + std::string("\n") +
std::string("report_checks\n") +
std::string("report_clock_min_period\n") + std::string("report_wns\n") +
std::string("exit\n");
const std::string openStaFile =
(std::filesystem::path(ProjManager()->projectPath()) /
std::string(ProjManager()->projectName() + "_opensta.tcl"))
.string();
std::ofstream ofssta(openStaFile);
ofssta << script << "\n";
ofssta.close();
return openStaFile;
}

bool CompilerRS::TimingAnalysis() {
if (!ProjManager()->HasDesign()) {
ErrorMessage("No design specified");
Expand Down
6 changes: 5 additions & 1 deletion src/Compiler/CompilerRS.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ class CompilerRS : public CompilerOpenFPGA {

protected:
bool LicenseDevice(const std::string& deviceName);

virtual std::string BaseStaCommand();
virtual std::string BaseStaScript(std::string libFileName,
std::string netlistFileName,
std::string sdfFileName,
std::string sdcFileName);
SynthesisEffort m_synthEffort = SynthesisEffort::None;
SynthesisCarryInference m_synthCarry = SynthesisCarryInference::None;
SynthesisFsmEncoding m_synthFsm = SynthesisFsmEncoding::None;
Expand Down

0 comments on commit 3da0d59

Please sign in to comment.