Sha256: 010579528c4dd789a767771bd277b9189f6a419d551b870e4876411eca2b2f65

Contents?: true

Size: 714 Bytes

Versions: 6

Compression:

Stored size: 714 Bytes

Contents

# Test the comparison operators.

# A benchmark for the comparators.
system :comparison_bench do
    [8].inner :x, :y
    signed[8].inner :u,:v
    inner :ue, :ult, :ule, :ugt, :uge
    inner :se, :slt, :sle, :sgt, :sge

    par do
        ue  <= (x == y)
        ult <= (x < y)
        ule <= (x <= y)
        ugt <= (x > y)
        uge <= (x >= y)

        se  <= (u == v)
        slt <= (u < v)
        sle <= (u <= v)
        sgt <= (u > v)
        sge <= (u >= v)
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

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