Sha256: c0a9f2e65bd17241ff78e0315a33bfc1a9e7773296452b128a4b62f311a4692f

Contents?: true

Size: 395 Bytes

Versions: 33

Compression:

Stored size: 395 Bytes

Contents

# Test the comparison operators.

# A benchmark for the if statement.
system :if_bench do
    [8].inner :x, :y, :z

    par do
        hif(x == y)   { z <= 1 }
        helsif(x < y) { z <= 2 }
        helse         { z <= 3 }
    end

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

Version data entries

33 entries across 33 versions & 1 rubygems

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