module Bob.ArenaPlan import Compiler.Planning.VA import Platform.Linux.Nvidia.PlanHost import Std.Natural -- Bob's buffers in the card's address space, each in its own slot after the -- previous from the device origin (Compiler.Planning.VA), and their mappings -- in the process, each after the previous from the plan host's mapping -- origin. Every buffer is system memory but the GPFIFO; the arena (the -- parameters, moments, gradients, input record and results) is the last. -- The host side of the arena certificate decides that they are disjoint -- and clear of the host's own mappings. def bobDeviceSlotBytes : Nat = 0x0100_0000 def bobGPFIFOBase : Nat = vaBaseNatural def bobPushbufferBase : Nat = (vaPlaceAfter bobGPFIFOBase bobDeviceSlotBytes bobDeviceSlotBytes) def bobSemaphoreBase : Nat = (vaPlaceAfter bobPushbufferBase bobDeviceSlotBytes bobDeviceSlotBytes) def bobProgramBase : Nat = (vaPlaceAfter bobSemaphoreBase bobDeviceSlotBytes bobDeviceSlotBytes) def bobQMDBase : Nat = (vaPlaceAfter bobProgramBase bobDeviceSlotBytes bobDeviceSlotBytes) def bobArenaBase : Nat = (vaPlaceAfter bobQMDBase bobDeviceSlotBytes bobDeviceSlotBytes) -- the end of the address range the card maps for Bob def bobMappedEnd : Nat = (vaPlaceAfter bobArenaBase bobDeviceSlotBytes bobDeviceSlotBytes) -- the video memory Bob asks the card for: one slot (the GPFIFO and its USERD -- page are all it places there) def bobMinimumVideoBytes : Nat = bobDeviceSlotBytes def bobHostGPFIFO : Nat = nvidiaPlanHostMappingOrigin def bobHostPushbuffer : Nat = (vaPlaceAfter bobHostGPFIFO nvidiaPlanHostMappingAlignment nvidiaPlanHostMappingAlignment) def bobHostSemaphores : Nat = (vaPlaceAfter bobHostPushbuffer nvidiaPlanHostMappingAlignment nvidiaPlanHostMappingAlignment) def bobHostProgram : Nat = (vaPlaceAfter bobHostSemaphores nvidiaPlanHostMappingAlignment nvidiaPlanHostMappingAlignment) def bobHostQMD : Nat = (vaPlaceAfter bobHostProgram nvidiaPlanHostMappingAlignment nvidiaPlanHostMappingAlignment) def bobHostStaging : Nat = (vaPlaceAfter bobHostQMD nvidiaPlanHostMappingAlignment nvidiaPlanHostMappingAlignment)