-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#68174] Improve initialization of the examples
- Loading branch information
1 parent
f9b4139
commit d7c27ed
Showing
11 changed files
with
154 additions
and
91 deletions.
There are no files selected for viewing
13 changes: 3 additions & 10 deletions
13
.github/scripts/tests/uartlite_sleep_after_1000_iters.patch
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 |
---|---|---|
@@ -1,22 +1,15 @@ | ||
diff --git a/src/Plugins/CoSimulationPlugin/IntegrationLibrary/src/renode_bus.cpp b/src/Plugins/CoSimulationPlugin/IntegrationLibrary/src/renode_bus.cpp | ||
index 2e425a734..5519bbce7 100644 | ||
--- a/src/Plugins/CoSimulationPlugin/IntegrationLibrary/src/renode_bus.cpp | ||
+++ b/src/Plugins/CoSimulationPlugin/IntegrationLibrary/src/renode_bus.cpp | ||
@@ -179,6 +179,7 @@ void RenodeAgent::handleInterrupts(void) | ||
} | ||
} | ||
|
||
@@ -198,8 +198,11 @@ | ||
+#include <unistd.h> | ||
void RenodeAgent::simulate(int receiverPort, int senderPort, const char* address) | ||
void RenodeAgent::simulate() | ||
{ | ||
renodeAgent = this; | ||
@@ -188,7 +189,9 @@ void RenodeAgent::simulate(int receiverPort, int senderPort, const char* address | ||
Protocol* result; | ||
reset(); | ||
|
||
+ int iter = 0; | ||
while(channel->getIsConnected()) { | ||
while(communicationChannel->getIsConnected()) { | ||
+ if(++iter > 1000) sleep(600); | ||
result = receive(); | ||
handleRequest(result); | ||
delete result; |
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 |
---|---|---|
@@ -1,13 +1,8 @@ | ||
diff --git a/samples/uartlite/sim_main.cpp b/samples/uartlite/sim_main.cpp | ||
index f80e5b8..1e42fd3 100644 | ||
--- a/samples/uartlite/sim_main.cpp | ||
+++ b/samples/uartlite/sim_main.cpp | ||
@@ -84,7 +84,7 @@ int main(int argc, char **argv, char **env) { | ||
tfp->open("simx.vcd"); | ||
#endif | ||
RenodeAgent *uart = Init(); | ||
- uart->simulate(atoi(argv[1]), atoi(argv[2]), address); | ||
+ uart->simulate(atoi(argv[1]) + 5, atoi(argv[2]) + 5, address); | ||
top->final(); | ||
exit(0); | ||
} | ||
@@ -95,3 +95,3 @@ int main(int argc, char **argv, char **env) { | ||
RenodeAgent *uart = initAgent(); | ||
- uart->connect(atoi(argv[1]), atoi(argv[2]), address); | ||
+ uart->connect(atoi(argv[1]) + 5, atoi(argv[2]) + 5, address); | ||
uart->simulate(); |
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 |
---|---|---|
@@ -1,13 +1,8 @@ | ||
diff --git a/samples/uartlite/sim_main.cpp b/samples/uartlite/sim_main.cpp | ||
index f80e5b8..f07a0ff 100644 | ||
--- a/samples/uartlite/sim_main.cpp | ||
+++ b/samples/uartlite/sim_main.cpp | ||
@@ -84,7 +84,7 @@ int main(int argc, char **argv, char **env) { | ||
tfp->open("simx.vcd"); | ||
#endif | ||
RenodeAgent *uart = Init(); | ||
- uart->simulate(atoi(argv[1]), atoi(argv[2]), address); | ||
+ uart->simulate(atoi(argv[1]), atoi(argv[2]) + 5, address); | ||
top->final(); | ||
exit(0); | ||
} | ||
@@ -95,3 +95,3 @@ int main(int argc, char **argv, char **env) { | ||
RenodeAgent *uart = initAgent(); | ||
- uart->connect(atoi(argv[1]), atoi(argv[2]), address); | ||
+ uart->connect(atoi(argv[1]), atoi(argv[2]) + 5, address); | ||
uart->simulate(); |
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
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
Oops, something went wrong.