generated from riscv-software-src/template-riscv-code
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 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,52 @@ | ||
// BPU test | ||
|
||
#include "sparta/sparta.hpp" | ||
#include "sparta/app/Simulation.hpp" | ||
#include "sparta/app/CommandLineSimulator.hpp" | ||
#include "sparta/utils/SpartaTester.hpp" | ||
|
||
#include <string> | ||
|
||
class BPUSim : public class sparta::app::Simulation | ||
{ | ||
public: | ||
BPUSim(sparta::Scheduler *sched) : sparta::app::Simulatiuon("BPUSim", sched) | ||
{} | ||
|
||
virtual ~ICacheSim(){ | ||
getRoot()->enterTeardown(); | ||
} | ||
|
||
private: | ||
void buildTree_() override { | ||
continue; | ||
} | ||
|
||
void configureTree_() override {}; | ||
|
||
void bindTree_() override { | ||
continue; | ||
} | ||
}; | ||
|
||
int main(int argc, char **argv) { | ||
std::string testname; | ||
|
||
sparta::app::CommandLineSimulator cls(USAGE, DEFAULTS); | ||
auto & app_opts = cls.getApplicationOptions(); | ||
app_opts.add_options() | ||
("testname", | ||
sparta::app::named_value<std::string>("TESTNAME", &testname)->default_value(""), | ||
"Provide a testname to run", | ||
"Test to run"); | ||
|
||
int err_code = 0; | ||
if(!cls.parse(argc, argv, err_code)){ | ||
sparta_assert(false, "Command line parsing failed"); // Any errors already printed to cerr | ||
} | ||
|
||
sparta::Scheduler sched; | ||
BPUSim sim(&sched); | ||
cls.populateSimulation(&sim); | ||
sparta::RootTreeNode* root = sim.getRoot(); | ||
} |