Sha256: 96c261cfcc9b06ccc8479e856187b09050d26d80e3aa711cf76ed1adebb4bd5c

Contents?: true

Size: 648 Bytes

Versions: 6

Compression:

Stored size: 648 Bytes

Contents

# A benchmark for the logic operations.
system :logic_bench do
    [3].inner :x,:y
    [3].inner :s_not, :s_and, :s_or, :s_xor, :s_nxor
    
    signed[16].inner :a,:b,:shl,:shr

    timed do
        8.times do |i|
            8.times do |j|
                x      <= i
                y      <= j
                s_not  <= ~x
                s_and  <= x & y
                s_or   <= x | y
                s_xor  <= x ^ y
                s_nxor <= (x == y)
                !10.ns
                a      <= i
                b      <= j
                shl    <= (a << b)
                shr    <= (a >> b)
            end
        end
    end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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