Skip to content

Commit

Permalink
Merge branch 'seperate-gmmu-pagetable' of https://github.com/YuWei-CH…
Browse files Browse the repository at this point in the history
…/mgpusim into seperate-gmmu-pagetable
  • Loading branch information
YuWei-CH committed Dec 5, 2024
2 parents 08a802b + 146e85c commit fb0872a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 19 deletions.
2 changes: 1 addition & 1 deletion driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func (d *Driver) RegisterGPU(
CUCount: properties.CUCount,
DRAMSize: properties.DRAMSize,
},
pageTable: vm.PageTable,
PageTable: vm.NewPageTable(d.Log2PageSize),
}
gpuDevice.SetTotalMemSize(properties.DRAMSize)
d.memAllocator.RegisterDevice(gpuDevice)
Expand Down
2 changes: 1 addition & 1 deletion driver/internal/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type Device struct {
nextActualGPUIndex int
MemState DeviceMemoryState
Properties DeviceProperties
pageTable vm.PageTable
PageTable vm.PageTable
}

// SetTotalMemSize sets total memory size
Expand Down
8 changes: 4 additions & 4 deletions driver/internal/memoryallocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (a *memoryAllocatorImpl) RegisterDevice(device *Device) {
state := device.MemState
state.setInitialAddress(a.totalStorageByteSize)
a.totalStorageByteSize += state.getStorageSize()
device.pageTable = vm.NewPageTable(a.log2PageSize)
device.PageTable = vm.NewPageTable(a.log2PageSize)
a.devices[device.ID] = device
}

Expand Down Expand Up @@ -162,7 +162,7 @@ func (a *memoryAllocatorImpl) allocatePages(

// fmt.Printf("page.addr is %x piage Device ID is %d \n", page.PAddr, page.DeviceID)
// debug.PrintStack()
device.pageTable.Insert(page)
device.PageTable.Insert(page)
a.vAddrToPageMapping[page.VAddr] = page
}

Expand All @@ -189,7 +189,7 @@ func (a *memoryAllocatorImpl) Remap(
device := a.devices[deviceID]
pages := a.allocateMultiplePagesWithGivenVAddrs(pid, deviceID, vAddrs, false)
for _, page := range pages {
device.pageTable.Insert(page)
device.PageTable.Insert(page)
}
}

Expand Down Expand Up @@ -246,7 +246,7 @@ func (a *memoryAllocatorImpl) allocatePageWithGivenVAddr(
DeviceID: uint64(deviceID),
Unified: isUnified,
}
device.pageTable.Insert(page)
device.PageTable.Insert(page)
a.vAddrToPageMapping[page.VAddr] = page

return page
Expand Down
3 changes: 0 additions & 3 deletions go.work

This file was deleted.

10 changes: 0 additions & 10 deletions go.work.sum

This file was deleted.

0 comments on commit fb0872a

Please sign in to comment.