Skip to content

Conversation

shundroid
Copy link
Collaborator

Elastic-miter needs to know the number of buffered tokens. This PR adds an attr debugCounter to BufferOp to enable the export of token counter.

This PR is needed by #391 and I totally forgot about it.

Since the counter is also useful for RTL debugging, I also added the counter to the VHDL beta backend.

Copy link
Collaborator

@murphe67 murphe67 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

can you add a lot more comments everywhere?

"""


def generate_buffer_counter_embedding(name):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this called embedding?

Handshake_BufferTypeAttr:$bufferType,
ConfinedAttr<I64Attr, [IntMinValue<1>]>:$numSlots
ConfinedAttr<I64Attr, [IntMinValue<1>]>:$numSlots,
BoolAttr:$debugCounter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use default here to avoid it cluttering up the IR?

// CHECK: }
handshake.func @bufferBW(%arg0: !handshake.channel<i32>, %start: !handshake.control<>) -> !handshake.channel<i16> {
%buf = buffer %arg0, bufferType = ONE_SLOT_BREAK_DV, numSlots = 1 : <i32>
%buf = buffer %arg0, bufferType = ONE_SLOT_BREAK_DV, numSlots = 1 {debugCounter = false} : <i32>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if default of false you can remove these changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants