Sha256: 2e27cd04b10760ff95212f338571f4477694e61b1436fbd09dc667df979b00c3

Contents?: true

Size: 1.14 KB

Versions: 19

Compression:

Stored size: 1.14 KB

Contents

##
# A simple system for testing hw print and strings.
######################################################

system :with_print do
    input  :clk, :rst
    [4].output :counter

    seq(clk.posedge) do
        hif(rst) do
            counter <= 0
        end
        helse do
            counter <= counter + 1
            hprint("In '#{__FILE__}' line #{__LINE__}: ")
            hprint("Counter=", counter, "\n")
        end
    end
end

# A benchmark for the dff.
system :with_print_bench do
    inner :clk, :rst
    [4].inner :counter

    with_print(:my_print).(clk,rst,counter)

    timed do
        clk <= 0
        rst <= 0
        !10.ns
        clk <= 1
        rst <= 0
        !10.ns
        clk <= 0
        rst <= 1
        !10.ns
        clk <= 1
        rst <= 1
        !10.ns
        clk <= 0
        rst <= 0
        !10.ns
        clk <= 1
        !10.ns
        clk <= 0
        !10.ns
        clk <= 1
        !10.ns
        clk <= 0
        !10.ns
        clk <= 1
        !10.ns
        clk <= 0
        !10.ns
        clk <= 1
        !10.ns
    end


    # cur_system.properties[:pre_driver] = "drivers/hw_print.rb", :hw_print_generator
end

Version data entries

19 entries across 19 versions & 1 rubygems

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