HDLRuby 2.2.10 → 2.2.11

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: 7b867bb3b74debaa536d2803c7646dd4bb6b1af3b9d6dfee8e2dd321137c05da
4
- data.tar.gz: 7c6c21d6f808759241a5789993579fc49dd7acfbea2be645075044528d9d4a25
3
+ metadata.gz: 45a409a3630e4f26134448f447632f9e4eddb54de95fbae8c1e7594675b7cd8b
4
+ data.tar.gz: 721ad1ff712c254d78375cfab46383ba88865ba916e58fc76488816f8143caa8
5
5
  SHA512:
6
- metadata.gz: 663010998dbe51f0123d68e9fc785441e115ee54744f73b36be4bdc8de81103884933222b1a368f5c86809b71118e7b7ebd5e73f2f6e9179547a2971e501c8ef
7
- data.tar.gz: 51d7866a4643f05cac41971be813ce43c039949fbbcdb2cfb30280b3fd27d13cbf82a378e4f1151b6b9f1e13d79d4a4a8e4e7172a072cc5e748c8327cc15cd65
6
+ metadata.gz: d07edc7c5ad0efff6b69050ac4eec19001ac0d2225e2082564591feba3f1ce77ba048dfffb587d58c16e7e2b4b810c9b3345f495d49ff4a0928e842c601550ae
7
+ data.tar.gz: d5299bf02d8ef3f7d2b0a185152b8a3dbd298b2725bef2365a42a276c7c45b27cf3b900f581bd46a9a35410b853abf412189101d2ad83d4de3cb2cbbf0501c50
@@ -428,6 +428,22 @@ module HDLRuby::High
428
428
  return res
429
429
  end
430
430
 
431
+
432
+ # Gets an output signal by +name+ considering also the included
433
+ # systems
434
+ def get_output_with_included(name)
435
+ # Look in self.
436
+ found = self.get_output(name)
437
+ return found if found
438
+ # Not in self, look in the included systems.
439
+ self.scope.each_included do |included|
440
+ found = included.get_output_with_included(name)
441
+ return found if found
442
+ end
443
+ # Not found
444
+ return nil
445
+ end
446
+
431
447
  # Iterates over the all interface signals, i.e, also the ones of
432
448
  # the included systems.
433
449
  #
@@ -1919,12 +1935,13 @@ module HDLRuby::High
1919
1935
  else
1920
1936
  # No, perform a connection is order of declaration
1921
1937
  connects.each.with_index do |csig,i|
1922
- # puts "csig=#{csig} i=#{i}"
1938
+ # puts "csig=#{csig.name} i=#{i}"
1923
1939
  # puts "systemT inputs=#{systemT.each_input.to_a.size}"
1924
1940
  # Gets i-est signal to connect
1925
1941
  ssig = self.systemT.get_interface_with_included(i)
1926
1942
  # Check if it is an output.
1927
- isout = self.get_output(ssig.name)
1943
+ isout = self.systemT.get_output_with_included(ssig.name)
1944
+ # puts "ssig=#{ssig.name} isout=#{isout}"
1928
1945
  # Convert it to a reference.
1929
1946
  ssig = RefObject.new(self.to_ref,ssig)
1930
1947
  # Make the connection.
@@ -2576,11 +2576,25 @@ module HDLRuby::Low
2576
2576
  def block
2577
2577
  if self.is_a?(Block)
2578
2578
  return self
2579
+ elsif self.parent.is_a?(Scope)
2580
+ # No block
2581
+ return nil
2579
2582
  else
2580
2583
  return self.parent.block
2581
2584
  end
2582
2585
  end
2583
2586
 
2587
+ # Get the scope of the statement.
2588
+ def scope
2589
+ if self.parent.is_a?(Scope) then
2590
+ return self.parent
2591
+ elsif self.parent.is_a?(Behavior) then
2592
+ return self.parent.parent
2593
+ else
2594
+ return self.parent.scope
2595
+ end
2596
+ end
2597
+
2584
2598
  # Gets the top block, i.e. the first block of the current behavior.
2585
2599
  def top_block
2586
2600
  return self.parent.is_a?(Behavior) ? self : self.parent.top_block
@@ -2588,7 +2602,7 @@ module HDLRuby::Low
2588
2602
 
2589
2603
  # Gets the top scope, i.e. the first scope of the current system.
2590
2604
  def top_scope
2591
- return self.top_block.parent.top_scope
2605
+ return self.scope.top_scope
2592
2606
  end
2593
2607
  end
2594
2608
 
@@ -102,6 +102,8 @@ module HDLRuby::Low
102
102
  self.each_connection do |connection|
103
103
  connection.each_node_deep do |node|
104
104
  if instance_port?(node) then
105
+ # puts "port for node: #{node.ref.name}.#{node.name}"
106
+ # puts "leftvalue? #{node.leftvalue?}"
105
107
  refs << node
106
108
  ref_sym2leftvalue[node.to_sym] = node.leftvalue?
107
109
  end
@@ -87,9 +87,10 @@ module HDLRuby::Low
87
87
  blk = LowWithoutSelect.selects2block(selects)
88
88
  # Add a transmit replacing the connection.
89
89
  blk.add_statement(
90
- Transmit.new(self.left.clone,self.right.clone))
90
+ Transmit.new(connection.left.clone,
91
+ connection.right.clone))
91
92
  # Remove the connection and add a behavior instead.
92
- self.remove_connection(connection)
93
+ self.delete_connection!(connection)
93
94
  self.add_behavior(Behavior.new(blk))
94
95
  end
95
96
  end
@@ -223,7 +224,14 @@ module HDLRuby::Low
223
224
  selects << [self,sig]
224
225
  # Create the signal replacing self.
225
226
  blk = self.statement.block
226
- blk.add_inner(sig)
227
+ if blk then
228
+ # Add the signal in the block.
229
+ blk.add_inner(sig)
230
+ else
231
+ # No block, this is a connection, add the signal in the
232
+ # socpe
233
+ self.statement.scope.add_inner(sig)
234
+ end
227
235
  # And return a reference to it.
228
236
  return RefName.new(sig.type,RefThis.new,sig.name)
229
237
  end
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "2.2.10"
2
+ VERSION = "2.2.11"
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.2.10
4
+ version: 2.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovic Gauthier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-18 00:00:00.000000000 Z
11
+ date: 2020-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler