Sha256: 29cbd0e35494275bf450a44cdc494cee09500555d3cf98fdd2e5a89d47fe6ef4

Contents?: true

Size: 546 Bytes

Versions: 100

Compression:

Stored size: 546 Bytes

Contents

require 'HDLRuby'

configure_high


# Describes an 16-bit shift register.
system :shift16 do
    input :clk, :rst, :din
    output :dout

    [15..0].inner :reg

    dout <= reg[15] # The output is the last bit of the register.

    par(clk.posedge) do
        hif(rst) { reg <= 0 }
        helse seq do
            reg[0] <= din
            reg[15..1] <= reg[14..0]
        end 
    end
end

# Instantiate it for checking.
shift16 :shift16I

# Generate the low level representation.
low = shift16I.systemT.to_low

# Displays it
puts low.to_yaml

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
HDLRuby-2.10.3 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.10.2 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.9.0 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.8.1 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.7.11 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.7.5 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.7.1 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.25 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.24 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.23 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.22 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.19 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.18 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.16 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.15 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.10 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.8 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.5 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.4 lib/HDLRuby/high_samples/shift.rb
HDLRuby-2.6.3 lib/HDLRuby/high_samples/shift.rb