[gem5-dev] Change in gem5/gem5[develop]: gpu-compute: Dropping fetchs when no entry is reserved in the buffer

2020-07-13 Thread Anthony Gutierrez (Gerrit) via gem5-dev
Anthony Gutierrez has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/29932 )


Change subject: gpu-compute: Dropping fetchs when no entry is reserved in  
the buffer

..

gpu-compute: Dropping fetchs when no entry is reserved in the buffer

This changeset drops fetches if there is no entry reserved in the
fetch buffer for that instruction. This can happen due to a fetch
attempted to be issued in the same cycle where a branch instruction
flushed the fetch buffer, while an ITLB or I-cache request is still
pending.

Change-Id: I3b80dbd71af27ccf790b543bd5c034bb9b02624a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/29932
Tested-by: kokoro 
Reviewed-by: Anthony Gutierrez 
Reviewed-by: Onur Kayıran 
Maintainer: Anthony Gutierrez 
---
M src/gpu-compute/fetch_unit.cc
M src/gpu-compute/fetch_unit.hh
2 files changed, 22 insertions(+), 0 deletions(-)

Approvals:
  Anthony Gutierrez: Looks good to me, approved; Looks good to me, approved
  Onur Kayıran: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/gpu-compute/fetch_unit.cc b/src/gpu-compute/fetch_unit.cc
index fb04cd2..447ff12 100644
--- a/src/gpu-compute/fetch_unit.cc
+++ b/src/gpu-compute/fetch_unit.cc
@@ -235,6 +235,16 @@
 delete oldPkt;

 /**
+ * if we have not reserved an entry in the fetch buffer,
+ * stop fetching. this can happen due to a branch instruction
+ * flushing the fetch buffer while an ITLB or I-cache request is still
+ * pending, in the same cycle another instruction is trying to fetch.
+ */
+if  
(!fetchBuf.at(wavefront->wfSlotId).isReserved(pkt->req->getVaddr())) {

+return;
+}
+
+/**
  * we should have reserved an entry in the fetch buffer
  * for this cache line. here we get the pointer to the
  * entry used to buffer this request's line data.
diff --git a/src/gpu-compute/fetch_unit.hh b/src/gpu-compute/fetch_unit.hh
index 2cfe3f0..798c264 100644
--- a/src/gpu-compute/fetch_unit.hh
+++ b/src/gpu-compute/fetch_unit.hh
@@ -120,6 +120,18 @@
 return reserved_pc->second;
 }

+/**
+ * returns true if there is an entry reserved for this address,
+ * and false otherwise
+ */
+bool
+isReserved(Addr vaddr) const
+{
+auto reserved_pc = reservedPCs.find(vaddr);
+bool is_reserved = (reserved_pc != reservedPCs.end());
+return is_reserved;
+}
+
 void fetchDone(Addr vaddr);

 /**

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/29932
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I3b80dbd71af27ccf790b543bd5c034bb9b02624a
Gerrit-Change-Number: 29932
Gerrit-PatchSet: 9
Gerrit-Owner: Anthony Gutierrez 
Gerrit-Reviewer: Anthony Gutierrez 
Gerrit-Reviewer: Onur Kayıran 
Gerrit-Reviewer: Tony Gutierrez 
Gerrit-Reviewer: Tuan Ta 
Gerrit-Reviewer: kokoro 
Gerrit-MessageType: merged
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

[gem5-dev] Change in gem5/gem5[develop]: gpu-compute: Dropping fetchs when no entry is reserved in the buffer

2020-06-03 Thread Anthony Gutierrez (Gerrit) via gem5-dev

Hello Tony Gutierrez, Onur Kayıran,

I'd like you to do a code review. Please visit

https://gem5-review.googlesource.com/c/public/gem5/+/29932

to review the following change.


Change subject: gpu-compute: Dropping fetchs when no entry is reserved in  
the buffer

..

gpu-compute: Dropping fetchs when no entry is reserved in the buffer

This changeset drops fetches if there is no entry reserved in the
fetch buffer for that instruction. This can happen due to a fetch
attempted to be issued in the same cycle where a branch instruction
flushed the fetch buffer, while an ITLB or I-cache request is still
pending.

Change-Id: I3b80dbd71af27ccf790b543bd5c034bb9b02624a
---
M src/gpu-compute/fetch_unit.cc
M src/gpu-compute/fetch_unit.hh
2 files changed, 22 insertions(+), 0 deletions(-)



diff --git a/src/gpu-compute/fetch_unit.cc b/src/gpu-compute/fetch_unit.cc
index fb04cd2..447ff12 100644
--- a/src/gpu-compute/fetch_unit.cc
+++ b/src/gpu-compute/fetch_unit.cc
@@ -235,6 +235,16 @@
 delete oldPkt;

 /**
+ * if we have not reserved an entry in the fetch buffer,
+ * stop fetching. this can happen due to a branch instruction
+ * flushing the fetch buffer while an ITLB or I-cache request is still
+ * pending, in the same cycle another instruction is trying to fetch.
+ */
+if  
(!fetchBuf.at(wavefront->wfSlotId).isReserved(pkt->req->getVaddr())) {

+return;
+}
+
+/**
  * we should have reserved an entry in the fetch buffer
  * for this cache line. here we get the pointer to the
  * entry used to buffer this request's line data.
diff --git a/src/gpu-compute/fetch_unit.hh b/src/gpu-compute/fetch_unit.hh
index 2cfe3f0..798c264 100644
--- a/src/gpu-compute/fetch_unit.hh
+++ b/src/gpu-compute/fetch_unit.hh
@@ -120,6 +120,18 @@
 return reserved_pc->second;
 }

+/**
+ * returns true if there is an entry reserved for this address,
+ * and false otherwise
+ */
+bool
+isReserved(Addr vaddr) const
+{
+auto reserved_pc = reservedPCs.find(vaddr);
+bool is_reserved = (reserved_pc != reservedPCs.end());
+return is_reserved;
+}
+
 void fetchDone(Addr vaddr);

 /**

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/29932
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings


Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I3b80dbd71af27ccf790b543bd5c034bb9b02624a
Gerrit-Change-Number: 29932
Gerrit-PatchSet: 1
Gerrit-Owner: Anthony Gutierrez 
Gerrit-Reviewer: Onur Kayıran 
Gerrit-Reviewer: Tony Gutierrez 
Gerrit-MessageType: newchange
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s