hlslibs / matchlib_connections

Matchlib Connections Library - latency insensitive channels (from NVlabs/matchlib/connections)
Other
35 stars 9 forks source link

Add PushBOrNB/PopBOrNB to In/Out #1

Open adentinger opened 1 year ago

adentinger commented 1 year ago

Some hardware syntheses require driving interfaces with blocking beats part of the time, and non-blocking beats part of the time. However, calling both Push() and PushNB() (or both Pop() and PopNB()) on the same interface, even in separate parts of the code to synthesize, causes Catapult HLS to stop with the error "Multiple writers to signal <signal name>".

In some cases, it may be possible to call PushNB()/PopNB() inside a loop to implement blocking-like behavior only using the non-blocking function. However, some protocols, such as AXI4-Stream, mandate that "Once <signal> is asserted it must remain asserted until the handshake occurs", so such an implementation would be invalid.

PushBOrNB() and PopBOrNB() therefore implement a single ModularIO protocol that is able to perform both blocking and non-blocking beats.