Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nvm config scripts do not work properly #669

Closed
ccccrrrr opened this issue Dec 11, 2023 · 1 comment · Fixed by #1114
Closed

nvm config scripts do not work properly #669

ccccrrrr opened this issue Dec 11, 2023 · 1 comment · Fixed by #1114
Labels
bug configs gem5's Preprepared Python Configuration scripts. Typically found in "configs"

Comments

@ccccrrrr
Copy link

Describe the bug
The given script configs/nvm/sweep.py and configs/nvm/sweep_hybrid.py do not work properly.

Affects version
The latest version: Version 23.0.1.0

gem5 Modifications
N/A

To Reproduce
Steps to reproduce the behavior. Please assume starting from a clean repository:

  1. Compile gem5 with command /usr/bin/env python3 $(which scons) build/X86/gem5.opt -j32
  2. Execute the simulation with build/X86/gem5.opt configs/nvm/sweep.py or build/X86/gem5.opt configs/nvm/sweep_hybrid.py

Terminal Output

command line: build/X86/gem5.opt configs/nvm/sweep.py

AttributeError: object 'HeteroMemCtrl' has no attribute 'dram'
  (C++ object is not yet constructed, so wrapped C++ methods are unavailable.)

At:
  src/python/m5/SimObject.py(847): __getattr__
  configs/nvm/sweep.py(122): <module>
  src/python/m5/main.py(630): main

and

command line: build/X86/gem5.opt configs/nvm/sweep_hybrid.py

fatal: This script assumes the controller is a HeteroMemCtrl subclass

Host Operating System
Ubuntu 20.04.3 LTS

Host ISA
X86

Compiler used
gcc9.4.9, Python 3.8.10

Additional information
I think the problem lies in the memory creation process in configs/common/MemConfig.py does not match the expectations of memory creation in config/nvm. For example, in configs/nvm/sweep.py, line118:

# the following assumes that we are using the native memory
# controller with an NVM interface, check to be sure
if not isinstance(system.mem_ctrls[0], m5.objects.MemCtrl):
    fatal("This script assumes the controller is a MemCtrl subclass")
if not isinstance(system.mem_ctrls[0].dram, m5.objects.NVMInterface):
    fatal("This script assumes the memory is a NVMInterface class")

the script assumes system.mem_ctrl[0].dram will store nvm interface, but in configs/common/MemConfig.py, line256, there is:

                # Create a controller if not sharing a channel with DRAM
                # in which case the controller has already been created
                if not opt_hybrid_channel:
                    mem_ctrl = m5.objects.HeteroMemCtrl()
                    mem_ctrl.nvm = nvm_intf

                    mem_ctrls.append(mem_ctrl)
                else:
                    ...

it just put nvm_intf in nvm. However, simply change the above mem_ctrl.nvm to mem_ctrl.dram does not solve the problem, and will cause other errors.

@ccccrrrr ccccrrrr added the bug label Dec 11, 2023
@BobbyRBruce BobbyRBruce linked a pull request May 13, 2024 that will close this issue
@BobbyRBruce BobbyRBruce added the configs gem5's Preprepared Python Configuration scripts. Typically found in "configs" label May 13, 2024
BobbyRBruce pushed a commit that referenced this issue May 13, 2024
These changes to sweep and sweep_hybrid for NVM allow them to run. I'm
not an expert on this, so I'm not sure if these are technically correct,
but they no longer fail when running
`build/X86/gem5.opt configs/nvm/sweep.py` and `build/X86/gem5.opt
configs/nvm/sweep_hybrid.py`

GitHub Issue: #669
@BobbyRBruce
Copy link
Member

I believe this is fixed by #1114 . Closing.

BobbyRBruce pushed a commit to BobbyRBruce/gem5 that referenced this issue May 25, 2024
These changes to sweep and sweep_hybrid for NVM allow them to run. I'm
not an expert on this, so I'm not sure if these are technically correct,
but they no longer fail when running
`build/X86/gem5.opt configs/nvm/sweep.py` and `build/X86/gem5.opt
configs/nvm/sweep_hybrid.py`

GitHub Issue: gem5#669
hnpl pushed a commit to hnpl/gem5 that referenced this issue Jun 9, 2024
These changes to sweep and sweep_hybrid for NVM allow them to run. I'm
not an expert on this, so I'm not sure if these are technically correct,
but they no longer fail when running
`build/X86/gem5.opt configs/nvm/sweep.py` and `build/X86/gem5.opt
configs/nvm/sweep_hybrid.py`

GitHub Issue: gem5#669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug configs gem5's Preprepared Python Configuration scripts. Typically found in "configs"
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants