[gem5-users] Building gem5 in virtual python environment

2023-04-09 Thread Peng, Ziyang via gem5-users
Hi guys,

I was working on building gem5 with miniconda python.  The building crashed 
with "Error: Can't find a working Python installation".  After searching 
online, I found that this is a common problem, but there is no accurate 
solution.

Here is my local solution:

  1.  Add this line in the SConstruct file. 
"main.Append(LIBPATH=['${MINICONDA_PATH}/python/miniconda37/lib']"
  2.  Add your libpython3.x.so path to LD_LIBRARY_PATH like: export 
LD_LIRARY_PATH= ${MINICONDA_PATH}/python/miniconda37/lib:$LD_LIBRARY_PATH

This solution may not be the best way, but I hope it can be helpful to you.

Thanks + regards,
Ziyang

___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Create the gem5 required config file without using gem5 binary?

2023-04-20 Thread Peng, Ziyang via gem5-users
Hi all,
Since gem5 is using python scripts to create configuration files. Is there any 
way to create the configuration file without using the binary like gem5.opt or 
gem5.fast? Maybe a pure python method or a C++ interface like  CXXConfig ?

Thanks + regards,
Ziyang

___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Config ARM DSU in Gem5 simulator

2023-07-31 Thread Peng, Ziyang via gem5-users
Hi all,
I am a Gem5 user currently studying with the ARM architecture. In ARM, there is 
a DSU(DyanamIQ Shared 
Unit)
 comprises the L3 memory system, control logic, and external interfaces to 
support DynamIQ cluster.
I would like to ask is there a way to configure DSU model in the Gem5 simulator 
or exist  a more detailed ARM based configuration in Gem5?
>From my understanding, I can config a L3Cache with a coherent XBar to simulate 
>the DSU part?


Thanks + regards,
Ziyang

___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Multi-threaded program in Gem5 SE mode

2023-10-24 Thread Peng, Ziyang via gem5-users
Hi all,
Earlier this month, I saw an email saying that Gem5 SE mode already supports 
multi-threaded program. I tested both ARM and X86 program. X86 works well but 
the ARM one will report below errors when deleting threads(maybe?).

build/ARM/sim/syscall_emul.cc:74: warn: ignoring syscall madvise(...)
terminate called after throwing an instance of 'std::system_error'
  what():  Unknown error -4016
build/ARM/sim/syscall_emul.cc:74: warn: ignoring syscall rt_sigaction(...)
build/ARM/sim/faults.cc:102: panic: panic condition !handled && 
!tc->getSystemPtr()->trapToGdb(GDBSignal::SEGV, tc->contextId()) occurred: Page 
table fault when accessing virtual address 0x400
Memory Usage: 725464 KBytes
Program aborted at tick 577190732000
--- BEGIN LIBC BACKTRACE ---
/home/pzy/Documents/gem5/build/ARM/gem5.opt(+0x29111b0)[0x55c82b7af1b0]
/home/pzy/Documents/gem5/build/ARM/gem5.opt(+0x29356ec)[0x55c82b7d36ec]

My test program is %GEM5_PATH/tests/test-progs/threads/src/threads.cpp. My 
building command is `aarch64-linux-gnu-g++ threads.cpp -lpthread -lrt -pthread 
-static -o arm_thread` (Note: Nothing changes with/without -lrt and -lpthread).
My Gem5 configuration file is based on 
%GEM5_PATH/configs/learning_gem5/part1/simple.py. I only modify the core 
numbers and change the using binary like below:
system.cpu = [ArmTimingSimpleCPU() for i in range(core_num)]
system.membus = SystemXBar()
for i in range(core_num):
system.cpu[i].icache_port = system.membus.cpu_side_ports
system.cpu[i].dcache_port = system.membus.cpu_side_ports
system.cpu[i].createInterruptController()
binary = "arm_thread"
system.workload = SEWorkload.init_compatible(binary)
process = Process()
process.cmd = [binary]
for i in range(core_num):
system.cpu[i].workload = process
system.cpu[i].createThreads()


I'd like to know the reason why this error occurs or if it's just that Gem5 ARM 
doesn't currently  support multithreaded program. (But from the output, I think 
the binary is executed on these cores). It would be nice to have an example of 
this running successfully!

Thanks + regards,
Ziyang

___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Re: Assistance required: Stats not generated for TLM examples

2024-01-08 Thread Peng, Ziyang via gem5-users
Hi PaiJ,
Is the stats.txt file in m5out folder is empty? If yes, I think the root cause 
is that gem5-tlm is using cxx_manager class to register each objects while the 
registering of stat is missing.
My solution is adding a new method at CxxConfigManager::instantiate(bool 
build_all){} . This method will iterate through all the simObjects and add 
their stats into gem5::statistics::statsList().

Due to work reasons, I can't give you the code directly. Hope this can give you 
a hint.

Thanks + Regards,
Ziyang

From: Ananth.PaiJ--- via gem5-users 
Sent: Tuesday, January 9, 2024 11:53 AM
To: gem5-users@gem5.org
Cc: ananth.p...@infineon.com
Subject: [gem5-users] Assistance required: Stats not generated for TLM examples

Hello all,

I have been working with gem5 for a while now. I'm trying to generate 
statistics for the TLM example given in the 
util/systemc/systemc_within_gem5/systemc_gem5_tlm example.
Since there were no in-built stats available for the sc_tlm_target.{cc,hh}, I 
tried to create few of my own using the mechanism given in the documentation. 
I'll add my code snippets below.

#include<>

struct TargetParams: public SimObjectParams{
};
class Target: public sc_module, public gem5::SimObject
{
  public:
   ..
struct StatGroup : public gem5::statistics::Group {
gem5::statistics::Scalar testingVariable1;
gem5::statistics::Scalar testingVariable2;
gem5::statistics::Scalar testingVariable3;
StatGroup(gem5::statistics::Group *parent);
}stats;
  
  public:
PARAMS(Target);
SC_HAS_PROCESS(Target);
Target(sc_module_name name, const Params &p) :
 sc_module(name),
 SimObject(p),
 tSocket("tSocket"),
 wrapper(tSocket, std::string(name) + ".tlm", InvalidPortID),
 stats(this)
{
.
}
.
};
Target::StatGroup::StatGroup(gem5::statistics::Group *parent)
: gem5::statistics::Group(parent),
ADD_STAT(testingVariable1, gem5::statistics::units::Count::get(), 
"Variable1 for testing"),
ADD_STAT(testingVariable2, gem5::statistics::units::Count::get(), 
"Variable2 for testing"),
ADD_STAT(testingVariable3, gem5::statistics::units::Count::get(), 
"Variable3 for testing")
{
}
My current gem5 version is gem5v23.1. I'm working on WSL. Please feel ask any 
more questions if needed.

Thank you and hoping to listen from you soon.

Best Regards,
Ananth Pai J

Infineon Technologies IN
DES PTS TI EA SME
Phone: +91 7349045724
ananth.p...@infineon.com

___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] Question about ARM DVFS support

2024-03-07 Thread Peng, Ziyang via gem5-users
Hi all,
I found Gem5 provides DVFS support for ARM. The 
doc 
introduce how to enable it in the FS mode but not clearly about how it works. 
From my study with the Gem5 source code,  energy_ctrl will call DVFS to change 
the voltage or Frequency domain according to the incoming packet. But I have no 
idea where the incoming packets from and how it works?
Beside I want know that if it is possible to enable the DVFS in the SE mode? 
Since the energy_ctrl is a pio device, maybe it is impossible to work in the SE 
mode?

Thanks + regards,
Ziyang

___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org


[gem5-users] gem5-systemc builidng error

2022-03-16 Thread Peng, Ziyang via gem5-users
Hi,
I am a new to gem5 and want to do some research on SystemC co-simulation. I get 
the code from https://github.com/gem5/gem5,  follow the steps the README both 
in /util/tlm and /util/systemc  and get quite a lot building error likes xxx 
should be gem5::xxx or gem5::yyy should be yyy. After fixing these namespace 
error, I still have some link errors. (see in the attachment).  I found the 
last update of these folder is three years ago? Do they still support correctly 
in the latest gem5?
My environment is Debian 4.9,  gcc(g++) 8.3, python 3.7.3.

Besides, is there any tutorial for gem5-systemc?

Looking forward to your response.

Thanks + regards
Ziyang

/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::IGbEParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::MPP_TAGEParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::PS2KeyboardParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::TimingExprLiteralParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::SHiPMemRPParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::DMASequencerParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::A9SCUParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::FUPoolParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::ArmFsFreebsdParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::STeMSPrefetcherParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::TimingExprIfParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::TAGE_SC_L_8KB_StatisticalCorrectorParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::UFSHostDeviceParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::SimpleObjectParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::CustomNoMaliGpuParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::EtherTapStubParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::ScmiAgentChannelParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::SMMUv3Params::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::BaseSetAssocParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::TraceCPUParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::SubSystemParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::InvalidateGeneratorParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::ArmMMUParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::BloomFilterMultiBitSelParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::GenericPciHostParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::MemFootprintProbeParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::BasicLinkParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::PS2MouseParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::InstPBTraceParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::ArmSemihostingParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::TimingExprSrcRegParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/ARM/libgem5_opt.so: undefined 
reference to `gem5::Sta

[gem5-users] Failed to run tlm-gem5 cosimualtion examples in util/tlm

2022-03-22 Thread Peng, Ziyang via gem5-users
Hi,
I am working on combine external sc_models to Gem5. So I try to follow the tlm 
tutorial in gem5/util/tlm/README.
Following the building steps in the REDME file, there is no issue on the first 
two line and end with normal gem5.opt output:
>cd ../../
>/usr/bin/env python3 `which scons` build/ARM/gem5.opt

During the next command, serval error reported such as namespace error. After I 
fixed them, the shared library can be generated correctly, but new link errors 
happened in next command. (See undefined-reference-error.txt)
> scons --with-cxx-config --without-python --without-tcmalloc USE_SYSTEMC=0 
> build/ARM/libgem5_opt.so
> cd util/tlm && /usr/bin/env python3 `which scons`

I tried hard walking arround and have no ideal on how to get throught. In 
README, it told me -with-cxx-config and USE_SYSTEMC are mutually exclusive. So 
I tried build libgemt5_opt.so in this command, and build util/tlm again. It 
passed build.
> scons  --without-tcmalloc USE_SYSTEMC=1 build/ARM/libgem5_opt.so
> cd util/tlm && /usr/bin/env python3 `which scons`
(I also updated util/tlm/src/sim_control.cc, comment line76:  
gem5::cxxConfigInit();)

Gem5.sc which should be the target file for scons is generated. So I moved to 
next step.
> ../../build/ARM/gem5.opt conf/tlm_{master,slave}.py
> build/examples/{master,slave}_port/gem5.sc m5out/config.ini -e 100

Then I meet a new question, here is the output: (see run-time-error.txt for 
detail)
 EventQueue Dump  (cycle 0)



Config problem in sim object root: Can't find sim object
double free or corruption (fasttop)
Program aborted at tick 0 --- END LIBC BACKTRACE ---
Aborted
--- BEGIN LIBC BACKTRACE ---
...
--- END LIBC BACKTRACE ---
Aborted


I think it might be caused by cxx-config is disabled? But I have no ideal to 
fix it. I guess it may be a common issue for those who's trying to get through 
this tutorial. Any advice on using the tlm utility of Gem5 will be great 
helpful.



Thanks + regards,


/usr/bin/ld: main.cc:(.text+0x6a): undefined reference to 
`CliParser::getDebugFlags[abi:cxx11]()'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::LupioTMRParam
s::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::DeltaCorrelat
ingPredictionTablesParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::LupioBLKParam
s::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::MemCtrlParams
::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::TimingSimpleC
PUParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::SignaturePath
PrefetcherParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::WeightedLRURPParams::create() const'  
 
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::TAGEParams::c
reate() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::AtomicSimpleCPUParams::create() const'
 
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::DummyCheckerP
arams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::DVFSHandlerPa
rams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::NSGigEParams:
:create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::RubyCachePara
ms::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::GarnetRouterP
arams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::NetworkLinkPa
rams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `sc_gem5::WriteCheck
er<(sc_core::sc_writer_policy)0>::checkWriter()'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::EtherBusParam
s::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference to `gem5::QoSTurnaround
PolicyIdealParams::create() const'
/usr/bin/ld: /home/pzy/Documents/gem5/gem5/build/RISCV/libgem5_opt.so: 
undefined reference