Sha256: 5e1a57dff4bf35e12972ff3705a40ea8662c0a5110bc67e49738d71f889377fb

Contents?: true

Size: 424 Bytes

Versions: 41

Compression:

Stored size: 424 Bytes

Contents

# A simple 16-bit adder
system :adder do
    [15..0].input :x,:y
    [16..0].output :s

    s <= x.as(bit[17]) + y
end

# A benchmark for the adder.
system :adder_bench do
    [15..0].inner :x,:y
    [16..0].inner :s

    adder(:my_adder).(x,y,s)

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

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
HDLRuby-3.4.0 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-3.3.4 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-3.3.3 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-3.3.1 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-3.3.0 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-3.2.0 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-3.1.0 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-3.0.0 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.12 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.11 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.10 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.9 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.8 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.7 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.5 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.4 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.3 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.2 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.11.0 lib/HDLRuby/hdr_samples/adder_bench.rb
HDLRuby-2.10.5 lib/HDLRuby/hdr_samples/adder_bench.rb