Exemplo n.º 1
0
computeUnit = Compute(memA, memB, memC, TMADD, BSIZE)
computeTime = computeUnit.getComputeTime(BSIZE, DT)
totalComputeTime = computeTime * NUM_BLOCK_MULTIPLIES_COMPUTE_UNIT

# Instantiate and compute DMA unit time
dmaUnit = Dma(DMA_WIDTH, DMA_BURST_LENGTH, DMA_BURST_OVERHEAD)
dmaCostPerBlock = BSIZE * dmaUnit.getDmaTime(toBits(BSIZE, DT))
numDmaPerBlockA = NUM_A_REQD # to and fro
numDmaPerBlockB = (SIZE/BSIZE) 
numDmaPerBlockC = (SIZE/BSIZE) * 2
totalNumDma = (NUM_BLOCKS) * (numDmaPerBlockA + numDmaPerBlockB + numDmaPerBlockC)
totalDmaTime = totalNumDma * dmaCostPerBlock

totalTime = totalComputeTime + totalDmaTime
computePercent = float(totalComputeTime) * 100 / totalTime
dmaPercent = float(totalDmaTime) * 100 / totalTime

memoryArea = memA.getArea() * NUM_A_REQD + memB.getArea() * NUM_B_REQD + memC.getArea() * NUM_C_REQD
computeArea = computeUnit.getArea() * NUM_COMPUTE_UNITS

print ""
print " -- STATS FROM MODELING MATRIX MULTIPLY -- "
print "SIZE = %d, BSIZE = %d" %(SIZE, BSIZE)
print "NUM_COMPUTE_UNITS = %d" %(NUM_COMPUTE_UNITS)
print "Total compute time: %d (%f %%)" %(totalComputeTime, computePercent)
print "Total DMA time: %d (%f %%)" %(totalDmaTime, dmaPercent)

print ""
print "Memory area: %d" %(memoryArea)
print "Compute area: %d" %(computeArea)