[gem5-dev] Change in gem5/gem5[develop]: stdlib,mem-ruby: Use protocol-spec. names

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58440 )



Change subject: stdlib,mem-ruby: Use protocol-spec. names
..

stdlib,mem-ruby: Use protocol-spec. names

Update the standard library Ruby protocols to use the protocol-specific
class names instead of the deprecated general names.

Unfortunately, some code became duplicated between similar controllers.
I tried multiple inheritance, but it didn't work out for me. I think the
correct solution is to move some of the shared code down into the
generated python. That's out of the scope for these changes.

Change-Id: I3444bee3c2917dcbe92b600b85e60244129aad35
Signed-off-by: Jason Lowe-Power 
---
M src/python/SConscript
D  
src/python/gem5/components/cachehierarchies/ruby/caches/abstract_directory.py
D  
src/python/gem5/components/cachehierarchies/ruby/caches/abstract_dma_controller.py
D  
src/python/gem5/components/cachehierarchies/ruby/caches/abstract_l1_cache.py
D  
src/python/gem5/components/cachehierarchies/ruby/caches/abstract_l2_cache.py
M  
src/python/gem5/components/cachehierarchies/ruby/caches/mesi_two_level/directory.py
M  
src/python/gem5/components/cachehierarchies/ruby/caches/mesi_two_level/dma_controller.py
M  
src/python/gem5/components/cachehierarchies/ruby/caches/mesi_two_level/l1_cache.py
M  
src/python/gem5/components/cachehierarchies/ruby/caches/mesi_two_level/l2_cache.py
M  
src/python/gem5/components/cachehierarchies/ruby/caches/mi_example/directory.py
M  
src/python/gem5/components/cachehierarchies/ruby/caches/mi_example/dma_controller.py
M  
src/python/gem5/components/cachehierarchies/ruby/caches/mi_example/l1_cache.py

12 files changed, 160 insertions(+), 280 deletions(-)



diff --git a/src/python/SConscript b/src/python/SConscript
index bb069f5..30c0ec5 100644
--- a/src/python/SConscript
+++ b/src/python/SConscript
@@ -106,14 +106,6 @@
 'gem5/components/cachehierarchies/ruby/mi_example_cache_hierarchy.py')
 PySource('gem5.components.cachehierarchies.ruby.caches',
 'gem5/components/cachehierarchies/ruby/caches/__init__.py')
-PySource('gem5.components.cachehierarchies.ruby.caches',
-'gem5/components/cachehierarchies/ruby/caches/abstract_directory.py')
-PySource('gem5.components.cachehierarchies.ruby.caches',
-'gem5/components/cachehierarchies/ruby/caches/abstract_dma_controller.py')
-PySource('gem5.components.cachehierarchies.ruby.caches',
-'gem5/components/cachehierarchies/ruby/caches/abstract_l1_cache.py')
-PySource('gem5.components.cachehierarchies.ruby.caches',
-'gem5/components/cachehierarchies/ruby/caches/abstract_l2_cache.py')
 PySource('gem5.components.cachehierarchies.ruby.caches.mesi_two_level',
 'gem5/components/cachehierarchies/ruby/caches/mesi_two_level/__init__.py')
 PySource('gem5.components.cachehierarchies.ruby.caches.mesi_two_level',
diff --git  
a/src/python/gem5/components/cachehierarchies/ruby/caches/abstract_directory.py  
b/src/python/gem5/components/cachehierarchies/ruby/caches/abstract_directory.py

deleted file mode 100644
index e39a38c..000
---  
a/src/python/gem5/components/cachehierarchies/ruby/caches/abstract_directory.py

+++ /dev/null
@@ -1,51 +0,0 @@
-# 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 abc import abstractmethod
-
-from m5.objects import Directory_Controller
-
-
-class AbstractDirectory(Directory_Controller):
-
-_version 

[gem5-dev] Change in gem5/gem5[develop]: WIP: mem-ruby: Build gem5 binary with all protocols

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58443 )



Change subject: WIP: mem-ruby: Build gem5 binary with all protocols
..

WIP: mem-ruby: Build gem5 binary with all protocols

This changeset is hacky just to test out the build. It should not be
committed as-is. A better solution to the configuration is required
before committing as this increases the build time significantly.

Change-Id: I3187e0b884c185380bb23558f4b8e37432dd3bfb
Signed-off-by: Jason Lowe-Power 
---
M src/mem/ruby/protocol/SConscript
M src/mem/ruby/protocol/SConsopts
2 files changed, 18 insertions(+), 2 deletions(-)



diff --git a/src/mem/ruby/protocol/SConscript  
b/src/mem/ruby/protocol/SConscript

index 550dd73..bf0658f 100644
--- a/src/mem/ruby/protocol/SConscript
+++ b/src/mem/ruby/protocol/SConscript
@@ -116,7 +116,10 @@

 env.Append(BUILDERS={'SLICC' : slicc_builder})

-for protocol in [env['CONF']['PROTOCOL']]:
+if env['CONF']['BUILD_GPU']:
+env['ALL_PROTOCOLS'].append('GPU_VIPER')
+
+for protocol in env['ALL_PROTOCOLS']:
 if protocol == "None":
 continue
 protocol_dir = None
diff --git a/src/mem/ruby/protocol/SConsopts  
b/src/mem/ruby/protocol/SConsopts

index 2fcc57a..1009e22 100644
--- a/src/mem/ruby/protocol/SConsopts
+++ b/src/mem/ruby/protocol/SConsopts
@@ -31,7 +31,6 @@
 Import('*')

 main.Append(ALL_PROTOCOLS=[
-'GPU_VIPER',
 'MOESI_AMD_Base',
 'MESI_Two_Level',
 'MESI_Three_Level',

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58443
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: I3187e0b884c185380bb23558f4b8e37432dd3bfb
Gerrit-Change-Number: 58443
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power 
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

[gem5-dev] Change in gem5/gem5[develop]: configs,mem-ruby: Procotol-spec. names in CHI

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58439 )



Change subject: configs,mem-ruby: Procotol-spec. names in CHI
..

configs,mem-ruby: Procotol-spec. names in CHI

Use the protocol-specific controller names in CHI.

**Important**: This could change some scripts. As long as people use
CHI_config (likely), this shouldn't be a problem, but if you have a
different version of CHI_config.py locally, you will need to make the
following updates:

`Cache_Controller` -> `CHI_Cache_Controller`
`Memory_Controller` -> `CHI_Memory_Controller`

Website updates coming soon!

Change-Id: I7afdcede884ac5f9a9a76cc3d3dd35941e4e2faa
Signed-off-by: Jason Lowe-Power 
---
M configs/ruby/CHI_config.py
M src/python/gem5/components/cachehierarchies/chi/nodes/abstract_node.py
M src/python/gem5/components/cachehierarchies/chi/nodes/memory_controller.py
3 files changed, 35 insertions(+), 13 deletions(-)



diff --git a/configs/ruby/CHI_config.py b/configs/ruby/CHI_config.py
index b596efa..8eb7aed 100644
--- a/configs/ruby/CHI_config.py
+++ b/configs/ruby/CHI_config.py
@@ -173,7 +173,7 @@
 class OrderedTriggerMessageBuffer(TriggerMessageBuffer):
 ordered = True

-class CHI_Cache_Controller(Cache_Controller):
+class Base_CHI_Cache_Controller(CHI_Cache_Controller):
 '''
 Default parameters for a Cache controller
 The Cache_Controller can also be used as a DMA requester or as
@@ -181,8 +181,8 @@
 '''

 def __init__(self, ruby_system):
-super(CHI_Cache_Controller, self).__init__(
-version = Versions.getVersion(Cache_Controller),
+super(Base_CHI_Cache_Controller, self).__init__(
+version = Versions.getVersion(CHI_Cache_Controller),
 ruby_system = ruby_system,
 mandatoryQueue = MessageBuffer(),
 prefetchQueue = MessageBuffer(),
@@ -200,7 +200,7 @@
 # timeouts on unique lines when a store conditional fails
 self.sc_lock_enabled = False

-class CHI_L1Controller(CHI_Cache_Controller):
+class CHI_L1Controller(Base_CHI_Cache_Controller):
 '''
 Default parameters for a L1 Cache controller
 '''
@@ -232,7 +232,7 @@
 self.number_of_snoop_TBEs = 4
 self.unify_repl_TBEs = False

-class CHI_L2Controller(CHI_Cache_Controller):
+class CHI_L2Controller(Base_CHI_Cache_Controller):
 '''
 Default parameters for a L2 Cache controller
 '''
@@ -264,7 +264,7 @@
 self.number_of_snoop_TBEs = 16
 self.unify_repl_TBEs = False

-class CHI_HNFController(CHI_Cache_Controller):
+class CHI_HNFController(Base_CHI_Cache_Controller):
 '''
 Default parameters for a coherent home node (HNF) cache controller
 '''
@@ -297,7 +297,7 @@
 self.number_of_snoop_TBEs = 1 # should not receive any snoop
 self.unify_repl_TBEs = False

-class CHI_DMAController(CHI_Cache_Controller):
+class CHI_DMAController(Base_CHI_Cache_Controller):
 '''
 Default parameters for a DMA controller
 '''
@@ -545,8 +545,8 @@
 def __init__(self, ruby_system, parent):
 super(CHI_SNF_Base, self).__init__(ruby_system)

-self._cntrl = Memory_Controller(
-  version = Versions.getVersion(Memory_Controller),
+self._cntrl = CHI_Memory_Controller(
+  version =  
Versions.getVersion(CHI_Memory_Controller),

   ruby_system = ruby_system,
   triggerQueue = TriggerMessageBuffer(),
   responseFromMemory = MessageBuffer(),
diff --git  
a/src/python/gem5/components/cachehierarchies/chi/nodes/abstract_node.py  
b/src/python/gem5/components/cachehierarchies/chi/nodes/abstract_node.py

index e8797b6..285cd68 100644
--- a/src/python/gem5/components/cachehierarchies/chi/nodes/abstract_node.py
+++ b/src/python/gem5/components/cachehierarchies/chi/nodes/abstract_node.py
@@ -29,7 +29,7 @@
 from gem5.components.processors.cpu_types import CPUTypes
 from gem5.components.processors.abstract_core import AbstractCore

-from m5.objects import Cache_Controller, MessageBuffer, RubyNetwork
+from m5.objects import CHI_Cache_Controller, MessageBuffer, RubyNetwork

 import math

@@ -45,7 +45,7 @@
 class OrderedTriggerMessageBuffer(TriggerMessageBuffer):
 ordered = True

-class AbstractNode(Cache_Controller):
+class AbstractNode(CHI_Cache_Controller):
 """A node is the abstract unit for caches in the CHI protocol.

 You can extend the AbstractNode to create caches (private or shared)  
and
diff --git  
a/src/python/gem5/components/cachehierarchies/chi/nodes/memory_controller.py  
b/src/python/gem5/components/cachehierarchies/chi/nodes/memory_controller.py

index cf7d660..00fc225 100644
---  
a/src/python/gem5/components/cachehierarchies/chi/nodes/memory_controller.py
+++  

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Use function for backwards compat. ruby

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58442 )



Change subject: mem-ruby: Use function for backwards compat. ruby
..

mem-ruby: Use function for backwards compat. ruby

Instead of simply renaming the class, add a function which can be
evaluated at runtime to get the new class name. Note that this will
break any code which uses these classes as a base class. This should be
fixed in prior changes.

Change-Id: Id0ff17026d89322f8506ffb0d0fb75eb3725d111
Signed-off-by: Jason Lowe-Power 
---
M src/mem/slicc/symbols/StateMachine.py
1 file changed, 28 insertions(+), 7 deletions(-)



diff --git a/src/mem/slicc/symbols/StateMachine.py  
b/src/mem/slicc/symbols/StateMachine.py

index 2a0d6a4..2faf19a 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -268,20 +268,26 @@

 code.dedent()

-# Needed for backwards compatibility while there is only one  
protocol
-# compiled. When moving to multiple protocols in the gem5 binary,  
this

-# will need to change.
+# Needed for backwards compatibility. This redefines the function  
in
+# the same way for every protocol, but it uses the  
`getRubyProtocol`
+# function to dynamically select the machine to use. Having  
multiple
+# copies of this function is not ideal, but generating a  
separate .py

+# for MachineType was not feasible.
+# This will be removed in a later version of gem5.
 code('''

-from m5.defines import buildEnv
+from m5.defines import getRubyProtocol
+from m5 import objects
 from m5.util import warn

-if getRubyProtocol() == "${protocol}":
+def ${c_ident}(**args):
 warn(
-"${c_indent} is deprecated. Use %s_${c_indent} instead",
+"${c_ident} is deprecated. Use %s_${c_ident} instead",
 getRubyProtocol()
 )
-${c_ident} = ${py_ident}
+full_name = getRubyProtocol() + "_${c_ident}"
+cls = getattr(objects, full_name)
+return cls(**args)
 ''')

 code.write(path, '%s.py' % gen_filename)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58442
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: Id0ff17026d89322f8506ffb0d0fb75eb3725d111
Gerrit-Change-Number: 58442
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power 
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

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby,configs: Update AMD protos with new names

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58441 )



Change subject: mem-ruby,configs: Update AMD protos with new names
..

mem-ruby,configs: Update AMD protos with new names

Update the MOESI_AMD_Base and GPU_VIPER configuration files with the new
full protocol-specific names for the controllers instead of the
deprecated names.

Note: If you have any files which use the `CntrlBase` base, you will
likely need to update the class names that you are inheriting from.

Change-Id: I623fea7dd4cd151f7b15fe7cb43f8a4c45492d89
Signed-off-by: Jason Lowe-Power 
---
M configs/ruby/GPU_VIPER.py
M configs/ruby/MOESI_AMD_Base.py
2 files changed, 25 insertions(+), 8 deletions(-)



diff --git a/configs/ruby/GPU_VIPER.py b/configs/ruby/GPU_VIPER.py
index c73995f..9f341c5 100644
--- a/configs/ruby/GPU_VIPER.py
+++ b/configs/ruby/GPU_VIPER.py
@@ -85,7 +85,7 @@
 self.assoc = assoc
 self.replacement_policy = TreePLRURP()

-class CPCntrl(CorePair_Controller, CntrlBase):
+class CPCntrl(GPU_VIPER_CorePair_Controller, CntrlBase):

 def create(self, options, ruby_system, system):
 self.version = self.versionCount()
@@ -134,7 +134,7 @@
 self.resourceStalls = options.no_tcc_resource_stalls
 self.replacement_policy = TreePLRURP()

-class TCPCntrl(TCP_Controller, CntrlBase):
+class TCPCntrl(GPU_VIPER_TCP_Controller, CntrlBase):

 def create(self, options, ruby_system, system):
 self.version = self.versionCount()
@@ -264,7 +264,7 @@
 self.replacement_policy = TreePLRURP()


-class TCCCntrl(TCC_Controller, CntrlBase):
+class TCCCntrl(GPU_VIPER_TCC_Controller, CntrlBase):
 def create(self, options, ruby_system, system):
 self.version = self.versionCount()
 self.L2cache = TCC()
@@ -293,7 +293,7 @@
 self.resourceStalls = False
 self.replacement_policy = TreePLRURP()

-class L3Cntrl(L3Cache_Controller, CntrlBase):
+class L3Cntrl(GPU_VIPER_L3Cache_Controller, CntrlBase):
 def create(self, options, ruby_system, system):
 self.version = self.versionCount()
 self.L3cache = L3Cache()
@@ -314,7 +314,7 @@
 self.probeToL3 = probe_to_l3
 self.respToL3 = resp_to_l3

-class DirCntrl(Directory_Controller, CntrlBase):
+class DirCntrl(GPU_VIPER_Directory_Controller, CntrlBase):
 def create(self, options, dir_ranges, ruby_system, system):
 self.version = self.versionCount()

diff --git a/configs/ruby/MOESI_AMD_Base.py b/configs/ruby/MOESI_AMD_Base.py
index 12b8771..0833915 100644
--- a/configs/ruby/MOESI_AMD_Base.py
+++ b/configs/ruby/MOESI_AMD_Base.py
@@ -83,7 +83,7 @@
 self.assoc = options.l2_assoc
 self.replacement_policy = TreePLRURP()

-class CPCntrl(CorePair_Controller, CntrlBase):
+class CPCntrl(MOESI_AMD_Base_CorePair_Controller, CntrlBase):

 def create(self, options, ruby_system, system):
 self.version = self.versionCount()
@@ -139,7 +139,7 @@
 self.resourceStalls = options.no_resource_stalls
 self.replacement_policy = TreePLRURP()

-class L3Cntrl(L3Cache_Controller, CntrlBase):
+class L3Cntrl(MOESI_AMD_Base_L3Cache_Controller, CntrlBase):
 def create(self, options, ruby_system, system):
 self.version = self.versionCount()
 self.L3cache = L3Cache()
@@ -161,7 +161,7 @@
 self.probeToL3 = probe_to_l3
 self.respToL3 = resp_to_l3

-class DirCntrl(Directory_Controller, CntrlBase):
+class DirCntrl(MOESI_AMD_Base_Directory_Controller, CntrlBase):
 def create(self, options, dir_ranges, ruby_system, system):
 self.version = self.versionCount()


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58441
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: I623fea7dd4cd151f7b15fe7cb43f8a4c45492d89
Gerrit-Change-Number: 58441
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power 
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

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Use shared and per-protocol SLICC files

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58431 )



Change subject: mem-ruby: Use shared and per-protocol SLICC files
..

mem-ruby: Use shared and per-protocol SLICC files

This changes extends SLICC to understand two different kinds of slicc
files: files that are protocol-specific and files that are shared or
included between different protocols.

Each declaration in SLICC can now be shared or not. If it is shared,
then we can take a different action in the code generation (e.g., wrap
in a namespace).

*Developer facing change*
Removes the RubySlicc_interfaces.slicc file from the SLICC includes of
every protocol.

Changes required: If you have a custom protocol, you will need to remove
the line `include "RubySlicc_interfaces.slicc" from your .slicc file.

Change-Id: Ia6c2dafe2b8fe86749a13d17daa885bddd166855
Signed-off-by: Jason Lowe-Power 
---
M src/learning_gem5/part3/MSI.slicc
M src/mem/ruby/protocol/GPU_VIPER.slicc
M src/mem/ruby/protocol/Garnet_standalone.slicc
M src/mem/ruby/protocol/MESI_Three_Level.slicc
M src/mem/ruby/protocol/MESI_Three_Level_HTM.slicc
M src/mem/ruby/protocol/MESI_Two_Level.slicc
M src/mem/ruby/protocol/MI_example.slicc
M src/mem/ruby/protocol/MOESI_AMD_Base.slicc
M src/mem/ruby/protocol/MOESI_CMP_directory.slicc
M src/mem/ruby/protocol/MOESI_CMP_token.slicc
M src/mem/ruby/protocol/MOESI_hammer.slicc
M src/mem/ruby/protocol/RubySlicc_interfaces.slicc
M src/mem/ruby/protocol/SConscript
M src/mem/ruby/protocol/chi/CHI.slicc
M src/mem/slicc/ast/DeclAST.py
M src/mem/slicc/ast/DeclListAST.py
M src/mem/slicc/ast/EnumDeclAST.py
M src/mem/slicc/ast/StateDeclAST.py
M src/mem/slicc/ast/TypeDeclAST.py
M src/mem/slicc/main.py
M src/mem/slicc/parser.py
M src/mem/slicc/symbols/SymbolTable.py
M src/mem/slicc/symbols/Type.py
23 files changed, 104 insertions(+), 45 deletions(-)



diff --git a/src/learning_gem5/part3/MSI.slicc  
b/src/learning_gem5/part3/MSI.slicc

index c6fdc50..4c02fcb 100644
--- a/src/learning_gem5/part3/MSI.slicc
+++ b/src/learning_gem5/part3/MSI.slicc
@@ -1,5 +1,4 @@
 protocol "MSI";
-include "RubySlicc_interfaces.slicc";
 include "MSI-msg.sm";
 include "MSI-cache.sm";
 include "MSI-dir.sm";
diff --git a/src/mem/ruby/protocol/GPU_VIPER.slicc  
b/src/mem/ruby/protocol/GPU_VIPER.slicc

index 196058b..2a89d02 100644
--- a/src/mem/ruby/protocol/GPU_VIPER.slicc
+++ b/src/mem/ruby/protocol/GPU_VIPER.slicc
@@ -1,5 +1,4 @@
 protocol "GPU_VIPER";
-include "RubySlicc_interfaces.slicc";
 include "MOESI_AMD_Base-msg.sm";
 include "MOESI_AMD_Base-dir.sm";
 include "MOESI_AMD_Base-dma.sm";
diff --git a/src/mem/ruby/protocol/Garnet_standalone.slicc  
b/src/mem/ruby/protocol/Garnet_standalone.slicc

index e467f34..8c856af 100644
--- a/src/mem/ruby/protocol/Garnet_standalone.slicc
+++ b/src/mem/ruby/protocol/Garnet_standalone.slicc
@@ -1,5 +1,4 @@
 protocol "Garnet_standalone";
-include "RubySlicc_interfaces.slicc";
 include "Garnet_standalone-msg.sm";
 include "Garnet_standalone-cache.sm";
 include "Garnet_standalone-dir.sm";
diff --git a/src/mem/ruby/protocol/MESI_Three_Level.slicc  
b/src/mem/ruby/protocol/MESI_Three_Level.slicc

index a24b11c..d37b937 100644
--- a/src/mem/ruby/protocol/MESI_Three_Level.slicc
+++ b/src/mem/ruby/protocol/MESI_Three_Level.slicc
@@ -1,5 +1,4 @@
 protocol "MESI_Three_Level";
-include "RubySlicc_interfaces.slicc";
 include "MESI_Two_Level-msg.sm";
 include "MESI_Three_Level-msg.sm";
 include "MESI_Three_Level-L0cache.sm";
diff --git a/src/mem/ruby/protocol/MESI_Three_Level_HTM.slicc  
b/src/mem/ruby/protocol/MESI_Three_Level_HTM.slicc

index 4ec31b5..88afc2f 100644
--- a/src/mem/ruby/protocol/MESI_Three_Level_HTM.slicc
+++ b/src/mem/ruby/protocol/MESI_Three_Level_HTM.slicc
@@ -1,5 +1,4 @@
 protocol "MESI_Three_Level_HTM";
-include "RubySlicc_interfaces.slicc";
 include "MESI_Two_Level-msg.sm";
 include "MESI_Three_Level-msg.sm";
 include "MESI_Three_Level_HTM-L0cache.sm";
diff --git a/src/mem/ruby/protocol/MESI_Two_Level.slicc  
b/src/mem/ruby/protocol/MESI_Two_Level.slicc

index b5bf104..e0f6dda 100644
--- a/src/mem/ruby/protocol/MESI_Two_Level.slicc
+++ b/src/mem/ruby/protocol/MESI_Two_Level.slicc
@@ -1,5 +1,4 @@
 protocol "MESI_Two_Level";
-include "RubySlicc_interfaces.slicc";
 include "MESI_Two_Level-msg.sm";
 include "MESI_Two_Level-L1cache.sm";
 include "MESI_Two_Level-L2cache.sm";
diff --git a/src/mem/ruby/protocol/MI_example.slicc  
b/src/mem/ruby/protocol/MI_example.slicc

index 7061478..b3c1585 100644
--- a/src/mem/ruby/protocol/MI_example.slicc
+++ b/src/mem/ruby/protocol/MI_example.slicc
@@ -1,5 +1,4 @@
 protocol "MI_example";
-include "RubySlicc_interfaces.slicc";
 include "MI_example-msg.sm";
 include "MI_example-cache.sm";
 include "MI_example-dir.sm";
diff --git a/src/mem/ruby/protocol/MOESI_AMD_Base.slicc  
b/src/mem/ruby/protocol/MOESI_AMD_Base.slicc

index b381452..50aae8c 100644
--- 

[gem5-dev] Change in gem5/gem5[develop]: scons: Fix bug in error message

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58429 )



Change subject: scons: Fix bug in error message
..

scons: Fix bug in error message

The variable p doesn't exist in the context. Just remove the extra
print. Even without the specific variable printed the error message is
pretty helpful.

Change-Id: If681d686c228c1362b8cc46cb14a94d7302f3793
Signed-off-by: Jason Lowe-Power 
---
M build_tools/sim_object_param_struct_hh.py
1 file changed, 15 insertions(+), 1 deletion(-)



diff --git a/build_tools/sim_object_param_struct_hh.py  
b/build_tools/sim_object_param_struct_hh.py

index ff525ee..261ac9b 100644
--- a/build_tools/sim_object_param_struct_hh.py
+++ b/build_tools/sim_object_param_struct_hh.py
@@ -73,7 +73,7 @@
 try:
 ptypes = [p.ptype for p in params]
 except:
-print(sim_object, p, p.ptype_str)
+print(sim_object)
 print(params)
 raise


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58429
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: If681d686c228c1362b8cc46cb14a94d7302f3793
Gerrit-Change-Number: 58429
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power 
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

[gem5-dev] Change in gem5/gem5[develop]: python: Add function to get ruby protocol

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58430 )



Change subject: python: Add function to get ruby protocol
..

python: Add function to get ruby protocol

This changeset moves the auto-generated defines.py file to _defines and
replaces it with an explicit defines.py file in the m5 module. This
explicit module also includes a function to expose the ruby protocol.
This will make it easier to provide backwards compatibility and have a
"main" protocol as we add support for multiple protocols in a single
binary.

Change-Id: Id632d4af7d1e60f2c3ea0c492c0cba26c6d9af92
Signed-off-by: Jason Lowe-Power 
---
M src/SConscript
M src/python/SConscript
A src/python/m5/defines.py
3 files changed, 52 insertions(+), 2 deletions(-)



diff --git a/src/SConscript b/src/SConscript
index d55520b..f356f00 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -609,9 +609,9 @@
 code.write(target[0].abspath)

 # Generate a file with all of the compile options in it
-env.Command('python/m5/defines.py', ToValue(dict(build_env)),
+env.Command('python/m5/_defines.py', ToValue(dict(build_env)),
 MakeAction(makeDefinesPyFile, Transform("DEFINES", 0)))
-PySource('m5', 'python/m5/defines.py')
+PySource('m5', 'python/m5/_defines.py')

 # Generate a file that wraps the basic top level files
 gem5py_env.Command('python/m5/info.py',
diff --git a/src/python/SConscript b/src/python/SConscript
index 343a696..bb069f5 100644
--- a/src/python/SConscript
+++ b/src/python/SConscript
@@ -219,6 +219,7 @@
 PySource('m5', 'm5/SimObject.py')
 PySource('m5', 'm5/core.py')
 PySource('m5', 'm5/debug.py')
+PySource('m5', 'm5/defines.py')
 PySource('m5', 'm5/event.py')
 PySource('m5', 'm5/main.py')
 PySource('m5', 'm5/options.py')
diff --git a/src/python/m5/defines.py b/src/python/m5/defines.py
new file mode 100644
index 000..9c1c98d
--- /dev/null
+++ b/src/python/m5/defines.py
@@ -0,0 +1,32 @@
+# Copyright (c) 2022 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 ._defines import buildEnv
+
+def getRubyProtocol() -> str:
+return buildEnv["PROTOCOL"]
+
+__all__ = ["buildEnv", "getRubyProtocol"]

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58430
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: Id632d4af7d1e60f2c3ea0c492c0cba26c6d9af92
Gerrit-Change-Number: 58430
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power 
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

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Update HTML output to include protocol

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58437 )



Change subject: mem-ruby: Update HTML output to include protocol
..

mem-ruby: Update HTML output to include protocol

Move the html output to be in a subdirectory with the protocol name.

Change-Id: I1510d2d5a531cc6db74d10a0478c23bc8a836a26
Signed-off-by: Jason Lowe-Power 
---
M src/mem/slicc/symbols/SymbolTable.py
1 file changed, 16 insertions(+), 0 deletions(-)



diff --git a/src/mem/slicc/symbols/SymbolTable.py  
b/src/mem/slicc/symbols/SymbolTable.py

index be3147b..1b29b38 100644
--- a/src/mem/slicc/symbols/SymbolTable.py
+++ b/src/mem/slicc/symbols/SymbolTable.py
@@ -164,6 +164,10 @@
 def writeHTMLFiles(self, path):
 makeDir(path)

+# Append the protocol to the path and make that directory
+path = os.path.join(path, self.slicc.protocol)
+makeDir(path)
+
 machines = list(self.getAllType(StateMachine))
 if len(machines) > 1:
 name = "%s_table.html" % machines[0].ident

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58437
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: I1510d2d5a531cc6db74d10a0478c23bc8a836a26
Gerrit-Change-Number: 58437
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power 
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

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Move getNumControllers out of machines

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58435 )



Change subject: mem-ruby: Move getNumControllers out of machines
..

mem-ruby: Move getNumControllers out of machines

Move the getNumControllers function out of the protocol-specific
machine definitions (which are now in their own namespaces) to a
BaseMachine class that the protocol-specific machines inherit
from. This design was the simplest way to keep backwards compatibility.

The one caveat is that this design means that while you can compile
multiple protocols into one binary, you cannot use the same machine type
from different protocols in one simulation. This is the current
assumption, so it shouldn't change anything for users.

Change-Id: If9eeb78c24eb5076956b9f44fa04c7e6eb0f0dd4
Signed-off-by: Jason Lowe-Power 
---
M src/mem/slicc/symbols/StateMachine.py
M src/mem/slicc/symbols/Type.py
2 files changed, 44 insertions(+), 23 deletions(-)



diff --git a/src/mem/slicc/symbols/StateMachine.py  
b/src/mem/slicc/symbols/StateMachine.py

index 3ef6b5b..2a0d6a4 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -342,12 +342,11 @@

 extern std::stringstream ${ident}_transitionComment;

-class $c_ident : public AbstractController
+class $c_ident : public AbstractController, Base${ident}Machine
 {
   public:
 typedef ${py_ident}Params Params;
 $c_ident(const Params );
-static int getNumControllers();
 void init();

 MessageBuffer *getMandatoryQueue() const;
@@ -432,7 +431,6 @@

 static std::vector eventVec;
 static std::vector > transVec;
-static int m_num_controllers;

 // Internal functions
 ''')
@@ -596,7 +594,6 @@
 namespace ${protocol}
 {

-int $c_ident::m_num_controllers = 0;
 std::vector  $c_ident::eventVec;
 std::vector >  $c_ident::transVec;

@@ -1030,12 +1027,6 @@
 return m_counters[state][event];
 }

-int
-$c_ident::getNumControllers()
-{
-return m_num_controllers;
-}
-
 MessageBuffer*
 $c_ident::getMandatoryQueue() const
 {
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py
index 282f55a..2973046 100644
--- a/src/mem/slicc/symbols/Type.py
+++ b/src/mem/slicc/symbols/Type.py
@@ -583,6 +583,20 @@
 MachineID get${{enum.ident}}MachineID(NodeID RubyNode);
 ''')

+# Machine types are expected to be overridden by protocol-
+# specific classes.
+if self.isMachineType:
+code('''
+
+class Base${{enum.ident}}Machine {
+  protected:
+static int m_num_controllers;
+  public:
+static int getNumControllers() { return m_num_controllers; }
+};
+
+''')
+
 if self.isStateDecl:
 code('''

@@ -699,10 +713,6 @@
 ''')

 if self.isMachineType:
-for enum in self.enums.values():
-if enum.primary:
-code('#include "mem/ruby/protocol/${{protocol}}/'
-'${{enum.ident}}_Controller.hh"')
 code('#include "mem/ruby/common/MachineID.hh"')

 code('''
@@ -858,13 +868,9 @@
 code.indent()
 code('  case ${{self.c_ident}}_NUM:')
 for enum in reversed(list(self.enums.values())):
-# Check if there is a defined machine with this type
-if enum.primary:
-code('''
-base += ${{protocol}}::${{enum.ident}}_Controller::getNumControllers();
+code('''
+base += Base${{enum.ident}}Machine::getNumControllers();
 ''')
-else:
-code('base += 0;')
 code('[[fallthrough]];')
 code('  case ${{self.c_ident}}_${{enum.ident}}:')
 code('break;')
@@ -890,9 +896,8 @@
 # For each field
 for enum in self.enums.values():
 code('case ${{self.c_ident}}_${{enum.ident}}:')
-if enum.primary:
-code('''
-return ${{protocol}}::${{enum.ident}}_Controller::getNumControllers();
+code('''
+return Base${{enum.ident}}Machine::getNumControllers();
 ''')

 # total num
@@ -916,6 +921,11 @@
   return mach;
 }
 ''')
+if self.isMachineType:
+code('''
+
+int Base${{enum.ident}}Machine::m_num_controllers = 0;
+''')

 # For protocol-specific types, close the protocol namespace
 if not self.shared:

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58435
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: If9eeb78c24eb5076956b9f44fa04c7e6eb0f0dd4
Gerrit-Change-Number: 58435
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power 
Gerrit-MessageType: newchange
___

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Rename SLICC SimObjs with compatibility

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58434 )



Change subject: mem-ruby: Rename SLICC SimObjs with compatibility
..

mem-ruby: Rename SLICC SimObjs with compatibility

Rename all SLICC generated SimObjects to have the protocol in their
name. This will allow for two different protocols to have the same
machine names (e.g., L1Cache). For compatiblity, we check to see if the
current protocol that is built matches the SimObject's protocol and
export the backwards-compatible name.

Change-Id: I2f1b2a541778de5b6316348386927141485c19b6
Signed-off-by: Jason Lowe-Power 
---
M src/mem/ruby/protocol/SConscript
M src/mem/slicc/ast/MachineAST.py
M src/mem/slicc/symbols/StateMachine.py
3 files changed, 50 insertions(+), 8 deletions(-)



diff --git a/src/mem/ruby/protocol/SConscript  
b/src/mem/ruby/protocol/SConscript

index 62e3e10..162c0db 100644
--- a/src/mem/ruby/protocol/SConscript
+++ b/src/mem/ruby/protocol/SConscript
@@ -124,7 +124,7 @@
 elif s.endswith('.py'):
 filename = os.path.basename(s)
 # We currently only expect ${ident}_Controller.py to be generated,  
and

-# for it to contain a single SimObject with the same name.
+# for it to contain a single SimObject with the same name +  
protocol.

 assert(filename.endswith('_Controller.py'))
-SimObject(f, sim_objects=[os.path.splitext(filename)[0]])
+SimObject(f,  
sim_objects=[protocol+'_'+os.path.splitext(filename)[0]])


diff --git a/src/mem/slicc/ast/MachineAST.py  
b/src/mem/slicc/ast/MachineAST.py

index 4114f01..17116da 100644
--- a/src/mem/slicc/ast/MachineAST.py
+++ b/src/mem/slicc/ast/MachineAST.py
@@ -43,9 +43,15 @@
 def files(self, parent=None):
 import os
 file_prefix = os.path.join(self.slicc.protocol, self.ident)
+# Can't have multiple python simobject files with the same name
+# So, we have to prepend the protocol name to the .py file
+py_prefix = os.path.join(
+self.slicc.protocol,
+self.slicc.protocol + '_' + self.ident
+)
 s = set(('%s_Controller.cc' % file_prefix,
  '%s_Controller.hh' % file_prefix,
- '%s_Controller.py' % file_prefix,
+ '%s_Controller.py' % py_prefix,
  '%s_Transitions.cc' % file_prefix,
  '%s_Wakeup.cc' % file_prefix))

diff --git a/src/mem/slicc/symbols/StateMachine.py  
b/src/mem/slicc/symbols/StateMachine.py

index 2540b0d..3ef6b5b 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -236,7 +236,7 @@
 ident = self.ident

 protocol = self.symtab.slicc.protocol
-py_ident = "%s_Controller" % ident
+py_ident = f"{protocol}_{ident}_Controller"
 c_ident = "%s_Controller" % self.ident
 gen_filename = f"{protocol}/{py_ident}"

@@ -267,6 +267,23 @@
"in StateMachine.py",  
param.type_ast.type.c_ident)


 code.dedent()
+
+# Needed for backwards compatibility while there is only one  
protocol
+# compiled. When moving to multiple protocols in the gem5 binary,  
this

+# will need to change.
+code('''
+
+from m5.defines import buildEnv
+from m5.util import warn
+
+if getRubyProtocol() == "${protocol}":
+warn(
+"${c_indent} is deprecated. Use %s_${c_indent} instead",
+getRubyProtocol()
+)
+${c_ident} = ${py_ident}
+''')
+
 code.write(path, '%s.py' % gen_filename)


@@ -275,8 +292,11 @@
 code = self.symtab.codeFormatter()
 ident = self.ident
 c_ident = "%s_Controller" % self.ident
-header_string = self.symtab.slicc.protocol + '_' + self.ident
-gen_filename = f"{self.symtab.slicc.protocol}/{c_ident}"
+
+protocol = self.symtab.slicc.protocol
+header_string = protocol + '_' + self.ident
+gen_filename = f"{protocol}/{c_ident}"
+py_ident = f"{protocol}_{ident}_Controller"

 code('''
 // Created by slicc definition of Module "${{self.short}}"
@@ -292,7 +312,7 @@
 #include "mem/ruby/protocol/TransitionResult.hh"
 #include "mem/ruby/protocol/${protocol}/Types.hh"
 #include "mem/ruby/slicc_interface/AbstractController.hh"
-#include "params/$c_ident.hh"
+#include "params/$py_ident.hh"

 ''')

@@ -325,7 +345,7 @@
 class $c_ident : public AbstractController
 {
   public:
-typedef ${c_ident}Params Params;
+typedef ${py_ident}Params Params;
 $c_ident(const Params );
 static int getNumControllers();
 void init();

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58434
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: 

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Move protocol files to subdir

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58433 )



Change subject: mem-ruby: Move protocol files to subdir
..

mem-ruby: Move protocol files to subdir

Move all generated protocol-specific files to a subdirectory with the
protocol's name.

This change also updates SLICC to have separate variables for the
filename, c identifier and python identifier instead of just using
variations of the c identifier.

Change-Id: I62f69a4606b030ee23cb2d96493f3257a6923748
Signed-off-by: Jason Lowe-Power 
---
M src/mem/slicc/ast/EnumDeclAST.py
M src/mem/slicc/ast/MachineAST.py
M src/mem/slicc/ast/StateDeclAST.py
M src/mem/slicc/ast/TypeDeclAST.py
M src/mem/slicc/parser.py
M src/mem/slicc/symbols/StateMachine.py
M src/mem/slicc/symbols/SymbolTable.py
M src/mem/slicc/symbols/Type.py
8 files changed, 109 insertions(+), 51 deletions(-)



diff --git a/src/mem/slicc/ast/EnumDeclAST.py  
b/src/mem/slicc/ast/EnumDeclAST.py

index 5a3fd7a..3e71dc0 100644
--- a/src/mem/slicc/ast/EnumDeclAST.py
+++ b/src/mem/slicc/ast/EnumDeclAST.py
@@ -46,6 +46,8 @@
 ident = "%s_%s" % (parent, self.type_ast.ident)
 else:
 ident = self.type_ast.ident
+if not self.shared:
+ident = f"{self.slicc.protocol}/{ident}"
 s = set(("%s.hh" % ident, "%s.cc" % ident))
 return s

diff --git a/src/mem/slicc/ast/MachineAST.py  
b/src/mem/slicc/ast/MachineAST.py

index 7434d6b..4114f01 100644
--- a/src/mem/slicc/ast/MachineAST.py
+++ b/src/mem/slicc/ast/MachineAST.py
@@ -41,11 +41,13 @@
 return "[Machine: %r]" % self.ident

 def files(self, parent=None):
-s = set(('%s_Controller.cc' % self.ident,
- '%s_Controller.hh' % self.ident,
- '%s_Controller.py' % self.ident,
- '%s_Transitions.cc' % self.ident,
- '%s_Wakeup.cc' % self.ident))
+import os
+file_prefix = os.path.join(self.slicc.protocol, self.ident)
+s = set(('%s_Controller.cc' % file_prefix,
+ '%s_Controller.hh' % file_prefix,
+ '%s_Controller.py' % file_prefix,
+ '%s_Transitions.cc' % file_prefix,
+ '%s_Wakeup.cc' % file_prefix))

 s |= self.decls.files(self.ident)
 return s
diff --git a/src/mem/slicc/ast/StateDeclAST.py  
b/src/mem/slicc/ast/StateDeclAST.py

index 4100296..1fffaa1 100644
--- a/src/mem/slicc/ast/StateDeclAST.py
+++ b/src/mem/slicc/ast/StateDeclAST.py
@@ -45,6 +45,8 @@
 ident = "%s_%s" % (parent, self.type_ast.ident)
 else:
 ident = self.type_ast.ident
+if not self.shared:
+ident = f"{self.slicc.protocol}/{ident}"
 s = set(("%s.hh" % ident, "%s.cc" % ident))
 return s

diff --git a/src/mem/slicc/ast/TypeDeclAST.py  
b/src/mem/slicc/ast/TypeDeclAST.py

index 9748178..000d66e 100644
--- a/src/mem/slicc/ast/TypeDeclAST.py
+++ b/src/mem/slicc/ast/TypeDeclAST.py
@@ -46,6 +46,8 @@
 ident = "%s_%s" % (parent, self.type_ast.ident)
 else:
 ident = self.type_ast.ident
+if not self.shared:
+ident = f"{self.slicc.protocol}/{ident}"
 return set(("%s.hh" % ident, "%s.cc" % ident))

 def generate(self):
diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py
index e2b0a64..78a16bf 100644
--- a/src/mem/slicc/parser.py
+++ b/src/mem/slicc/parser.py
@@ -97,7 +97,7 @@
 self.symtab.writeHTMLFiles(html_path)

 def files(self):
-f = set(['Types.hh'])
+f = set([os.path.join(self.protocol, 'Types.hh')])

 f |= self.decl_list.files()

diff --git a/src/mem/slicc/symbols/StateMachine.py  
b/src/mem/slicc/symbols/StateMachine.py

index e220731..2540b0d 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -235,8 +235,10 @@
 code = self.symtab.codeFormatter()
 ident = self.ident

+protocol = self.symtab.slicc.protocol
 py_ident = "%s_Controller" % ident
 c_ident = "%s_Controller" % self.ident
+gen_filename = f"{protocol}/{py_ident}"

 code('''
 from m5.params import *
@@ -245,8 +247,8 @@

 class $py_ident(RubyController):
 type = '$py_ident'
-cxx_header = 'mem/ruby/protocol/${c_ident}.hh'
-cxx_class = 'gem5::ruby::$protocol::$py_ident'
+cxx_header = 'mem/ruby/protocol/${protocol}/${c_ident}.hh'
+cxx_class = 'gem5::ruby::$protocol::$c_ident'
 ''')
 code.indent()
 for param in self.config_parameters:
@@ -265,7 +267,7 @@
"in StateMachine.py",  
param.type_ast.type.c_ident)


 code.dedent()
-code.write(path, '%s.py' % py_ident)
+code.write(path, '%s.py' % gen_filename)


 def printControllerHH(self, path):
@@ -273,12 +275,14 @@
 code = self.symtab.codeFormatter()
 

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby,scons: Split SLICC generic and specific

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58436 )



Change subject: mem-ruby,scons: Split SLICC generic and specific
..

mem-ruby,scons: Split SLICC generic and specific

Update the SLICC generation to be able to generate the shared files and
protocol-specific files separately.

Update the SLICC SConscript to make a separate call to SLICC for the
shared files and the protocol-specific files.

Note: The Scons changes are a bit hacky. Improvements are welcome.

Change-Id: I516a1bbe7f82e57dc4145064170f10b31683b6cd
Signed-off-by: Jason Lowe-Power 
---
M src/mem/ruby/protocol/SConscript
M src/mem/slicc/ast/DeclListAST.py
M src/mem/slicc/main.py
M src/mem/slicc/parser.py
M src/mem/slicc/symbols/SymbolTable.py
5 files changed, 117 insertions(+), 34 deletions(-)



diff --git a/src/mem/ruby/protocol/SConscript  
b/src/mem/ruby/protocol/SConscript

index 162c0db..550dd73 100644
--- a/src/mem/ruby/protocol/SConscript
+++ b/src/mem/ruby/protocol/SConscript
@@ -66,15 +66,23 @@
 assert len(source) == 1
 filepath = source[0].srcnode().abspath

+if filepath.endswith('RubySlicc_interfaces.slicc'):
+# We're working on the shared files
+filepath = None
+shared_only = True
+else:
+shared_only = False
+
 slicc = SLICC(
 filepath,
  
[os.path.join(protocol_base.abspath, 'RubySlicc_interfaces.slicc')],

 protocol_base.abspath,
+shared_only=shared_only,
 verbose=False
 )
 slicc.process()
 slicc.writeCodeFiles(output_dir.abspath, slicc_includes)
-if env['CONF']['SLICC_HTML']:
+if env['CONF']['SLICC_HTML'] and not shared_only:
 slicc.writeHTMLFiles(html_dir.abspath)

 target.extend([output_dir.File(f) for f in sorted(slicc.files())])
@@ -83,35 +91,63 @@
 def slicc_action(target, source, env):
 assert len(source) == 1
 filepath = source[0].srcnode().abspath
+
+if filepath.endswith('RubySlicc_interfaces.slicc'):
+# We're working on the shared files
+filepath = None
+shared_only = True
+else:
+shared_only = False
+
 slicc = SLICC(
 filepath,
  
[os.path.join(protocol_base.abspath, 'RubySlicc_interfaces.slicc')],

 protocol_base.abspath,
+shared_only=shared_only,
 verbose=True
 )
 slicc.process()
 slicc.writeCodeFiles(output_dir.abspath, slicc_includes)
-if env['CONF']['SLICC_HTML']:
+if env['CONF']['SLICC_HTML'] and not shared_only:
 slicc.writeHTMLFiles(html_dir.abspath)

 slicc_builder = Builder(action=MakeAction(slicc_action,  
Transform("SLICC")),

 emitter=slicc_emitter)

-protocol = env['CONF']['PROTOCOL']
-protocol_dir = None
-for path in env['PROTOCOL_DIRS']:
-if os.path.exists(path.File("%s.slicc" % protocol).abspath):
-protocol_dir = Dir(path)
-break
-
-if not protocol_dir:
-raise ValueError("Could not find {}.slicc in PROTOCOL_DIRS".format(
-protocol))
-
-sources = [ protocol_dir.File("%s.slicc" % protocol) ]
-
 env.Append(BUILDERS={'SLICC' : slicc_builder})
-nodes = env.SLICC([], sources)
+
+for protocol in [env['CONF']['PROTOCOL']]:
+if protocol == "None":
+continue
+protocol_dir = None
+for path in env['PROTOCOL_DIRS']:
+if os.path.exists(path.File("%s.slicc" % protocol).abspath):
+protocol_dir = Dir(path)
+break
+
+if not protocol_dir:
+raise ValueError("Could not find {}.slicc in PROTOCOL_DIRS".format(
+protocol))
+
+nodes = env.SLICC([], [protocol_dir.File("%s.slicc" % protocol)])
+env.Depends(nodes, slicc_depends)
+
+append = {}
+if env['CLANG']:
+append['CCFLAGS'] = '-Wno-parentheses'
+for f in nodes:
+s = str(f)
+if s.endswith('.cc'):
+Source(f, append=append)
+elif s.endswith('.py'):
+filename = os.path.basename(s)
+# We currently only expect ${ident}_Controller.py to be  
generated,

+# and for it to contain a single SimObject with the same name +
+# protocol.
+assert(filename.endswith('_Controller.py'))
+SimObject(f, sim_objects=[os.path.splitext(filename)[0]])
+
+nodes = env.SLICC([], [protocol_base.File('RubySlicc_interfaces.slicc')])
 env.Depends(nodes, slicc_depends)

 append = {}
@@ -121,10 +157,3 @@
 s = str(f)
 if s.endswith('.cc'):
 Source(f, append=append)
-elif s.endswith('.py'):
-filename = os.path.basename(s)
-# We currently only expect ${ident}_Controller.py to be generated,  
and
-# for it to contain a single SimObject with the same name +  
protocol.

-assert(filename.endswith('_Controller.py'))
-SimObject(f,  
sim_objects=[protocol+'_'+os.path.splitext(filename)[0]])

-
diff --git 

[gem5-dev] Change in gem5/gem5[develop]: configs,mem-ruby: Protocol-spec. in learning gem5

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58438 )



Change subject: configs,mem-ruby: Protocol-spec. in learning gem5
..

configs,mem-ruby: Protocol-spec. in learning gem5

Use protocol-specific names in Learning gem5 configs. Now, we should no
longer use the generic names for the controllers (it's deprecated). This
updates Learning gem5.

Website changes coming soon. (Hopefull before I push this...)

Change-Id: I18fc5b8bb0fef7c3b8b5cea8de4f73fc0f66a1b3
Signed-off-by: Jason Lowe-Power 
---
M configs/learning_gem5/part3/msi_caches.py
M configs/learning_gem5/part3/ruby_caches_MI_example.py
2 files changed, 20 insertions(+), 4 deletions(-)



diff --git a/configs/learning_gem5/part3/msi_caches.py  
b/configs/learning_gem5/part3/msi_caches.py

index 957adf2..5abfff0 100644
--- a/configs/learning_gem5/part3/msi_caches.py
+++ b/configs/learning_gem5/part3/msi_caches.py
@@ -105,7 +105,7 @@
 self.sequencers[i].connectCpuPorts(cpu)


-class L1Cache(L1Cache_Controller):
+class L1Cache(MSI_L1Cache_Controller):

 _version = 0
 @classmethod
@@ -169,7 +169,7 @@
 self.responseFromDirOrSibling = MessageBuffer(ordered = True)
 self.responseFromDirOrSibling.in_port =  
ruby_system.network.out_port


-class DirController(Directory_Controller):
+class DirController(MSI_Directory_Controller):

 _version = 0
 @classmethod
diff --git a/configs/learning_gem5/part3/ruby_caches_MI_example.py  
b/configs/learning_gem5/part3/ruby_caches_MI_example.py

index b67e6b1..9e5f9cf 100644
--- a/configs/learning_gem5/part3/ruby_caches_MI_example.py
+++ b/configs/learning_gem5/part3/ruby_caches_MI_example.py
@@ -102,7 +102,7 @@
 for i,cpu in enumerate(cpus):
 self.sequencers[i].connectCpuPorts(cpu)

-class L1Cache(L1Cache_Controller):
+class L1Cache(MI_example_L1Cache_Controller):

 _version = 0
 @classmethod
@@ -157,7 +157,7 @@
 self.responseToCache = MessageBuffer(ordered = True)
 self.responseToCache.in_port = ruby_system.network.out_port

-class DirController(Directory_Controller):
+class DirController(MI_example_Directory_Controller):

 _version = 0
 @classmethod

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58438
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: I18fc5b8bb0fef7c3b8b5cea8de4f73fc0f66a1b3
Gerrit-Change-Number: 58438
Gerrit-PatchSet: 1
Gerrit-Owner: Jason Lowe-Power 
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

[gem5-dev] Change in gem5/gem5[develop]: mem-ruby: Use namespaces for protocol types

2022-03-30 Thread Jason Lowe-Power (Gerrit) via gem5-dev
Jason Lowe-Power has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58432 )



Change subject: mem-ruby: Use namespaces for protocol types
..

mem-ruby: Use namespaces for protocol types

Wrap all protocol-specific types in `namespace `. This will
facilitate compiling multiple protocols into one binary.

There is a one-time hack to the generated `MachineType.cc` file to use
the namespace for the protocol until we generalize the machine types.

Change-Id: I5947e8ac69afe6f7ed257d7c5980ad65e9338acf
Signed-off-by: Jason Lowe-Power 
---
M src/mem/slicc/symbols/StateMachine.py
M src/mem/slicc/symbols/Type.py
2 files changed, 127 insertions(+), 4 deletions(-)



diff --git a/src/mem/slicc/symbols/StateMachine.py  
b/src/mem/slicc/symbols/StateMachine.py

index a9f7373..e220731 100644
--- a/src/mem/slicc/symbols/StateMachine.py
+++ b/src/mem/slicc/symbols/StateMachine.py
@@ -246,7 +246,7 @@
 class $py_ident(RubyController):
 type = '$py_ident'
 cxx_header = 'mem/ruby/protocol/${c_ident}.hh'
-cxx_class = 'gem5::ruby::$py_ident'
+cxx_class = 'gem5::ruby::$protocol::$py_ident'
 ''')
 code.indent()
 for param in self.config_parameters:
@@ -306,6 +306,9 @@
 namespace ruby
 {

+namespace ${protocol}
+{
+
 extern std::stringstream ${ident}_transitionComment;

 class $c_ident : public AbstractController
@@ -463,6 +466,7 @@
 code('''
 };

+} // namespace ${protocol}
 } // namespace ruby
 } // namespace gem5

@@ -550,6 +554,9 @@
 namespace ruby
 {

+namespace ${protocol}
+{
+
 int $c_ident::m_num_controllers = 0;
 std::vector  $c_ident::eventVec;
 std::vector >  $c_ident::transVec;
@@ -827,7 +834,7 @@
 AbstractController::regStats();

 // For each type of controllers, one controller of that type is picked
-// to aggregate stats of all controllers of that type.
+// to aggregate stats of all controllers of that type.
 if (m_version == 0) {

 Profiler *profiler = params().ruby_system->getProfiler();
@@ -1221,6 +1228,7 @@
 return read;
 }

+} // namespace ${protocol}
 } // namespace ruby
 } // namespace gem5
 ''')
@@ -1282,6 +1290,9 @@
 namespace ruby
 {

+namespace ${protocol}
+{
+
 void
 ${ident}_Controller::wakeup()
 {
@@ -1357,6 +1368,7 @@
 }
 }

+} // namespace ${protocol}
 } // namespace ruby
 } // namespace gem5
 ''')
@@ -1395,6 +1407,9 @@
 namespace ruby
 {

+namespace ${protocol}
+{
+
 TransitionResult
 ${ident}_Controller::doTransition(${ident}_Event event,
 ''')
@@ -1623,6 +1638,7 @@
 return TransitionResult_Valid;
 }

+} // namespace ${protocol}
 } // namespace ruby
 } // namespace gem5
 ''')
diff --git a/src/mem/slicc/symbols/Type.py b/src/mem/slicc/symbols/Type.py
index a9c5303..bb8ff0c 100644
--- a/src/mem/slicc/symbols/Type.py
+++ b/src/mem/slicc/symbols/Type.py
@@ -228,6 +228,16 @@

 namespace ruby
 {
+''')
+# For protocol-specific types, wrap in the protocol namespace
+if not self.shared:
+code('''
+
+namespace ${{protocol}}
+{
+''')
+
+code('''

 $klass ${{self.c_ident}}$parent
 {
@@ -394,7 +404,15 @@
 out << ::std::flush;
 return out;
 }
+''')
+# For protocol-specific types, close the protocol namespace
+if not self.shared:
+code('''

+} // namespace ${{protocol}}
+''')
+
+code('''
 } // namespace ruby
 } // namespace gem5

@@ -418,6 +436,16 @@

 namespace ruby
 {
+''')
+# For protocol-specific types, wrap in the protocol namespace
+if not self.shared:
+code('''
+
+namespace ${{protocol}}
+{
+''')
+
+code('''

 /** \\brief Print the state of this object */
 void
@@ -446,6 +474,13 @@
 for item in self.methods:
 code(self.methods[item].generateCode())

+# For protocol-specific types, close the protocol namespace
+if not self.shared:
+code('''
+
+} // namespace ${{protocol}}
+''')
+
 code('''
 } // namespace ruby
 } // namespace gem5
@@ -480,6 +515,13 @@
 {

 ''')
+# For protocol-specific types, wrap in the protocol namespace
+if not self.shared:
+code('''
+
+namespace ${{protocol}}
+{
+''')

 if self.isMachineType:
 code('struct MachineID;')
@@ -545,7 +587,16 @@

 ::std::ostream&
 operator<<(::std::ostream& out, const ${{self.c_ident}}& obj);
+''')

+# For protocol-specific types, close the protocol namespace
+if not self.shared:
+code('''
+
+} // namespace ${{protocol}}
+''')
+
+code('''
 } // namespace ruby
 } // namespace gem5
 ''')
@@ -594,6 +645,16 @@

 namespace ruby
 {
+''')
+# For protocol-specific types, wrap in the protocol namespace
+if not self.shared:
+code('''
+
+namespace ${{protocol}}
+{
+''')
+
+code('''

 // Code to convert the current state to an access permission
 AccessPermission 

[gem5-dev] Change in gem5/gem5[develop]: scons: Allow sources and libs called multiple times

2022-03-30 Thread Yen-lin Lai (Gerrit) via gem5-dev
Yen-lin Lai has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58409 )



Change subject: scons: Allow sources and libs called multiple times
..

scons: Allow sources and libs called multiple times

In Python, "+=" operator for list acts more like append and list assign
doesn't make a copy. This will cause unexpected append to the orignal
list. Since we have multiple env to "declare", these functions will be
called multiple times and could wrongly append duplicated entries in
later calls.

Make a copy before appending the entries from filter to avoid this
problem.

Change-Id: I144d5054e4d93191ebc94b93291ff9a3f8a6c429
---
M src/SConscript
1 file changed, 21 insertions(+), 2 deletions(-)



diff --git a/src/SConscript b/src/SConscript
index d55520b..746d3f1 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -38,6 +38,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 import collections
+import copy
 import distutils.spawn
 import itertools
 import os
@@ -329,13 +330,13 @@
 self.dir = Dir('.')

 def sources(self, env):
-srcs = self.srcs
+srcs = copy.copy(self.srcs)
 for f in self.filters:
 srcs += Source.all.apply_filter(env, f)
 return srcs

 def libs(self, env):
-libs = self.sourceLibs
+libs = copy.copy(self.sourceLibs)
 for f in self.filters:
 libs += SourceLib.all.apply_filter(env, f)
 return libs

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58409
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: I144d5054e4d93191ebc94b93291ff9a3f8a6c429
Gerrit-Change-Number: 58409
Gerrit-PatchSet: 1
Gerrit-Owner: Yen-lin Lai 
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

[gem5-dev] Change in gem5/gem5[develop]: scons: Remove an error check from the ProtoBuf declare-er.

2022-03-30 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58349 )


Change subject: scons: Remove an error check from the ProtoBuf declare-er.
..

scons: Remove an error check from the ProtoBuf declare-er.

ProtoBuf files can (and should) be declared to SCons unconditionally,
but then also use a "protobuf" tag. This lets SCons still include them
conditionally when it gathers sources to build certain binaries without
having additional python logic in SConscripts, or manually interpreting
config state.

Change-Id: I9426d647bc2d6c9d7eee7dadba77f75ed83bcaad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/58349
Maintainer: Giacomo Travaglini 
Reviewed-by: Jason Lowe-Power 
Reviewed-by: Bobby Bruce 
Tested-by: kokoro 
---
M src/SConscript
1 file changed, 20 insertions(+), 5 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved
  Bobby Bruce: Looks good to me, approved
  Giacomo Travaglini: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/SConscript b/src/SConscript
index c1b00f0..d55520b 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -259,11 +259,6 @@

 def ProtoBuf(source, tags=None, add_tags=None):
 '''Add a Protocol Buffer to build'''
-
-if not env['HAVE_PROTOC'] or not env['CONF']['HAVE_PROTOBUF']:
-error('Got protobuf to build, but lacks support!')
-
-'''Specify the source file, and any tags'''
 Source(source, tags, add_tags,  
append={'CXXFLAGS': '-Wno-array-bounds'})


 env['PROTOC_GRPC'] = distutils.spawn.find_executable('grpc_cpp_plugin')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58349
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: I9426d647bc2d6c9d7eee7dadba77f75ed83bcaad
Gerrit-Change-Number: 58349
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Gabe Black 
Gerrit-Reviewer: Giacomo Travaglini 
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] Change in gem5/gem5[develop]: configs: Add option for mem type for GPUFS

2022-03-30 Thread Matthew Poremba (Gerrit) via gem5-dev
Matthew Poremba has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58390 )



Change subject: configs: Add option for mem type for GPUFS
..

configs: Add option for mem type for GPUFS

The user will likely want to be able to specify a different type of
memory for the GPU rather than using the same default for the CPU. Add
the option to do that.

Change-Id: I62c22f6283335c3ca3df355f8ecc4bbffa751a73
---
M configs/example/gpufs/runfs.py
M configs/ruby/GPU_VIPER.py
2 files changed, 17 insertions(+), 2 deletions(-)



diff --git a/configs/example/gpufs/runfs.py b/configs/example/gpufs/runfs.py
index fae985a..b198552 100644
--- a/configs/example/gpufs/runfs.py
+++ b/configs/example/gpufs/runfs.py
@@ -82,7 +82,9 @@
 "  size")
 parser.add_argument("--dgpu-num-dirs", type=int, default=1, help="Set "
 "the number of dGPU directories (memory  
controllers")

-
+parser.add_argument("--dgpu-mem-type", default="HBM_1000_4H_1x128",
+choices=ObjectList.mem_list.get_names(),
+help="type of memory to use")

 def runGpuFSSystem(args):
 '''
diff --git a/configs/ruby/GPU_VIPER.py b/configs/ruby/GPU_VIPER.py
index c73995f..dc99429 100644
--- a/configs/ruby/GPU_VIPER.py
+++ b/configs/ruby/GPU_VIPER.py
@@ -518,7 +518,7 @@
 dir_cntrl.responseFromMemory = MessageBuffer()

 # Create memory controllers too
-mem_type = ObjectList.mem_list.get(options.mem_type)
+mem_type = ObjectList.mem_list.get(options.dgpu_mem_type)
 dram_intf = MemConfig.create_mem_intf(mem_type, gpu_mem_range, i,
 int(math.log(options.dgpu_num_dirs, 2)),  
options.cacheline_size,

 xor_low_bit)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58390
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: I62c22f6283335c3ca3df355f8ecc4bbffa751a73
Gerrit-Change-Number: 58390
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew Poremba 
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

[gem5-dev] Re: Build failed in Jenkins: nightly #177

2022-03-30 Thread Jason Lowe-Power via gem5-dev
I'm not sure why this test failed. The build artifacts look successful.

However, there seems to be a bug in which tests are selected to run. We
seem to be running duplicate tests on the x86_64 host and calling them both
x86_64 and aarch64 tests.

Jason

On Tue, Mar 29, 2022 at 11:01 PM jenkins-no-reply--- via gem5-dev <
gem5-dev@gem5.org> wrote:

> See <
> https://jenkins.gem5.org/job/nightly/177/display/redirect?page=changes>
>
> Changes:
>
> [fcrh] mem: Add SharedMemoryServer
>
> [gabe.black] arch-arm: Override makeRead and makeWrite in the ISA
> description.
>
> [gabe.black] ext: Add a cont_choice keyword to kconfiglib.
>
> [gabe.black] scons: Put all config variables in an env['CONF'] sub-dict.
>
> [gabe.black] scons: Put internal build files in a gem5.build directory.
>
> [Bobby R. Bruce] tests: Remove accidentally included "exit 0" test code
>
> [matthew.poremba] configs,gpu-compute: Support fetch from system pages
>
> [matthew.poremba] dev-hsa: Properly mask HSA packet header bits
>
> [matthew.poremba] dev-hsa: Update QCntxt readIndex in HW scheduler write
>
> [gabe.black] arch: Split up src/dest register ID creation.
>
> [srikant.bharadwaj] configs: Update memory port name in Ruby
>
>
> --
> [...truncated 3.91 MB...]
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_getarsym.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_move.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_hash.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/libelf_ar_util.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_shdr.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_cap.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_rawfile.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_open.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_getident.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/libelf_xlate.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_update.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_checksum.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_rela.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_dyn.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_fill.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_errmsg.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_next.c -> .os
>  [SHCC] X86_MESI_Two_Level/ext/libelf/elf_shnum.c -> .os
>  [  AR]  -> X86_MESI_Two_Level/ext/softfloat/libsoftfloat.a
>  [  AR]  -> X86_MESI_Two_Level/ext/libelf/libelf.a
>  [  RANLIB]  -> X86_MESI_Two_Level/ext/libelf/libelf.a
>  [  RANLIB]  -> X86_MESI_Two_Level/ext/softfloat/libsoftfloat.a
>  [LINK]  -> X86_MESI_Two_Level/gem5.opt
> /usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching
> for libgcc_s.so.1
> /usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching
> for libgcc_s.so.1
> scons: done building targets.
> *** Summary of Warnings ***
> Warning: Deprecated namespaces are not supported by this compiler.
>  Please make sure to check the mailing list for deprecation
>  announcements.
> Warning: Deleting old variant variables file
> "/nobackup/jenkins/workspace/nightl
>  y/build/variables/X86_MESI_Two_Level"
> Building the following targets. This may take a while.
> /nobackup/jenkins/workspace/nightly/build/GCN3_X86/gem5.opt
> You may want to run with only a single ISA(--isa=), use --skip-build, or
> use 'rerun'.
> Logging call to command: scons -C /nobackup/jenkins/workspace/nightly -j
> 16 --ignore-style --no-compress-debug
> /nobackup/jenkins/workspace/nightly/build/GCN3_X86/gem5.opt
> scons: Entering directory `/nobackup/jenkins/workspace/nightly'
> scons: Reading SConscript files ...
> Mkdir("/nobackup/jenkins/workspace/nightly/build/GCN3_X86/gem5.build")
> Checking for linker -Wl,--as-needed support... (cached) yes
> Checking for compiler -Wno-free-nonheap-object support... (cached) yes
> Info: Using Python config: python3-config
> Checking for C header file Python.h... (cached) yes
> Checking Python version... (cached) 3.8.10
> Checking for accept(0,0,0) in C++ library None... (cached) yes
> Checking for zlibVersion() in C++ library z... (cached) yes
> Checking for C library tcmalloc... (cached) yes
> Building in /nobackup/jenkins/workspace/nightly/build/GCN3_X86
> Using saved variables file(s)
> /nobackup/jenkins/workspace/nightly/build/GCN3_X86/gem5.build/variables
> Checking for C header file fenv.h... (cached) yes
> Checking for C header file png.h... (cached) yes
> Checking for clock_nanosleep(0,0,NULL,NULL) in C library None... (cached)
> yes
> Checking for C header file valgrind/valgrind.h... (cached) no
> Warning: Deprecated namespaces are not supported by this compiler.
>  Please make sure to check the mailing list for deprecation
>  announcements.
> Checking for pkg-config package hdf5-serial... (cached) 

[gem5-dev] Change in gem5/gem5[develop]: mem: Add Request constructor for special memory command

2022-03-30 Thread Giacomo Travaglini (Gerrit) via gem5-dev
Giacomo Travaglini has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58357 )



Change subject: mem: Add Request constructor for special memory command
..

mem: Add Request constructor for special memory command

The new constructor doesn't require an address nor a
size. We are still setting them as valid as this is
what the memsys is expecting.

Change-Id: Id1b6f1032c1390210a216cd77c7dd0cec14e962f
Signed-off-by: Giacomo Travaglini 
---
M src/mem/request.hh
1 file changed, 27 insertions(+), 1 deletion(-)



diff --git a/src/mem/request.hh b/src/mem/request.hh
index 8b6527c..e3ef5bf 100644
--- a/src/mem/request.hh
+++ b/src/mem/request.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013,2017-2021 Arm Limited
+ * Copyright (c) 2012-2013,2017-2022 Arm Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -492,6 +492,18 @@
 _byteEnable = std::vector(size, true);
 }

+/**
+ * Constructor for memory commands requests, with unspecified
+ * addr and size.
+ */
+Request(Flags flags, RequestorID id) :
+_requestorId(id), _time(curTick())
+{
+_flags.set(flags);
+privateFlags.set(VALID_PADDR|VALID_SIZE);
+assert(isTlbiCmd() || isHTMCmd());
+}
+
 Request(Addr vaddr, unsigned size, Flags flags,
 RequestorID id, Addr pc, ContextID cid,
 AtomicOpFunctorPtr atomic_op=nullptr)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58357
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: Id1b6f1032c1390210a216cd77c7dd0cec14e962f
Gerrit-Change-Number: 58357
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini 
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

[gem5-dev] Change in gem5/gem5[develop]: scons: fix build failed caused by Non-ASCII directory path

2022-03-30 Thread Luming Wang (Gerrit) via gem5-dev
Luming Wang has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58369 )



Change subject: scons: fix build failed caused by Non-ASCII directory path
..

scons: fix build failed caused by Non-ASCII directory path

This path fix build failed when gem5's path contains Non-ASCII
characters.

build_tools/marshal.py embed "abspath" and "modpath" into the
generated c++ file. However, if either of them contains Non-ASCII
characters, marshal.py will throw an exception.

This can be fixed if we set a suitable $LANG for gem5py. For
example, we can simply set $LANG=en_US.UTF-8 in src/SConscript
to fix this.

This patch fixes this bug by passing the host's $LANG environment
variable to gem5py. Because for users who may use Non-ASCII
characters, their $LANG is generally set to their native language
(e.g. zh_CN.UTF-8, en_US.UTF-8, etc.), which contains Non-ASCII
characters. Also, it is more reasonable to use the host $LANG than
to directly hard-code the $LANG used by gem5py into a language
that supports non-ASCII characters.

Change-Id: Ia0343cbd6995af3a9e43bf217ad3f186d5633fed
---
M src/SConscript
1 file changed, 29 insertions(+), 0 deletions(-)



diff --git a/src/SConscript b/src/SConscript
index c1b00f0..b760dfe 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -87,6 +87,7 @@
 gem5py_m5 = gem5py_env.File('gem5py_m5')
 gem5py_env['GEM5PY'] = gem5py
 gem5py_env['GEM5PY_M5'] = gem5py_m5
+gem5py_env['ENV']['LANG'] = os.environ.get('LANG', 'en_US.UTF-8')
 gem5py_env['OBJSUFFIX'] = '.pyo'
 # Inject build_tools into PYTHONPATH for when we run gem5py.
 pythonpath = gem5py_env['ENV'].get('PYTHONPATH', '').split(':')

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58369
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: Ia0343cbd6995af3a9e43bf217ad3f186d5633fed
Gerrit-Change-Number: 58369
Gerrit-PatchSet: 1
Gerrit-Owner: Luming Wang 
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

[gem5-dev] Change in gem5/gem5[develop]: scons: Stop the fast model project file parser from writing files.

2022-03-30 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58353 )



Change subject: scons: Stop the fast model project file parser from writing  
files.

..

scons: Stop the fast model project file parser from writing files.

PLY tries to write these little files into the SCons installation
directory, which it shouldn't even if it was allowed to. This avoids
a bunch of annoying messages about not having enough permission.

Change-Id: Ifd4eda9dd9f8518b3fd075e8a46de1b6c12c2127
---
M src/arch/arm/fastmodel/SConscript
1 file changed, 25 insertions(+), 0 deletions(-)



diff --git a/src/arch/arm/fastmodel/SConscript  
b/src/arch/arm/fastmodel/SConscript

index a8734cd..884f970 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -36,6 +36,7 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 from itertools import cycle
+import logging
 import shlex

 Import('*')
@@ -147,6 +148,17 @@
 SourceLib('rt')

 class ProjectFileParser(Grammar):
+def __init__(self):
+self.log = logging.getLogger()
+
+self.yacc_kwargs['write_tables'] = False
+
+self.yacc_kwargs['debuglog'] = self.log
+self.yacc_kwargs['errorlog'] = self.log
+
+self.lex_kwargs['debuglog'] = self.log
+self.lex_kwargs['errorlog'] = self.log
+
 class Param(object):
 def __init__(self, is_object):
 self.is_object = is_object

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58353
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: Ifd4eda9dd9f8518b3fd075e8a46de1b6c12c2127
Gerrit-Change-Number: 58353
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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

[gem5-dev] Change in gem5/gem5[develop]: scons: Add a tag for arm fastmodel and use it.

2022-03-30 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58356 )



Change subject: scons: Add a tag for arm fastmodel and use it.
..

scons: Add a tag for arm fastmodel and use it.

This avoids some python logic in the SConscript files, and explicit
references to the configuration system.

Change-Id: If6ee61bb8c23606859e60323b8ca2c5254dbdecc
---
M src/arch/arm/fastmodel/CortexA76/SConscript
M src/arch/arm/fastmodel/CortexR52/SConscript
M src/arch/arm/fastmodel/GIC/SConscript
M src/arch/arm/fastmodel/PL330_DMAC/SConscript
M src/arch/arm/fastmodel/SConscript
M src/arch/arm/fastmodel/iris/SConscript
M src/arch/arm/fastmodel/reset_controller/SConscript
7 files changed, 52 insertions(+), 53 deletions(-)



diff --git a/src/arch/arm/fastmodel/CortexA76/SConscript  
b/src/arch/arm/fastmodel/CortexA76/SConscript

index 7b18318..f3c6606 100644
--- a/src/arch/arm/fastmodel/CortexA76/SConscript
+++ b/src/arch/arm/fastmodel/CortexA76/SConscript
@@ -25,9 +25,6 @@

 Import('*')

-if not env['CONF']['USE_ARM_FASTMODEL']:
-Return()
-
 protocol_dir = Dir('..').Dir('protocol')

 for name in ('x1', 'x2', 'x3', 'x4'):
@@ -39,7 +36,8 @@

 SimObject('FastModelCortexA76.py', sim_objects=[
 'FastModelCortexA76', 'FastModelCortexA76Cluster'] +
-[f'FastModelScxEvsCortexA76x{num}' for num in (1, 2, 3, 4)])
-Source('cortex_a76.cc')
-Source('evs.cc')
-Source('thread_context.cc')
+[f'FastModelScxEvsCortexA76x{num}' for num in (1, 2, 3, 4)],
+tags='arm fastmodel')
+Source('cortex_a76.cc', tags='arm fastmodel')
+Source('evs.cc', tags='arm fastmodel')
+Source('thread_context.cc', tags='arm fastmodel')
diff --git a/src/arch/arm/fastmodel/CortexR52/SConscript  
b/src/arch/arm/fastmodel/CortexR52/SConscript

index a1d308b..bf3df74 100644
--- a/src/arch/arm/fastmodel/CortexR52/SConscript
+++ b/src/arch/arm/fastmodel/CortexR52/SConscript
@@ -25,9 +25,6 @@

 Import('*')

-if not env['CONF']['USE_ARM_FASTMODEL']:
-Return()
-
 protocol_dir = Dir('..').Dir('protocol')

 for name in ('x1', 'x2', 'x3', 'x4'):
@@ -40,7 +37,8 @@

 SimObject('FastModelCortexR52.py', sim_objects=[
 'FastModelCortexR52', 'FastModelCortexR52Cluster'] +
-[f'FastModelScxEvsCortexR52x{num}' for num in (1, 2, 3, 4)])
-Source('cortex_r52.cc')
-Source('evs.cc')
-Source('thread_context.cc')
+[f'FastModelScxEvsCortexR52x{num}' for num in (1, 2, 3, 4)],
+tags='arm fastmodel')
+Source('cortex_r52.cc', tags='arm fastmodel')
+Source('evs.cc', tags='arm fastmodel')
+Source('thread_context.cc', tags='arm fastmodel')
diff --git a/src/arch/arm/fastmodel/GIC/SConscript  
b/src/arch/arm/fastmodel/GIC/SConscript

index cff18e5..c56ddd5 100644
--- a/src/arch/arm/fastmodel/GIC/SConscript
+++ b/src/arch/arm/fastmodel/GIC/SConscript
@@ -25,13 +25,11 @@

 Import('*')

-if not env['CONF']['USE_ARM_FASTMODEL']:
-Return()
-
 protocol_dir = Dir('..').Dir('protocol')

 ArmFastModelComponent(File('GIC.sgproj'), File('GIC.lisa'),
   protocol_dir.File('SignalInterruptProtocol.lisa')
   ).prepare_env(env)
-SimObject('FastModelGIC.py',  
sim_objects=['SCFastModelGIC', 'FastModelGIC'])

-Source('gic.cc')
+SimObject('FastModelGIC.py',  
sim_objects=['SCFastModelGIC', 'FastModelGIC'],

+tags='arm fastmodel')
+Source('gic.cc', tags='arm fastmodel')
diff --git a/src/arch/arm/fastmodel/PL330_DMAC/SConscript  
b/src/arch/arm/fastmodel/PL330_DMAC/SConscript

index 8527133..e93b45c 100644
--- a/src/arch/arm/fastmodel/PL330_DMAC/SConscript
+++ b/src/arch/arm/fastmodel/PL330_DMAC/SConscript
@@ -25,13 +25,11 @@

 Import('*')

-if not env['CONF']['USE_ARM_FASTMODEL']:
-Return()
-
 protocol_dir = Dir('..').Dir('protocol')

 ArmFastModelComponent(File('PL330.sgproj'), File('PL330.lisa'),
   protocol_dir.File('SignalInterruptProtocol.lisa')
   ).prepare_env(env)
-SimObject('FastModelPL330.py', sim_objects=['FastModelPL330'])
-Source('pl330.cc')
+SimObject('FastModelPL330.py', sim_objects=['FastModelPL330'],
+tags='arm fastmodel')
+Source('pl330.cc', tags='arm fastmodel')
diff --git a/src/arch/arm/fastmodel/SConscript  
b/src/arch/arm/fastmodel/SConscript

index b176dbf..7f04e12 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -48,13 +48,11 @@
 import os.path

 if env['CONF']['USE_ARM_FASTMODEL']:
-if not env['CONF']['USE_SYSTEMC']:
+if env['CONF']['USE_SYSTEMC']:
+env.TagImplies('arm fastmodel', 'arm isa')
+else:
 warning('ARM Fast Models require systemc support')
 env['CONF']['USE_ARM_FASTMODEL'] = False
-Return()
-
-if not env['CONF']['USE_ARM_FASTMODEL']:
-Return()


 systemc_home = Dir('#/src/systemc/ext/systemc_home')
@@ -144,11 +142,11 @@
 'IrisSupport',
 )
 for lib in fm_static_libs:
-SourceLib(staticify(env, lib))
+SourceLib(staticify(env, lib), tags='arm 

[gem5-dev] Change in gem5/gem5[develop]: scons: Get rid of an unused fast model variable.

2022-03-30 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58351 )



Change subject: scons: Get rid of an unused fast model variable.
..

scons: Get rid of an unused fast model variable.

This held the location of the license file, assuming it actually was a
license file and not a license server URL. If this variable was unset
because the fast model configuration parameters hadn't been set, then
the "File" would resolve to the local directory, and SCons would get
upset that you'd called the same path a directory and a file.

We can avoid this problem by just getting rid of this variable, since
it isn't used anyway.

Change-Id: I2ccda90b85f2c83c73816967d145e6bf45733f89
---
M src/arch/arm/fastmodel/SConscript
1 file changed, 18 insertions(+), 2 deletions(-)



diff --git a/src/arch/arm/fastmodel/SConscript  
b/src/arch/arm/fastmodel/SConscript

index cbb2c15..a7f6e17 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -74,8 +74,6 @@

 pvlib_home = Dir(pvlib_home)
 maxcore_home = Dir(maxcore_home)
-armlmd_license_file = File(armlmd_license_file)
-

 pvlib_flavor = env['CONF']['PVLIB_FLAVOR']
 pvlib_lib_dir = pvlib_home.Dir('lib').Dir(pvlib_flavor)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58351
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: I2ccda90b85f2c83c73816967d145e6bf45733f89
Gerrit-Change-Number: 58351
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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

[gem5-dev] Change in gem5/gem5[develop]: scons: Tone down a fast model error into a warning.

2022-03-30 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58352 )



Change subject: scons: Tone down a fast model error into a warning.
..

scons: Tone down a fast model error into a warning.

If a fast model static library can't be found, we should treat that as
a warning instead of an error, and pass back the original library name
so that it can at least be added and potentially come from somewhere
else.

In practice, this is important because gem5 will be configured by SCons
indirectly in the future, using kconfig based tools that SCons runs on
the user's behalf. If SCons is misconfigured or not configured, this
error can trip, preventing those tools from starting. That creates a
catch 22, since you'd need SCons to fix the config, and SCons can't
run because of the config.

We can avoid that problem by making SCons more lenient, so that it can
still run even if it doesn't find static libraries where it might have
expected to.

Change-Id: Iadfd823b61fe96b937c2650250487d290492f265
---
M src/arch/arm/fastmodel/SConscript
1 file changed, 27 insertions(+), 1 deletion(-)



diff --git a/src/arch/arm/fastmodel/SConscript  
b/src/arch/arm/fastmodel/SConscript

index a7f6e17..a8734cd 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -102,7 +102,8 @@
 full_name = Dir(path).File(static_name).get_abspath()
 if os.path.isfile(full_name):
 return File(full_name)
-error("Failed to find FM static lib: " + name)
+warning("Failed to find FM static lib: " + name)
+return name

 # Adjust the build environment to support building in Fast Models.


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58352
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: Iadfd823b61fe96b937c2650250487d290492f265
Gerrit-Change-Number: 58352
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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

[gem5-dev] Change in gem5/gem5[develop]: scons: Only warn about not finding fast model libs if it's enabled.

2022-03-30 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58355 )



Change subject: scons: Only warn about not finding fast model libs if it's  
enabled.

..

scons: Only warn about not finding fast model libs if it's enabled.

These warnings could be confusing and aren't useful if it's not.

Change-Id: Ie660f639a3d8ee3406153ceb771b1ba5d0df9225
---
M src/arch/arm/fastmodel/SConscript
1 file changed, 13 insertions(+), 1 deletion(-)



diff --git a/src/arch/arm/fastmodel/SConscript  
b/src/arch/arm/fastmodel/SConscript

index 5226a78..b176dbf 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -105,7 +105,8 @@
 full_name = Dir(path).File(static_name).get_abspath()
 if os.path.isfile(full_name):
 return File(full_name)
-warning("Failed to find FM static lib: " + name)
+if env['CONF']['USE_ARM_FASTMODEL']:
+warning("Failed to find FM static lib: " + name)
 return name

 # Adjust the build environment to support building in Fast Models.

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58355
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: Ie660f639a3d8ee3406153ceb771b1ba5d0df9225
Gerrit-Change-Number: 58355
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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

[gem5-dev] Change in gem5/gem5[develop]: scons: Rework the fastmodel extract_var helper.

2022-03-30 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58354 )



Change subject: scons: Rework the fastmodel extract_var helper.
..

scons: Rework the fastmodel extract_var helper.

This helper extracts config variables and sets them up for use in
fast model tools. Rework this function for two purposes. First, ensure
that the ['CONF'] subdict is used consistently. It was used in one spot
in that function, but not anywhere else. Avoid those mistakes by
accessing the configuration dict only once, and then reusing the value.

Second, only print the values of those variables if they aren't empty.
That avoids extra log output for values which aren't set up and aren't
being used, while still exposing those values if they are set up. This
will print them even if they aren't being actively used, but are set up
and could be with other changes in the config.

Change-Id: Ia3ea76e6cb6b3347fd082112a1eaa8d594e06ca2
---
M src/arch/arm/fastmodel/SConscript
1 file changed, 28 insertions(+), 5 deletions(-)



diff --git a/src/arch/arm/fastmodel/SConscript  
b/src/arch/arm/fastmodel/SConscript

index 884f970..5226a78 100644
--- a/src/arch/arm/fastmodel/SConscript
+++ b/src/arch/arm/fastmodel/SConscript
@@ -61,13 +61,15 @@
 env['ENV']['SYSTEMC_HOME'] = systemc_home.abspath

 def extract_var(name):
-if name not in env['CONF']:
-error('Error: %s is not set' % name)
-print('%s = %s' % (name, env[name]))
+val = env['CONF'].get(name, None)
+if val is None:
+error('%s is not set' % name)
+if val:
+print('%s = %s' % (name, env['CONF'][name]))
 # Make sure the value of this variable shows up as an environment  
variable

 # for commands scons runs.
-env['ENV'][name] = env[name]
-return env[name]
+env['ENV'][name] = val
+return val

 pvlib_home, maxcore_home, armlmd_license_file = \
 list(map(extract_var, ('PVLIB_HOME', 'MAXCORE_HOME',

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58354
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: Ia3ea76e6cb6b3347fd082112a1eaa8d594e06ca2
Gerrit-Change-Number: 58354
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
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

[gem5-dev] Change in gem5/gem5[develop]: scons: Add a priority field to the SourceLib construct.

2022-03-30 Thread Gabe Black (Gerrit) via gem5-dev
Gabe Black has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/58350 )



Change subject: scons: Add a priority field to the SourceLib construct.
..

scons: Add a priority field to the SourceLib construct.

This helps specify ordering for libraries that need it. Libraries with
a higher priority will be sorted earlier in the list, which can be
necessary when working with static libraries/archives.

The default value for "priority" is zero. It's only really necessary
to ensure relative ordering of particular pairings of libraries, so
it should be ok to use an absolute integer value for this. If you
need to order relative to a library, there is a good chance you're
adding it, or the place it's added is well known and you can easily
find its priority value. It's also unlikely that there would be a
complex series of interactions between libraries that would make a
more complicated system warranted.

Change-Id: Ie94a35e6563c07f8d462a4a52d0173ea3cf4f8de
---
M src/SConscript
1 file changed, 27 insertions(+), 1 deletion(-)



diff --git a/src/SConscript b/src/SConscript
index c1b00f0..b950d81 100644
--- a/src/SConscript
+++ b/src/SConscript
@@ -75,7 +75,9 @@
 pass

 class SourceLib(SourceItem):
-pass
+def __init__(self, *args, **kwargs):
+self.priority = kwargs.pop('priority', 0)
+super().__init__(*args, **kwargs)

 build_tools = Dir('#build_tools')

@@ -392,6 +394,8 @@
 env['BUILDDIR'], self.path(env).dir.abspath)

 libs = self.libs(env)
+# Higher priority libraries should be earlier in the list.
+libs.sort(key=lambda l: l.priority, reverse=True)
 if libs:
 env.Append(LIBS=list(lib.source for lib in libs))


--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/58350
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: Ie94a35e6563c07f8d462a4a52d0173ea3cf4f8de
Gerrit-Change-Number: 58350
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black 
Gerrit-CC: Gabe Black 
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

[gem5-dev] Build failed in Jenkins: nightly #177

2022-03-30 Thread jenkins-no-reply--- via gem5-dev
See 

Changes:

[fcrh] mem: Add SharedMemoryServer

[gabe.black] arch-arm: Override makeRead and makeWrite in the ISA description.

[gabe.black] ext: Add a cont_choice keyword to kconfiglib.

[gabe.black] scons: Put all config variables in an env['CONF'] sub-dict.

[gabe.black] scons: Put internal build files in a gem5.build directory.

[Bobby R. Bruce] tests: Remove accidentally included "exit 0" test code

[matthew.poremba] configs,gpu-compute: Support fetch from system pages

[matthew.poremba] dev-hsa: Properly mask HSA packet header bits

[matthew.poremba] dev-hsa: Update QCntxt readIndex in HW scheduler write

[gabe.black] arch: Split up src/dest register ID creation.

[srikant.bharadwaj] configs: Update memory port name in Ruby


--
[...truncated 3.91 MB...]
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_getarsym.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_move.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_hash.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/libelf_ar_util.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_shdr.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_cap.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_rawfile.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_open.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_getident.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/libelf_xlate.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_update.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_checksum.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_rela.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/gelf_dyn.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_fill.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_errmsg.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_next.c -> .os
 [SHCC] X86_MESI_Two_Level/ext/libelf/elf_shnum.c -> .os
 [  AR]  -> X86_MESI_Two_Level/ext/softfloat/libsoftfloat.a
 [  AR]  -> X86_MESI_Two_Level/ext/libelf/libelf.a
 [  RANLIB]  -> X86_MESI_Two_Level/ext/libelf/libelf.a
 [  RANLIB]  -> X86_MESI_Two_Level/ext/softfloat/libsoftfloat.a
 [LINK]  -> X86_MESI_Two_Level/gem5.opt
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for 
libgcc_s.so.1
/usr/bin/ld: skipping incompatible /usr/lib/libgcc_s.so.1 when searching for 
libgcc_s.so.1
scons: done building targets.
*** Summary of Warnings ***
Warning: Deprecated namespaces are not supported by this compiler.
 Please make sure to check the mailing list for deprecation
 announcements.
Warning: Deleting old variant variables file "/nobackup/jenkins/workspace/nightl
 y/build/variables/X86_MESI_Two_Level"
Building the following targets. This may take a while.
/nobackup/jenkins/workspace/nightly/build/GCN3_X86/gem5.opt
You may want to run with only a single ISA(--isa=), use --skip-build, or use 
'rerun'.
Logging call to command: scons -C /nobackup/jenkins/workspace/nightly -j 16 
--ignore-style --no-compress-debug 
/nobackup/jenkins/workspace/nightly/build/GCN3_X86/gem5.opt
scons: Entering directory `/nobackup/jenkins/workspace/nightly'
scons: Reading SConscript files ...
Mkdir("/nobackup/jenkins/workspace/nightly/build/GCN3_X86/gem5.build")
Checking for linker -Wl,--as-needed support... (cached) yes
Checking for compiler -Wno-free-nonheap-object support... (cached) yes
Info: Using Python config: python3-config
Checking for C header file Python.h... (cached) yes
Checking Python version... (cached) 3.8.10
Checking for accept(0,0,0) in C++ library None... (cached) yes
Checking for zlibVersion() in C++ library z... (cached) yes
Checking for C library tcmalloc... (cached) yes
Building in /nobackup/jenkins/workspace/nightly/build/GCN3_X86
Using saved variables file(s) 
/nobackup/jenkins/workspace/nightly/build/GCN3_X86/gem5.build/variables
Checking for C header file fenv.h... (cached) yes
Checking for C header file png.h... (cached) yes
Checking for clock_nanosleep(0,0,NULL,NULL) in C library None... (cached) yes
Checking for C header file valgrind/valgrind.h... (cached) no
Warning: Deprecated namespaces are not supported by this compiler.
 Please make sure to check the mailing list for deprecation
 announcements.
Checking for pkg-config package hdf5-serial... (cached) yes
Checking for H5Fcreate("", 0, 0, 0) in C library hdf5... (cached) yes
Checking for H5::H5File("", 0) in C++ library hdf5_cpp... (cached) yes
Checking for C header file linux/kvm.h... (cached) yes
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library None... 
(cached) no
Checking for timer_create(CLOCK_MONOTONIC, NULL, NULL) in C library rt... 
(cached) yes
Checking size of struct kvm_xsave ... (cached) yes
Checking for member exclude_host in struct perf_event_attr...(cached) yes
Checking for