HDLRuby 2.8.1 → 2.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 90d139cd510b6600a32249a2e27969f6c415a49d9b26ba51ed84d20dcc82f2ba
4
- data.tar.gz: b064d08cfbd46ae6fa4dffc7536a2dece4aed9c1c7588118502df79dd288c5bb
3
+ metadata.gz: 96e1ddbe94d4b2b40301b61373ed4cea3b2b5bcb461338844af6ebd23380ad4f
4
+ data.tar.gz: e8e3c5bdc2c7a91c25f41964a15a80a39701c54a49b09540c637b14130bc08e6
5
5
  SHA512:
6
- metadata.gz: 40ced20f6723ff46f4c02a033c1d194e5ce267c75e7f2c22e6c70dd6f51ae9b530ebdc7dc7150970f3fefbf2ec4663c965a3a3fddf1c1b2369d6dac42317ba0c
7
- data.tar.gz: 7782898ea6de9b5e42015f84dc56929ecd038baf42337c1f69f96bc644f0692ddd00ada0db0f9910b8ae7d93d2516ed4b3819c9f8735268d0a952f72b56bb37e
6
+ metadata.gz: 2c63c50fb2aa3683cb43246b0036ccbe89155ad08d122f738a6ba68bd0886a089608ddc6592d0a728dc7476d00e480ed1f8e0ba4ac97dd97dcbb994099598f90
7
+ data.tar.gz: 04ee073e082ab0cc9993a7f7888d85959570e969bf83b3247874df6888559be8c4a8d561d5276a9c9d8042f86302b95d4454bb7803aec0e41210c1c747cc4fba
data/README.md CHANGED
@@ -439,7 +439,7 @@ The description above is straight forward, but it would be necessary to rewrite
439
439
 
440
440
  ```ruby
441
441
  system :sumprod do |typ,coefs|
442
- typ[coefs.size].input ins
442
+ typ[coefs.size].input :ins
443
443
  typ.output :o
444
444
 
445
445
  o <= coefs.each_with_index.reduce(_0) do |sum,(coef,i)|
@@ -0,0 +1,51 @@
1
+ # Some abstract system.
2
+ system :sysA do
3
+ input :clk,:rst
4
+ input :d
5
+ output :q
6
+ end
7
+
8
+ # Some inheriting system.
9
+ system :sysH, sysA do
10
+ par(clk.posedge, rst.posedge) do
11
+ hprint("sys1\n")
12
+ q <= d & ~rst
13
+ end
14
+ end
15
+
16
+ # Another system that have nothing to see with the others.
17
+ # Some abstract system.
18
+ system :sysO do
19
+ input :clk,:rst
20
+ input :d
21
+ output :q
22
+
23
+ par(clk.posedge, rst.posedge) do
24
+ hprint("sys1\n")
25
+ q <= d & ~rst
26
+ end
27
+ end
28
+
29
+
30
+ # A system for testing inheritance and of?
31
+ system :with_reconf do
32
+ input :clk,:rst
33
+ input :d
34
+ output :q
35
+
36
+ # Instantiate the abstract system.
37
+ sysA(:my_dffA).(clk,rst,d,q)
38
+
39
+ # Test the of?
40
+ puts "my_dffA.systemT.of?(sysA)=#{my_dffA.systemT.of?(sysA)}"
41
+ puts "my_dffA.systemT.of?(sysH)=#{my_dffA.systemT.of?(sysH)}"
42
+ puts "my_dffA.systemT.of?(sysO)=#{my_dffA.systemT.of?(sysO)}"
43
+
44
+ # Instantiate the inheriting system.
45
+ sysH(:my_dffH).(clk,rst,d,q)
46
+
47
+ # Test the of?
48
+ puts "my_dffH.systemT.of?(sysH)=#{my_dffH.systemT.of?(sysH)}"
49
+ puts "my_dffH.systemT.of?(sysA)=#{my_dffH.systemT.of?(sysA)}"
50
+ puts "my_dffH.systemT.of?(sysO)=#{my_dffH.systemT.of?(sysO)}"
51
+ end
@@ -1,8 +1,3 @@
1
- require 'std/reconf.rb'
2
-
3
- include HDLRuby::High::Std
4
-
5
-
6
1
 
7
2
  # Some system that can be used for reconfiguration.
8
3
  system :sys0 do
@@ -344,6 +344,7 @@ module HDLRuby::High
344
344
  def initialize(name, *mixins, &ruby_block)
345
345
  # Initialize the system type structure.
346
346
  super(name,Scope.new(name,self))
347
+ # puts "new systemT=#{self}"
347
348
 
348
349
  # Initialize the set of extensions to transmit to the instances'
349
350
  # eigen class
@@ -373,6 +374,28 @@ module HDLRuby::High
373
374
  make_instantiater(name,SystemI,&ruby_block)
374
375
  end
375
376
 
377
+
378
+ # Tell if the current system is a descedent of +system+
379
+ def of?(system)
380
+ # Maybe self is system.
381
+ if (self == system) then
382
+ # Yes, consider it is adescendent of system.
383
+ return true
384
+ else
385
+ # Look into the generators.
386
+ @generators.each do |generator|
387
+ return true if generator.of?(system)
388
+ end
389
+ # Look into the included systems.
390
+ @to_includes.each do |included|
391
+ return true if included.of?(system)
392
+ end
393
+ end
394
+ # Not found.
395
+ return false
396
+ end
397
+
398
+
376
399
  # Converts to a namespace user.
377
400
  def to_user
378
401
  # Returns the scope.
@@ -571,6 +594,7 @@ module HDLRuby::High
571
594
 
572
595
  # Sets the generators of the expanded result.
573
596
  expanded.add_generator(self)
597
+ # puts "expanded=#{expanded}"
574
598
  @to_includes.each { |system| expanded.add_generator(system) }
575
599
  # Also for the previously includeds. */
576
600
  self.scope.each_included.each { |system| expanded.add_generator(system) }
@@ -634,9 +658,8 @@ module HDLRuby::High
634
658
 
635
659
  # Create the instance and sets its eigen system to +eigen+.
636
660
  instance = @instance_class.new(i_name,eigen)
661
+ # puts "instance=#{instance}"
637
662
  eigen.eigenize(instance)
638
- # puts "instance interface=#{instance.each_signal.to_a.size}"
639
- # puts "eigen interface=#{eigen.each_signal.to_a.size}"
640
663
 
641
664
  # Extend the instance.
642
665
  instance.eigen_extend(@singleton_instanceO)
@@ -164,7 +164,6 @@ module HDLRuby::Low
164
164
  end
165
165
 
166
166
 
167
-
168
167
  # Handling the (re)configuration.
169
168
 
170
169
  # Gets the configuration wrapper if any.
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "2.8.1"
2
+ VERSION = "2.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HDLRuby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovic Gauthier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-22 00:00:00.000000000 Z
11
+ date: 2022-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -162,6 +162,7 @@ files:
162
162
  - lib/HDLRuby/hdr_samples/with_memory.rb
163
163
  - lib/HDLRuby/hdr_samples/with_memory_rom.rb
164
164
  - lib/HDLRuby/hdr_samples/with_multi_channels.rb
165
+ - lib/HDLRuby/hdr_samples/with_of.rb
165
166
  - lib/HDLRuby/hdr_samples/with_reconf.rb
166
167
  - lib/HDLRuby/hdr_samples/with_reduce.rb
167
168
  - lib/HDLRuby/hdr_samples/with_ref_array.rb