parsa-epfl / qflex

Quick & Flexible Rack-Scale Computer Architecture Simulator
http://qflex.epfl.ch/
31 stars 10 forks source link

MMU Bad initialization #33

Closed branylagaffe closed 5 months ago

branylagaffe commented 6 months ago

MMU Bad initialization

Description

The MMU initialization goes wrong, which fall onto a g_assert_not_reached()

Steps to Reproduce

  1. Assert that -mmu:perfect is set to 0 in trace.cfg
  2. Run simulation ./runq images/busybox

Expected Behavior

The initialization should go on and set the MMU before receiving any trace.

Actual Behavior

Assertion ERROR.

Additional Information

Screenshots (if applicable)


118 <ComponentManager.cpp:100> {0}- Initializing 8 components...
119 <ComponentManager.cpp:105> {0}- Component 1: Initializing sys-feeder
120 <flexus.cpp:267> {0}- Timestamp: Tue Apr  2 15:30:02 2024

121 <ComponentManager.cpp:105> {0}- Component 2: Initializing sys-bpwarm
122 <ComponentManager.cpp:105> {0}- Component 3: Initializing sys-L1d
123 <FastCacheImpl.cpp:177> {0}- Running with MT width 1
124 <ComponentManager.cpp:105> {0}- Component 4: Initializing sys-L1i
125 <ComponentManager.cpp:105> {0}- Component 5: Initializing sys-L2
126 <FastCMPCacheImpl.cpp:266> {0}- Running with CMP width 1
127 <StandardDirectory.cpp:102> {0}- Initialized Directory with 2048 x 16-way sets
128 <StandardDirectory.cpp:104> {0}-    SetMask = 7ff, SetShift = 6, SkewShift = 23, SkewSet = true
129 <FastCMPCacheImpl.cpp:305> {0}- Coherence Unit is: 64
130 <FastCMPCacheImpl.cpp:306> {0}- sizeof(PhysicalMemoryAddress) = 8
131 <ComponentManager.cpp:105> {0}- Component 6: Initializing sys-memory
132 <ComponentManager.cpp:105> {0}- Component 7: Initializing sys-magic-break
133 <ComponentManager.cpp:105> {0}- Component 8: Initializing sys-mmu
134 <startup.cpp:228> {0}- Flexus Initialized.
135 <MMUUtil.cpp:243> (<undefined>[<undefined>]) {0}- Assertion failed: (!(false)) : Unknown value in getting TG1 Granule Size. TG_SZ = 0
``
branylagaffe commented 6 months ago

One reason for this problem could be that the MMU is initialized before QEMU start producing any trace, thus Flexus on initialization read the not-yet-configured QEMU(/arm) to configure the MMU. This behaviour will cause Flexus to read registers set to 0, and be unable to configure the MMU.

branylagaffe commented 5 months ago

Fixed by d496cdb2d6151ce0bff59af5ed3078cf0f595a87 LGTM, done !