[gem5-dev] Change in gem5/gem5[develop]: cpu: Adding GUPSGen ClockedObject.

2021-10-13 Thread Mahyar Samani (Gerrit) via gem5-dev
Mahyar Samani has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/47439 )


Change subject: cpu: Adding GUPSGen ClockedObject.
..

cpu: Adding GUPSGen ClockedObject.

This patch adds the code base to implement GUPSGen which is a
ClockedObject that creates read/write requests to the memory
to update elements in an array. The choosing of elements in
the array follow a random distribution. Each element is read
from and return as GUPSGen implements a key-value store program.
Specifications are found in HPCC website from RandomAccess
benchmark. link below.
https://icl.cs.utk.edu/projectsfiles/hpcc/RandomAccess/

Change-Id: I5c07f230bee317fff2cceec04d15d0218e8ede9a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47439
Reviewed-by: Jason Lowe-Power 
Reviewed-by: Bobby R. Bruce 
Maintainer: Jason Lowe-Power 
Tested-by: kokoro 
---
A src/cpu/testers/traffic_gen/GUPSGen.py
A src/cpu/testers/traffic_gen/gups_gen.cc
A src/cpu/testers/traffic_gen/gups_gen.hh
M src/cpu/testers/traffic_gen/SConscript
4 files changed, 795 insertions(+), 0 deletions(-)

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

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




diff --git a/src/cpu/testers/traffic_gen/GUPSGen.py  
b/src/cpu/testers/traffic_gen/GUPSGen.py

new file mode 100644
index 000..dafc86d
--- /dev/null
+++ b/src/cpu/testers/traffic_gen/GUPSGen.py
@@ -0,0 +1,60 @@
+# Copyright (c) 2021 The Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+from m5.params import *
+from m5.proxy import *
+from m5.objects.ClockedObject import ClockedObject
+
+class GUPSGen(ClockedObject):
+"""
+This ClockedObject implements the RandomAccess benchmark specified by  
HPCC

+benchmarks in https://icl.utk.edu/projectsfiles/hpcc/RandomAccess.
+"""
+type = 'GUPSGen'
+cxx_header = "cpu/testers/traffic_gen/gups_gen.hh"
+cxx_class = "gem5::GUPSGen"
+
+system = Param.System(Parent.any, 'System this generator is a part of')
+
+port = RequestPort('Port that should be connected to other components')
+
+start_addr = Param.Addr(0, 'Start address for allocating update table,'
+' should be a multiple of block_size')
+
+mem_size = Param.MemorySize('Size for allocating update table, based  
on'

+' randomAccess benchmark specification, this'
+' should be equal to half of total system  
memory'

+' ,also should be a power of 2')
+
+update_limit = Param.Int(0, 'The number of updates to issue before the'
+' simulation is over')
+
+request_queue_size = Param.Int(1024, 'Maximum number of parallel'
+' outstanding requests')
+
+init_memory = Param.Bool(False, 'Whether or not to initialize the  
memory,'

+' it does not effect the performance')
diff --git a/src/cpu/testers/traffic_gen/SConscript  
b/src/cpu/testers/traffic_gen/SConscript

index 640d81a..a2670e7 100644
--- a/src/cpu/testers/traffic_gen/SConscript
+++ b/src/cpu/testers/traffic_gen/SConscript
@@ -43,6 +43,7 @@
 Source('dram_gen.cc')
 Source('dram_rot_gen.cc')
 Source('exit_gen.cc')
+Source('gups_gen.cc')
 Source('hybrid_gen.cc')
 Source('idle_gen.cc')
 Source('linear_gen.cc')
@@ 

[gem5-dev] Change in gem5/gem5[develop]: cpu: Adding GUPSGen ClockedObject.

2021-06-30 Thread Mahyar Samani (Gerrit) via gem5-dev
Mahyar Samani has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/47439 )



Change subject: cpu: Adding GUPSGen ClockedObject.
..

cpu: Adding GUPSGen ClockedObject.

This patch adds the code base to implement GUPSGen which is a
ClockedObject that creates read/write requests to the memory
to update elements in an array. The choosing of elements in
the array follow a random distribution. Each element is read
from and return as GUPSGen implements a key-value store program.
Specifications are found in HPCC website from RandomAccess
benchmark. link below.
https://icl.cs.utk.edu/projectsfiles/hpcc/RandomAccess/

Change-Id: I5c07f230bee317fff2cceec04d15d0218e8ede9a
---
A src/cpu/testers/traffic_gen/GUPSGen.py
M src/cpu/testers/traffic_gen/SConscript
A src/cpu/testers/traffic_gen/gups_gen.cc
A src/cpu/testers/traffic_gen/gups_gen.hh
4 files changed, 761 insertions(+), 0 deletions(-)



diff --git a/src/cpu/testers/traffic_gen/GUPSGen.py  
b/src/cpu/testers/traffic_gen/GUPSGen.py

new file mode 100644
index 000..9a1b7c3
--- /dev/null
+++ b/src/cpu/testers/traffic_gen/GUPSGen.py
@@ -0,0 +1,59 @@
+# Copyright (c) 2021 The Regents of the University of California.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met: redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer;
+# redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution;
+# neither the name of the copyright holders nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+from m5.params import *
+from m5.proxy import *
+from m5.objects.ClockedObject import ClockedObject
+
+class GUPSGen(ClockedObject):
+"""
+This ClockedObject implements the RandomAccess benchmark specified by  
HPCC

+benchmarks in https://icl.utk.edu/projectsfiles/hpcc/RandomAccess.
+"""
+type = 'GUPSGen'
+cxx_header = "cpu/testers/traffic_gen/gups_gen.hh"
+
+system = Param.System(Parent.any, 'System this generator is a part of')
+
+port = RequestPort('Port that should be connected to other components')
+
+start_addr = Param.Addr(0, 'Start address for allocating update table,'
+' should be a multiple of block_size')
+
+mem_size = Param.MemorySize('Size for allocating update table, based  
on'

+' randomAccess benchmark specification, this'
+' should be equal to half of total system  
memory'

+' ,also should be a power of 2')
+
+update_limit = Param.Int(0, 'The number of updates to issue before the'
+' simulation is over')
+
+request_queue_size = Param.Int(1024, 'Maximum number of parallel'
+' outstanding requests')
+
+init_memory = Param.Bool(False, 'Whether or not to initialize the  
memory,'

+' it does not effect the performance')
diff --git a/src/cpu/testers/traffic_gen/SConscript  
b/src/cpu/testers/traffic_gen/SConscript

index 640d81a..a2670e7 100644
--- a/src/cpu/testers/traffic_gen/SConscript
+++ b/src/cpu/testers/traffic_gen/SConscript
@@ -43,6 +43,7 @@
 Source('dram_gen.cc')
 Source('dram_rot_gen.cc')
 Source('exit_gen.cc')
+Source('gups_gen.cc')
 Source('hybrid_gen.cc')
 Source('idle_gen.cc')
 Source('linear_gen.cc')
@@ -54,6 +55,9 @@
 DebugFlag('TrafficGen')
 SimObject('BaseTrafficGen.py')

+DebugFlag('GUPSGen')
+SimObject('GUPSGen.py')
+
 if env['USE_PYTHON']:
 Source('pygen.cc', add_tags='python')
 SimObject('PyTrafficGen.py')
diff --git a/src/cpu/testers/traffic_gen/gups_gen.cc  
b/src/cpu/testers/traffic_gen/gups_gen.cc

new file mode 100644
index 000..4a47cf2
--- /dev/null
+++