Hi Fengze,

Yeah, there's a lot of complicated and undocumented things you need to do
when initializing a CPU.

Here's a couple of pointers that may help. However, this code was written a
few years ago and is almost 4000 commits behind, so things have probably
changed since then!
Code: https://github.com/darchr/gem5/tree/simple-cpu/src/learning_gem5/part4
Notes:
https://github.com/darchr/gem5/blob/simple-cpu/src/learning_gem5/part4/notes.rst

I am certain that workload stuff has changed since I wrote the above code.
Though, I hope that it can help you get started.

Cheers,
Jason

On Wed, Nov 3, 2021 at 3:19 AM Fengze Yu via gem5-users <gem5-users@gem5.org>
wrote:

> Hi
>
> I was trying to add a new CPU inherit from BaseCPU:
>
> class MY_CPU: public BaseCPU
> {
> public:
>
>     MY_CPU(const MY_CPUParams& p);
>     ~MY_CPU(){}
>     ...
> private:
>     ...
> }
>
> but incurs the following running error: fatal: Process system.cpu.workload
> is not associated with any HW contexts!
>
> ...
> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
> warn: membus.slave is deprecated. `slave` is now called `cpu_side_ports`
> Global frequency set at 1000000000000 ticks per second
> warn: No dot file generated. Please install pydot to generate the dot file
> and pdf.
> build/RISCV/mem/mem_interface.cc:793: warn: DRAM device capacity (8192
> Mbytes) does not match the address range assigned (512 Mbytes)
> build/RISCV/base/statistics.hh:277: warn: One of the stats is a legacy
> stat. Legacy stat is a stat that does not belong to any statistics::Group.
> Legacy stat is deprecated.
> build/RISCV/arch/riscv/linux/se_workload.cc:60: warn: Unknown operating
> system; assuming Linux.
> build/RISCV/sim/process.cc:290: fatal: Process system.cpu.workload is not
> associated with any HW contexts!
> ...
>
> Did I miss anything essential when creating a new CPU class?
>
>
> Thanks in advance
>
> Fengze
> _______________________________________________
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to