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

Linux VP: Code merge + Single Core Variants #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mschlaegl
Copy link

Hi,
with this I propose two changes which build up on on another:

The first one merges the top-level sources for linux-vp and linux32-vp to reduce code redundancy and the problems that come with it. (It can also be used as blue-print for similar cases)

The second one builds upon the first one and introduces single (worker) core variants of the linux-vp (linux-sc-vp (RV64) and linux32-sc-vp (RV32)), without adding much additional code.

Best regards,
Manfred

P.S.: Redarding usage, device-tree, etc: In the near future there will be a separate project that allows to easily create a basic setup for experiments with riscv-vp and Linux.

The top-levels of linux-vp(rv64) and linux32-vp(rv32) share a lot of
common code. This redundancy makes changes that should apply to both
vps error-prone.

With this we merge these two toplevels to one. The distinction between
linux-vp and linux32-vp is controlled by defines which are set in the
corresponding CMakeLists.

The change also includes a harmonization of the
CombinedMemoryInterface for rv64 to match that of rv32 (mmu optional /
passed by pointer) and according adjustments of tiny64 and tiny64-mc.

--
[email protected]
Institute for Complex Systems, JKU Linz
https://ics.jku.at/
Newly added variants:
 * linux-sc-vp:   RV64 with single worker core
 * linux32-sc-vp: RV32 with single worker core

The motivation for this is mainly to speed up some experiments.
For many experiments, a single core is sufficient and simulating a
single core is much faster than simulating multiple cores.

The new variants were introduced in the same way as it was done for the
merge of linux-vp and linux32-vp: The distinction between is controlled
by a define (NUM_CORES) which is set in the corresponding CMakeLists.

It was also considered to make the number of cores configurable by a
command-line parameter. However, because of the structure of the vp
(templates)

It was also considered to make the number of cores configurable via a
command line parameter. However, the VP and SystemC make much use of
template classes with the number of cores as a parameter. This could
perhaps be worked around, but especially with sockets and bindings
this quickly becomes messy and possibly inefficient.

--
[email protected]
Institute for Complex Systems, JKU Linz
https://ics.jku.at/
@@ -40,13 +40,15 @@ struct CombinedMemoryInterface : public sc_core::sc_module,
sc_core::sc_time dmi_access_delay = clock_cycle * 4;
std::vector<MemoryDMI> dmi_ranges;

MMU &mmu;
MMU *mmu;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed to a pointer instead of a reference? is there a case without an MMU?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants