-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RAD-Sim Design Correctness Reporting #22
Changes from 3 commits
2b4f324
7b7f3f1
3442dd9
699993c
ec92d85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ | |
|
||
class RADSimDesignContext { | ||
private: | ||
int _design_result = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment about the name. I think you should also write a comment to explain what this variable is and what different values mean (0 is success and 1 is failure, maybe other outcomes can be added later if needed). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is design_result the number of failures? If so, better to rename it. If it can only be one or zero, better to make it a bool. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can imagine other exit codes than just 0 or 1 to report different failure reasons (e.g. simulation timeout after some number of cycles). Not sure though. That's why my earlier comment suggested renaming to _sim_exit_code and commenting what each code means. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought about this initially and had it as bool. But I came to the same conclusion as Andrew, yes - the exit code could be anything. Right now, we have it only as 0 or 1, thus there is a specific function to report a failure instead of a general function to set a result. It wouldn't be hard to add that functionality in the future if we wanted to report other exit codes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It is not the number of failures, it is just the exit code. However, it could be any signed integer, so it could represent something down the line. |
||
|
||
std::vector<sc_clock *> _noc_clks; | ||
std::vector<sc_clock *> _adapter_clks; | ||
std::vector<sc_clock *> _module_clks; | ||
|
@@ -96,6 +98,9 @@ class RADSimDesignContext { | |
void DumpDesignContext(); | ||
std::vector<std::vector<std::set<std::string>>> &GetNodeModuleNames(); | ||
uint64_t GetPortBaseAddress(std::string &port_name); | ||
|
||
int GetDesignResult(); | ||
void ReportDesignFailure(); | ||
}; | ||
|
||
extern RADSimDesignContext radsim_design; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the name _design_result might not be very intuitive. If this is meant to only report the success and failure of the simulation, we should name it something like _sim_exit_code (0 is success and 1 is failure).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, will change