Sha256: 277efdaff21c86a0c0d16ec3e166f882487c8b683e5ba1fcf6430404898b5cab

Contents?: true

Size: 660 Bytes

Versions: 6

Compression:

Stored size: 660 Bytes

Contents

## 
#  Sample testing named sub
#######################################


# A simple circuit with named sub
system :named_sub do |x|
    input  :y
    output :s, :z

    sub :somesub do
        inner :sig
    end

    seq do
        somesub.sig <= x | y
        s <= ~somesub.sig
    end

    z <= s

end

# A benchmark for the circuit.
system :named_sub_bench do
    inner :x, :y, :s, :z

    named_sub(x).(:my_named_sub).(y,s)

    z <= my_named_sub.z

    timed do
        x <= 0
        y <= 0
        !10.ns
        x <= 1
        y <= 0
        !10.ns
        x <= 0
        y <= 1
        !10.ns
        x <= 1
        y <= 1
        !10.ns
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
HDLRuby-3.4.0 lib/HDLRuby/hdr_samples/named_sub.rb
HDLRuby-3.3.4 lib/HDLRuby/hdr_samples/named_sub.rb
HDLRuby-3.3.3 lib/HDLRuby/hdr_samples/named_sub.rb
HDLRuby-3.3.1 lib/HDLRuby/hdr_samples/named_sub.rb
HDLRuby-3.3.0 lib/HDLRuby/hdr_samples/named_sub.rb
HDLRuby-3.2.0 lib/HDLRuby/hdr_samples/named_sub.rb