From 544bf8bde79bd4785c63faec1c5f10a73d501ac7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tiago=20M=C3=BCck?= Date: Thu, 28 May 2020 12:31:03 -0500 Subject: [PATCH] mem-ruby: Expose MessageBuffer methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit SLICC interface for checking the capacity of MessageBuffers Change-Id: I28e2d22a405d33fcbe6a183dffc31bd936fa26c4 Signed-off-by: Tiago Mück Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31271 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/mem/ruby/protocol/RubySlicc_Types.sm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mem/ruby/protocol/RubySlicc_Types.sm b/src/mem/ruby/protocol/RubySlicc_Types.sm index a7b9d345b..af7c0170b 100644 --- a/src/mem/ruby/protocol/RubySlicc_Types.sm +++ b/src/mem/ruby/protocol/RubySlicc_Types.sm @@ -48,7 +48,15 @@ // undefined declaration error. // -external_type(MessageBuffer, buffer="yes", inport="yes", outport="yes"); +structure(MessageBuffer, buffer="yes", inport="yes", outport="yes", + external = "yes", primitive="yes") { + // NOTE: it's recommended to use SLICC's built in resource stall management. + // These functions are mostly for including resource utilization info + // in debug traces dumped by the protocol. + bool areNSlotsAvailable(int n, Tick curTime); + int getSize(Tick curTime); +} + external_type(Scalar, primitive="yes"); structure(OutPort, external = "yes", primitive="yes") { -- 2.30.2