From 94b18f7f5d2a8cafc38b5d32d8f7e0a8e95e4828 Mon Sep 17 00:00:00 2001 From: Yifan Sun Date: Thu, 5 Sep 2024 16:01:58 -0400 Subject: [PATCH] Fix connection configuration bug --- .vscode/launch.json | 4 +--- driver/memorycopy.go | 9 +++++---- go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- samples/runner/emugpubuilder.go | 6 ++---- 5 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 83822569..83a40927 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -165,9 +165,7 @@ "mode": "debug", "program": "${workspaceFolder}/samples/fir", "args": [ - "-timing", - "-length=8192", - "-report-all", + "-parallel", ], }, { diff --git a/driver/memorycopy.go b/driver/memorycopy.go index e360f49b..541f3d61 100644 --- a/driver/memorycopy.go +++ b/driver/memorycopy.go @@ -211,18 +211,19 @@ func (m *defaultMemoryCopyMiddleware) Tick() (madeProgress bool) { func (m *defaultMemoryCopyMiddleware) processGeneralRsp( rsp *sim.GeneralRsp, ) bool { + madeProgress := false originalReq := rsp.OriginalReq switch originalReq := originalReq.(type) { case *protocol.FlushReq: - return m.processFlushReturn(originalReq) + madeProgress = m.processFlushReturn(originalReq) case *protocol.MemCopyH2DReq: - return m.processMemCopyH2DReturn(originalReq) + madeProgress = m.processMemCopyH2DReturn(originalReq) case *protocol.MemCopyD2HReq: - return m.processMemCopyD2HReturn(originalReq) + madeProgress = m.processMemCopyD2HReturn(originalReq) } - return false + return madeProgress } func (m *defaultMemoryCopyMiddleware) processMemCopyH2DReturn( diff --git a/go.mod b/go.mod index 9d73026e..6082a741 100644 --- a/go.mod +++ b/go.mod @@ -5,10 +5,10 @@ require ( github.com/fatih/color v1.17.0 github.com/golang/mock v1.6.0 github.com/gorilla/mux v1.8.1 - github.com/onsi/ginkgo/v2 v2.20.1 - github.com/onsi/gomega v1.34.1 - github.com/rs/xid v1.5.0 - github.com/sarchlab/akita/v4 v4.0.0-alpha.3 // v3.0.0 + github.com/onsi/ginkgo/v2 v2.20.2 + github.com/onsi/gomega v1.34.2 + github.com/rs/xid v1.6.0 + github.com/sarchlab/akita/v4 v4.0.0-alpha.5 // v3.0.0 github.com/tebeka/atexit v0.3.0 gonum.org/v1/gonum v0.15.1 ) @@ -20,7 +20,7 @@ require ( github.com/go-sql-driver/mysql v1.8.1 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 // indirect + github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect diff --git a/go.sum b/go.sum index d9b1b7d2..320502c3 100644 --- a/go.sum +++ b/go.sum @@ -21,8 +21,8 @@ github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 h1:FKHo8hFI3A+7w0aUQuYXQ+6EN5stWmeY/AZqtM8xk9k= -github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 h1:sEDPKUw6iPjczdu33njxFjO6tYa9bfc0z/QyB/zSsBw= +github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY= github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ= github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= @@ -38,16 +38,16 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= -github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo= -github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI= -github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k= -github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY= +github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= +github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= +github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= -github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/sarchlab/akita/v4 v4.0.0-alpha.3 h1:pMHcTmtaMDROb0bRr11ClVROi582miqGNgfXoOuOvkI= -github.com/sarchlab/akita/v4 v4.0.0-alpha.3/go.mod h1:1QJk3rUs3sTwyqG44lJcTR++bHGT5y+FdEtACqQaPvU= +github.com/rs/xid v1.6.0 h1:fV591PaemRlL6JfRxGDEPl69wICngIQ3shQtzfy2gxU= +github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= +github.com/sarchlab/akita/v4 v4.0.0-alpha.5 h1:+jOx/D4Vv44/lNNgzDgXYTwR6y4XnN4YJHyddhhqiBI= +github.com/sarchlab/akita/v4 v4.0.0-alpha.5/go.mod h1:xHBNi4GYv6rRohUU+8FzGuKK2uHXANEHL7zYq6/0rEw= github.com/shirou/gopsutil v3.21.11+incompatible h1:+1+c1VGhc88SSonWP6foOcLhvnKlUeu/erjjvaPEYiI= github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/samples/runner/emugpubuilder.go b/samples/runner/emugpubuilder.go index db0b6e25..0af0e8b7 100644 --- a/samples/runner/emugpubuilder.go +++ b/samples/runner/emugpubuilder.go @@ -191,13 +191,11 @@ func (b *EmuGPUBuilder) buildGPU() { func (b *EmuGPUBuilder) connectInternalComponents() { connection := directconnection.MakeBuilder(). WithEngine(b.engine). - WithFreq(1*sim.GHz). - Build("InterGPUConn") + WithFreq(1 * sim.GHz). + Build("IntraGPUConn") - connection.PlugIn(b.commandProcessor.ToDriver, 1) connection.PlugIn(b.commandProcessor.ToDMA, 1) connection.PlugIn(b.commandProcessor.ToCUs, 1) - connection.PlugIn(b.driver.GetPortByName("GPU"), 1) connection.PlugIn(b.gpuMem.GetPortByName("Top"), 1) connection.PlugIn(b.dmaEngine.ToCP, 1) connection.PlugIn(b.dmaEngine.ToMem, 1)