[gem5-dev] [S] Change in gem5/gem5[develop]: stdlib, configs: Migrate riscv-ubuntu-run example to Simulator

2022-04-12 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58790 )


 (

1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the  
submitted one.
 )Change subject: stdlib, configs: Migrate riscv-ubuntu-run example to  
Simulator

..

stdlib, configs: Migrate riscv-ubuntu-run example to Simulator

Change-Id: Ie08fcf46139871bc98b9bf783d0b4d9913eace3e
Signed-off-by: Hoa Nguyen 
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58790
Reviewed-by: Jason Lowe-Power 
Reviewed-by: Bobby Bruce 
Maintainer: Jason Lowe-Power 
Maintainer: Bobby Bruce 
Tested-by: kokoro 
---
M configs/example/gem5_library/riscv-ubuntu-run.py
1 file changed, 19 insertions(+), 29 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, but someone else must approve; Looks  
good to me, approved

  Bobby Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass




diff --git a/configs/example/gem5_library/riscv-ubuntu-run.py  
b/configs/example/gem5_library/riscv-ubuntu-run.py

index d54fa90..1c95d3f 100644
--- a/configs/example/gem5_library/riscv-ubuntu-run.py
+++ b/configs/example/gem5_library/riscv-ubuntu-run.py
@@ -53,6 +53,7 @@
 from gem5.isas import ISA
 from gem5.coherence_protocol import CoherenceProtocol
 from gem5.resources.resource import Resource
+from gem5.simulate.simulator import Simulator

 # This runs a check to ensure the gem5 binary is compiled for RISCV.

@@ -116,32 +117,5 @@

 root = Root(full_system=True, system=board)

-m5.instantiate()
-
-# We simulate the system till we encounter `m5_exit instruction  
encountered`.

-
-exit_event = m5.simulate()
-
-# We check whether the simulation ended with `m5_exit instruction  
encountered`

-
-if exit_event.getCause() == "m5_exit instruction encountered":
-# We acknowledge the user that the boot was successful.
-
-print("Successfully completed booting!")
-else:
-# `m5_exit instruction encountered` was never encountered. We exit the
-# program unsuccessfully.
-
-print("The startup was not completed successfully!",)
-print(
-"Exiting @ tick {} because {}."\
-.format(m5.curTick(), exit_event.getCause())
-)
-exit(-1)
-
-# We are done with the simulation. We exit the program now.
-
-print(
-"Exiting @ tick {} because {}."\
-.format(m5.curTick(), exit_event.getCause())
-)
+simulator = Simulator(board=board)
+simulator.run()

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58790
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie08fcf46139871bc98b9bf783d0b4d9913eace3e
Gerrit-Change-Number: 58790
Gerrit-PatchSet: 3
Gerrit-Owner: Hoa Nguyen 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Hoa Nguyen 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] [S] Change in gem5/gem5[develop]: stdlib, configs: Migrate riscv-ubuntu-run example to Simulator

2022-04-11 Thread Hoa Nguyen (Gerrit) via gem5-dev
Hoa Nguyen has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58790 )



Change subject: stdlib, configs: Migrate riscv-ubuntu-run example to  
Simulator

..

stdlib, configs: Migrate riscv-ubuntu-run example to Simulator

Change-Id: Ie08fcf46139871bc98b9bf783d0b4d9913eace3e
Signed-off-by: Hoa Nguyen 
---
M configs/example/gem5_library/riscv-ubuntu-run.py
1 file changed, 13 insertions(+), 29 deletions(-)



diff --git a/configs/example/gem5_library/riscv-ubuntu-run.py  
b/configs/example/gem5_library/riscv-ubuntu-run.py

index d54fa90..1c95d3f 100644
--- a/configs/example/gem5_library/riscv-ubuntu-run.py
+++ b/configs/example/gem5_library/riscv-ubuntu-run.py
@@ -53,6 +53,7 @@
 from gem5.isas import ISA
 from gem5.coherence_protocol import CoherenceProtocol
 from gem5.resources.resource import Resource
+from gem5.simulate.simulator import Simulator

 # This runs a check to ensure the gem5 binary is compiled for RISCV.

@@ -116,32 +117,5 @@

 root = Root(full_system=True, system=board)

-m5.instantiate()
-
-# We simulate the system till we encounter `m5_exit instruction  
encountered`.

-
-exit_event = m5.simulate()
-
-# We check whether the simulation ended with `m5_exit instruction  
encountered`

-
-if exit_event.getCause() == "m5_exit instruction encountered":
-# We acknowledge the user that the boot was successful.
-
-print("Successfully completed booting!")
-else:
-# `m5_exit instruction encountered` was never encountered. We exit the
-# program unsuccessfully.
-
-print("The startup was not completed successfully!",)
-print(
-"Exiting @ tick {} because {}."\
-.format(m5.curTick(), exit_event.getCause())
-)
-exit(-1)
-
-# We are done with the simulation. We exit the program now.
-
-print(
-"Exiting @ tick {} because {}."\
-.format(m5.curTick(), exit_event.getCause())
-)
+simulator = Simulator(board=board)
+simulator.run()

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58790
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie08fcf46139871bc98b9bf783d0b4d9913eace3e
Gerrit-Change-Number: 58790
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s