Sha256: 26cc2eca140ca14c313d4947d28326ac0c913ac3d33bab11d328541afe23b767

Contents?: true

Size: 1.86 KB

Versions: 25

Compression:

Stored size: 1.86 KB

Contents

module HDLRuby::High::Std

##
# Standard HDLRuby::High library: handshake protocols.
#
########################################################################


    ## Module describing a simple client handshake for working.
    #  @param event the event to synchronize the handshake.
    #  @param req   the signal telling a request is there.
    #  @param cond  the condition allowing the protocol.
    system :hs_client do |event, req, cond=_1|
        input :reqI
        output ackI: 0

        # A each synchronization event.
        par(event) do
            # Is the protocol is allowed and a request is present.
            hif(cond & reqI) do
                # Yes perform the action and tell the request has been treated.
                req  <= 1 if req
                ackI <= 1
            end
            helse do
                # No, do not perform the action, and do not acknowledge.
                req  <= 0 if req
                ackI <= 0
            end
        end
    end


    ## Module describing a simple server handshake for working.
    #  @param event the event to synchronize the handshake.
    #  @param req   the signal for asking a new request.
    system :hs_server do |event, req|
        output reqO: 0
        input  :ackO

        # A each synchronization event.
        par(event) do
            # Shall we start the output?
            hif(ackO)  { reqO <= 0 }
            hif(req)   { reqO <= 1 }
        end
    end


    ## Module describing a pipe with handshakes.
    #  @param event the event to synchronize the handshakes.
    #  @param read  the signal telling there is a request from the client side
    #  @param write the signal used for asking the server to issue a request
    system :hs_pipe do |event,read,write|
        inner :cond
        include(hs_client(event,read,cond))
        include(hs_server(event,write))
        cond <= ~reqO
    end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
HDLRuby-3.6.2 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.6.1 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.6.0 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.5.1 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.5.0 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.4.0 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.3.4 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.3.3 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.3.1 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.3.0 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.2.0 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.1.0 lib/HDLRuby/std/handshakes.rb
HDLRuby-3.0.0 lib/HDLRuby/std/handshakes.rb
HDLRuby-2.11.12 lib/HDLRuby/std/handshakes.rb
HDLRuby-2.11.11 lib/HDLRuby/std/handshakes.rb
HDLRuby-2.11.10 lib/HDLRuby/std/handshakes.rb
HDLRuby-2.11.9 lib/HDLRuby/std/handshakes.rb
HDLRuby-2.11.8 lib/HDLRuby/std/handshakes.rb
HDLRuby-2.11.7 lib/HDLRuby/std/handshakes.rb
HDLRuby-2.11.5 lib/HDLRuby/std/handshakes.rb