HDLRuby 3.7.3 → 3.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 78d08a6a222a4f33398c1d92e8b1f7d9462597b22ea2c48306318fb3e3e9c82d
4
- data.tar.gz: 4a52c34a1355369260b0c162df38b7714ad1cedf4ed56ab7bc023eb01d2b7e40
3
+ metadata.gz: ab26bbb8abf18f4655b96e3db5109c32495edff20c80bf9e00522583b909bf91
4
+ data.tar.gz: e5434d17932f1aa1f4af983a88d53e3a38e7f38dfb91bf4233e5733fb07da36a
5
5
  SHA512:
6
- metadata.gz: d35ac48b9832cd591a03be9db90574021ccf2ee73a784fd3b608487f8addff48295f7043ee2c0a31aeccec0cba00866828da94b63aa6f319e61c9ac812be64bb
7
- data.tar.gz: ddd87fe50aedb38521627cbaf5c6467c7ea59146d10c2e62f1069de2ae90859013d20e312b1b40fdc36a94d04cc02278aeaafa59227c3d71f340544e31f03067
6
+ metadata.gz: b3e62cf9f604e98b32a46b4b74fd7b82caf083f72baf25da70ebbdd941f65ac94645be9e3ed636e25ff3bf01e2d347f9700e4a294b70e630f61f2f875b2b5f5a
7
+ data.tar.gz: a9c531751ca079b4cd98c249d2b1a56c753482233e5d21dfba0b3a4a86f8063f516d31743c34f2f4181320bcee86d9703a20b6ef2b38c1013ab60b1cc69e5aab
data/README.md CHANGED
@@ -3987,7 +3987,7 @@ end
3987
3987
 
3988
3988
  #### Using Software Sequencer Inside a HDLRuby program.
3989
3989
 
3990
- HDLRuby supports hardware/software co-design through the `program` [construct](#declaring-a-software-component). Since software sequencers are software components, they can be used within this construct when the selected language is Ruby. They can also be used with the C language, but in that case, the corresponding C code must first be generated.
3990
+ HDLRuby supports hardware/software co-design through the `program` [construct](#declaring-a-software-component). Since software sequencers are software components, they can be used within this construct when the selected language is Ruby, however the command `activate_sequencer_sw(binding)` must be inserted in the first line of the Ruby code. Software sequencers can also be used with the C language, but in that case, the corresponding C code must first be generated.
3991
3991
 
3992
3992
  For Ruby, software sequencer signals can be automatically connected to the ports of the program construct by declaring them as input signals for `inport` and output signals for `outport`. For example, the following code describes a software sequencer that echoes the value from the input port `inP` to the output port `outP` (`sig0` and `sig1` are signals from the upper RTL design).
3993
3993
 
@@ -3997,6 +3997,7 @@ program(:ruby) do
3997
3997
  inport inP: sig0
3998
3998
  outport outP: sig1
3999
3999
  code do
4000
+ activate_sequencer_sw(binding)
4000
4001
  input :inP
4001
4002
  output :outP
4002
4003
  sequencer do
@@ -1978,7 +1978,7 @@ module RubyHDL::High
1978
1978
 
1979
1979
  # Convert to Ruby code.
1980
1980
  def to_ruby
1981
- return "case(#{@sel.to_}) ; " +
1981
+ return "case(#{@sel.to_ruby}) ; " +
1982
1982
  @choices.map.with_index do |choice,i|
1983
1983
  "when #{i} ; #{choice.to_ruby} ; "
1984
1984
  end.join + "end"
@@ -3638,6 +3638,19 @@ module RubyHDL::High
3638
3638
  self << expr.seach.with_index(&ruby_block)
3639
3639
  end
3640
3640
 
3641
+ # Implements a multiplexer.
3642
+ def mux(cond, *choices)
3643
+ return Select.new(choices[0].type,:mux,cond,*choices)
3644
+ end
3645
+
3646
+ # Displays a string for debugging purpose.
3647
+ def hprint(*args)
3648
+ args.each do |arg|
3649
+ arg = arg.to_value if arg.is_a?(RubyHDL::High::Expression)
3650
+ print arg
3651
+ end
3652
+ end
3653
+
3641
3654
  # The SW-specific statements and expressions.
3642
3655
 
3643
3656
  # Mark a synchronisation.
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "3.7.3"
2
+ VERSION = "3.7.4"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HDLRuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.3
4
+ version: 3.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovic Gauthier
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-04-14 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bundler
@@ -494,7 +494,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
494
494
  - !ruby/object:Gem::Version
495
495
  version: '0'
496
496
  requirements: []
497
- rubygems_version: 3.6.6
497
+ rubygems_version: 3.6.8
498
498
  specification_version: 4
499
499
  summary: HDLRuby is a library for describing and simulating digital electronic systems.
500
500
  test_files: []