diff --git a/driver/memory.go b/driver/memory.go index 6c41c408e11ceb62a1c7ed9d2b09f2391d7e9a9f..032788c0026ed27dc16a5ef7d14d22987e803e9a 100644 --- a/driver/memory.go +++ b/driver/memory.go @@ -77,6 +77,7 @@ func (d *Driver) allocatePage() { for _, p := range d.allocatedPages[d.usingGPU] { if p.PhysicalFrameNumber == pageID { pageIDAllocated = true + pageID += 1 << d.PageSizeAsPowerOf2 break } } diff --git a/emu/computeunit.go b/emu/computeunit.go index adf2ec7a8a76329355ebc71cc1da91e57231b202..27b5a397ed44ef7d0557b8449fab507c76bbd6f3 100644 --- a/emu/computeunit.go +++ b/emu/computeunit.go @@ -276,7 +276,7 @@ func (cu *ComputeUnit) runWfUntilBarrier(wf *Wavefront) error { for { instBuf, err := cu.GlobalMemStorage.Read(wf.PC, 8) if err != nil { - log.Fatal(err) + log.Panic(err) } inst, err := cu.decoder.Decode(instBuf) diff --git a/platform/build.go b/platform/build.go index 486fb9e49f6a877109a8cc391e1aeacc81acd860..ceb97950906ccc304d72ff23b24c27442d651a8c 100644 --- a/platform/build.go +++ b/platform/build.go @@ -1,11 +1,15 @@ package platform import ( + "log" + "os" + "gitlab.com/akita/akita" "gitlab.com/akita/gcn3" "gitlab.com/akita/gcn3/driver" "gitlab.com/akita/gcn3/gpubuilder" "gitlab.com/akita/mem" + "gitlab.com/akita/mem/vm" ) var UseParallelEngine bool @@ -27,9 +31,10 @@ func BuildEmuPlatform() ( } else { engine = akita.NewSerialEngine() } - //engine.AcceptHook(akita.NewEventLogger(log.New(os.Stdout, "", 0))) + engine.AcceptHook(akita.NewEventLogger(log.New(os.Stdout, "", 0))) - gpuDriver := driver.NewDriver(engine) + mmu := vm.NewMMU("MMU", engine) + gpuDriver := driver.NewDriver(engine, mmu) connection := akita.NewDirectConnection(engine) gpuBuilder := gpubuilder.NewGPUBuilder(engine) @@ -66,7 +71,8 @@ func BuildR9NanoPlatform() ( } //engine.AcceptHook(akita.NewEventLogger(log.New(os.Stdout, "", 0))) - gpuDriver := driver.NewDriver(engine) + mmu := vm.NewMMU("MMU", engine) + gpuDriver := driver.NewDriver(engine, mmu) connection := akita.NewDirectConnection(engine) gpuBuilder := gpubuilder.NewGPUBuilder(engine)