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 +4 -4
- data/README.md +1 -1
- data/lib/HDLRuby/hdr_samples/with_of.rb +51 -0
- data/lib/HDLRuby/hdr_samples/with_reconf.rb +0 -5
- data/lib/HDLRuby/hruby_high.rb +25 -2
- data/lib/HDLRuby/hruby_low.rb +0 -1
- data/lib/HDLRuby/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96e1ddbe94d4b2b40301b61373ed4cea3b2b5bcb461338844af6ebd23380ad4f
|
4
|
+
data.tar.gz: e8e3c5bdc2c7a91c25f41964a15a80a39701c54a49b09540c637b14130bc08e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/HDLRuby/hruby_high.rb
CHANGED
@@ -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)
|
data/lib/HDLRuby/hruby_low.rb
CHANGED
data/lib/HDLRuby/version.rb
CHANGED
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.
|
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-
|
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
|