HDLRuby 2.6.10 → 2.6.15

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: 219077a50d543c3ecdb964a7bd7571f5c0db02ece82a0efb7670e5531acf437d
4
- data.tar.gz: 2bbff4911a6c7ff9ec3c33287b61d4a1b7efd5c7dc789975d89e53b3f42638c1
3
+ metadata.gz: 639411f380dad2eb07b933ae8d23f558dc32e488ceadf1af897026b353a4164b
4
+ data.tar.gz: 8fb94917c40db1b73a63d323efdc04bbb1e5ebcb65460ebe42c0c468a75ac221
5
5
  SHA512:
6
- metadata.gz: c95ef3fa229c2e9283cd78f86c9f6fa4ad4f80d0e3f6153ee444e2c75d754dc7098a5547ce623f8aa85b1860e24522f8404a6e654849d0250897acca26134f9a
7
- data.tar.gz: '023502192d5189e2a85a4d69d3f63bb81d58d38496812be03b8c7c5c92791309412e21cbb4d68aa79f03372d296635cafe55264e5483d12d8eef56236b188aeb'
6
+ metadata.gz: 0d00decbd699cc46f450c913b98e5d881fc10e3a9d171126bc3744ad8d05408536b38bc90d1d15227da67302570a425eb2ceccef7d65959e19f591a35aa1f00c
7
+ data.tar.gz: 9a2f9568732a851786fdfcd794ab146efa4ea36458163a11fe6c992c59bd53f643cd4691804f68e3438f8ce233996af7dd0d8ba205834596bf2b8c7d442ca69d
data/lib/HDLRuby/hdrcc.rb CHANGED
@@ -491,24 +491,28 @@ end
491
491
 
492
492
  # Generate the result.
493
493
  # Get the top systemT.
494
+ puts Time.now
494
495
  $top_system = $top_instance.to_low.systemT
495
-
496
-
497
- # Apply the pre drivers if any.
498
- Hdecorator.each_with_property(:pre_driver) do |obj, value|
499
- unless value.is_a?(Array) && value.size == 2 then
500
- raise "pre_driver requires a driver file name command name."
501
- end
502
- # Load the driver.
503
- require_relative(value[0].to_s)
504
- # Ensure obj is the low version.
505
- if obj.properties.key?(:high2low) then
506
- # obj is high, get the corresponding low.
507
- obj = obj.properties[:high2low][0]
508
- end
509
- # Execute it.
510
- send(value[1].to_sym,obj,*value[2..-1])
511
- end
496
+ $top_intance = nil # Free as much memory as possible.
497
+ puts "##### Top system built #####"
498
+ puts Time.now
499
+
500
+
501
+ # # Apply the pre drivers if any.
502
+ # Hdecorator.each_with_property(:pre_driver) do |obj, value|
503
+ # unless value.is_a?(Array) && value.size == 2 then
504
+ # raise "pre_driver requires a driver file name command name."
505
+ # end
506
+ # # Load the driver.
507
+ # require_relative(value[0].to_s)
508
+ # # Ensure obj is the low version.
509
+ # if obj.properties.key?(:high2low) then
510
+ # # obj is high, get the corresponding low.
511
+ # obj = obj.properties[:high2low][0]
512
+ # end
513
+ # # Execute it.
514
+ # send(value[1].to_sym,obj,*value[2..-1])
515
+ # end
512
516
 
513
517
 
514
518
  # Gather the non-HDLRuby code.
@@ -558,15 +562,23 @@ elsif $options[:clang] then
558
562
  # top_system = $top_system
559
563
  # Preprocess the HW description for valid C generation.
560
564
  $top_system.each_systemT_deep do |systemT|
565
+ puts "seq2seq step..."
561
566
  # Coverts the par blocks in seq blocks to seq blocks to match
562
567
  # the simulation engine.
563
568
  systemT.par_in_seq2seq!
569
+ puts Time.now
570
+ puts "connections_to_behaviors step..."
564
571
  # Converts the connections to behaviors.
565
572
  systemT.connections_to_behaviors!
573
+ puts Time.now
566
574
  # Break the RefConcat.
575
+ puts "concat_assigns step..."
567
576
  systemT.break_concat_assigns!
577
+ puts Time.now
568
578
  # Explicits the types.
579
+ puts "explicit_types step..."
569
580
  systemT.explicit_types!
581
+ puts Time.now
570
582
  end
571
583
  # Generate the C.
572
584
  if $options[:multiple] then
@@ -691,14 +703,26 @@ elsif $options[:verilog] then
691
703
  # top_system = $top_system
692
704
  # Make description compatible with verilog generation.
693
705
  $top_system.each_systemT_deep do |systemT|
706
+ puts "casts_without_expression! step..."
694
707
  systemT.casts_without_expression!
708
+ puts Time.now
709
+ puts "to_upper_space! step..."
695
710
  systemT.to_upper_space!
711
+ puts Time.now
712
+ puts "to_global_space! step..."
696
713
  systemT.to_global_systemTs!
714
+ puts Time.now
697
715
  # systemT.break_types!
698
716
  # systemT.expand_types!
717
+ puts "par_in_seq2seq! step..."
699
718
  systemT.par_in_seq2seq!
719
+ puts Time.now
720
+ puts "initial_concat_to_timed! step..."
700
721
  systemT.initial_concat_to_timed!
722
+ puts Time.now
723
+ puts "with_port! step..."
701
724
  systemT.with_port!
725
+ puts Time.now
702
726
  end
703
727
  # # Verilog generation
704
728
  # $output << top_system.to_verilog
@@ -788,13 +812,13 @@ elsif $options[:vhdl] then
788
812
  end
789
813
  end
790
814
 
791
- # Apply the post drivers if any.
792
- Hdecorator.each_with_property(:post_driver) do |obj, value|
793
- # Load the driver.
794
- require_relative(value[0].to_s)
795
- # Execute it.
796
- send(value[1].to_sym,obj,$output)
797
- end
815
+ # # Apply the post drivers if any.
816
+ # Hdecorator.each_with_property(:post_driver) do |obj, value|
817
+ # # Load the driver.
818
+ # require_relative(value[0].to_s)
819
+ # # Execute it.
820
+ # send(value[1].to_sym,obj,$output)
821
+ # end
798
822
 
799
823
  # Dump the properties
800
824
  if $options[:dump] then
@@ -763,9 +763,9 @@ module HDLRuby::High
763
763
  systemTL = HDLRuby::Low::SystemT.new(HDLRuby.uniq_name(name),
764
764
  self.scope.to_low)
765
765
  # puts "New low from system #{self.name}: #{systemTL.name}"
766
- # For debugging: set the source high object
767
- systemTL.properties[:low2high] = self.hdr_id
768
- self.properties[:high2low] = systemTL
766
+ # # For debugging: set the source high object
767
+ # systemTL.properties[:low2high] = self.hdr_id
768
+ # self.properties[:high2low] = systemTL
769
769
 
770
770
  # Fills the interface of the new system
771
771
  # from the included systems.
@@ -1311,9 +1311,9 @@ module HDLRuby::High
1311
1311
  # Create the resulting low scope.
1312
1312
  # scopeL = HDLRuby::Low::Scope.new()
1313
1313
  scopeL = HDLRuby::Low::Scope.new(self.name)
1314
- # For debugging: set the source high object
1315
- scopeL.properties[:low2high] = self.hdr_id
1316
- self.properties[:high2low] = scopeL
1314
+ # # For debugging: set the source high object
1315
+ # scopeL.properties[:low2high] = self.hdr_id
1316
+ # self.properties[:high2low] = scopeL
1317
1317
 
1318
1318
  # Push the private namespace for the low generation.
1319
1319
  High.space_push(@namespace)
@@ -1545,9 +1545,9 @@ module HDLRuby::High
1545
1545
  def to_low(name = self.name)
1546
1546
  # return HDLRuby::Low::Type.new(name)
1547
1547
  typeL = HDLRuby::Low::Type.new(name)
1548
- # For debugging: set the source high object
1549
- typeL.properties[:low2high] = self.hdr_id
1550
- self.properties[:high2low] = typeL
1548
+ # # For debugging: set the source high object
1549
+ # typeL.properties[:low2high] = self.hdr_id
1550
+ # self.properties[:high2low] = typeL
1551
1551
  return typeL
1552
1552
  end
1553
1553
  end
@@ -1699,9 +1699,9 @@ module HDLRuby::High
1699
1699
  def to_low(name = self.name)
1700
1700
  # return HDLRuby::Low::TypeDef.new(name,self.def.to_low)
1701
1701
  typeDefL = HDLRuby::Low::TypeDef.new(name,self.def.to_low)
1702
- # For debugging: set the source high object
1703
- typeDefL.properties[:low2high] = self.hdr_id
1704
- self.properties[:high2low] = typeDefL
1702
+ # # For debugging: set the source high object
1703
+ # typeDefL.properties[:low2high] = self.hdr_id
1704
+ # self.properties[:high2low] = typeDefL
1705
1705
  return typeDefL
1706
1706
  end
1707
1707
  end
@@ -1752,9 +1752,9 @@ module HDLRuby::High
1752
1752
  def to_low(name = self.name)
1753
1753
  # return HDLRuby::Low::TypeDef.new(name,self.def.to_low)
1754
1754
  typeDefL = HDLRuby::Low::TypeDef.new(name,self.def.to_low)
1755
- # For debugging: set the source high object
1756
- typeDefL.properties[:low2high] = self.hdr_id
1757
- self.properties[:high2low] = typeDefL
1755
+ # # For debugging: set the source high object
1756
+ # typeDefL.properties[:low2high] = self.hdr_id
1757
+ # self.properties[:high2low] = typeDefL
1758
1758
  return typeDefL
1759
1759
  end
1760
1760
  end
@@ -1770,9 +1770,9 @@ module HDLRuby::High
1770
1770
  # self.range.to_low)
1771
1771
  typeVectorL = HDLRuby::Low::TypeVector.new(name,self.base.to_low,
1772
1772
  self.range.to_low)
1773
- # For debugging: set the source high object
1774
- typeVectorL.properties[:low2high] = self.hdr_id
1775
- self.properties[:high2low] = typeVectorL
1773
+ # # For debugging: set the source high object
1774
+ # typeVectorL.properties[:low2high] = self.hdr_id
1775
+ # self.properties[:high2low] = typeVectorL
1776
1776
  return typeVectorL
1777
1777
  end
1778
1778
  end
@@ -1850,9 +1850,9 @@ module HDLRuby::High
1850
1850
  # *@types.map { |type| type.to_low } )
1851
1851
  typeTupleL = HDLRuby::Low::TypeTuple.new(name,self.direction,
1852
1852
  *@types.map { |type| type.to_low } )
1853
- # For debugging: set the source high object
1854
- typeTupleL.properties[:low2high] = self.hdr_id
1855
- self.properties[:high2low] = typeTupleL
1853
+ # # For debugging: set the source high object
1854
+ # typeTupleL.properties[:low2high] = self.hdr_id
1855
+ # self.properties[:high2low] = typeTupleL
1856
1856
  return typeTupleL
1857
1857
  end
1858
1858
  end
@@ -1871,9 +1871,9 @@ module HDLRuby::High
1871
1871
  # @types.map { |name,type| [name,type.to_low] } )
1872
1872
  typeStructL = HDLRuby::Low::TypeStruct.new(name,self.direction,
1873
1873
  @types.map { |name,type| [name,type.to_low] } )
1874
- # For debugging: set the source high object
1875
- typeStructL.properties[:low2high] = self.hdr_id
1876
- self.properties[:high2low] = typeStructL
1874
+ # # For debugging: set the source high object
1875
+ # typeStructL.properties[:low2high] = self.hdr_id
1876
+ # self.properties[:high2low] = typeStructL
1877
1877
  return typeStructL
1878
1878
  end
1879
1879
  end
@@ -2111,9 +2111,9 @@ module HDLRuby::High
2111
2111
  # Creates the resulting HDLRuby::Low instance
2112
2112
  systemIL = HDLRuby::Low::SystemI.new(High.names_create(name),
2113
2113
  systemTL)
2114
- # For debugging: set the source high object
2115
- systemIL.properties[:low2high] = self.hdr_id
2116
- self.properties[:high2low] = systemIL
2114
+ # # For debugging: set the source high object
2115
+ # systemIL.properties[:low2high] = self.hdr_id
2116
+ # self.properties[:high2low] = systemIL
2117
2117
  # Adds the other systemTs.
2118
2118
  self.each_systemT do |systemT|
2119
2119
  systemIL.add_systemT(systemT.to_low) unless systemT == self.systemT
@@ -2139,9 +2139,9 @@ module HDLRuby::High
2139
2139
  lump = lump.respond_to?(:to_low) ? lump.to_low : lump.to_s
2140
2140
  lump
2141
2141
  end)
2142
- # For debugging: set the source high object
2143
- chunkL.properties[:low2high] = self.hdr_id
2144
- self.properties[:high2low] = chunkL
2142
+ # # For debugging: set the source high object
2143
+ # chunkL.properties[:low2high] = self.hdr_id
2144
+ # self.properties[:high2low] = chunkL
2145
2145
  return chunkL
2146
2146
  end
2147
2147
  end
@@ -2153,9 +2153,9 @@ module HDLRuby::High
2153
2153
  def to_low
2154
2154
  # Create the resulting code.
2155
2155
  codeL = HDLRuby::Low::Code.new
2156
- # For debugging: set the source high object
2157
- codeL.properties[:low2high] = self.hdr_id
2158
- self.properties[:high2low] = codeL
2156
+ # # For debugging: set the source high object
2157
+ # codeL.properties[:low2high] = self.hdr_id
2158
+ # self.properties[:high2low] = codeL
2159
2159
  # Add the low-level events.
2160
2160
  self.each_event { |event| codeL.add_event(event.to_low) }
2161
2161
  # Add the low-level code chunks.
@@ -2247,9 +2247,9 @@ module HDLRuby::High
2247
2247
  ifL = HDLRuby::Low::If.new(self.condition.to_low,
2248
2248
  self.yes.to_low,noL)
2249
2249
  self.each_noif {|cond,block| ifL.add_noif(cond.to_low,block.to_low)}
2250
- # For debugging: set the source high object
2251
- ifL.properties[:low2high] = self.hdr_id
2252
- self.properties[:high2low] = ifL
2250
+ # # For debugging: set the source high object
2251
+ # ifL.properties[:low2high] = self.hdr_id
2252
+ # self.properties[:high2low] = ifL
2253
2253
  return ifL
2254
2254
  end
2255
2255
  end
@@ -2272,9 +2272,9 @@ module HDLRuby::High
2272
2272
  # self.statement.to_low)
2273
2273
  whenL = HDLRuby::Low::When.new(self.match.to_low,
2274
2274
  self.statement.to_low)
2275
- # For debugging: set the source high object
2276
- whenL.properties[:low2high] = self.hdr_id
2277
- self.properties[:high2low] = whenL
2275
+ # # For debugging: set the source high object
2276
+ # whenL.properties[:low2high] = self.hdr_id
2277
+ # self.properties[:high2low] = whenL
2278
2278
  return whenL
2279
2279
  end
2280
2280
  end
@@ -2320,9 +2320,9 @@ module HDLRuby::High
2320
2320
  def to_low
2321
2321
  # Create the low level case.
2322
2322
  caseL = HDLRuby::Low::Case.new(@value.to_low)
2323
- # For debugging: set the source high object
2324
- caseL.properties[:low2high] = self.hdr_id
2325
- self.properties[:high2low] = caseL
2323
+ # # For debugging: set the source high object
2324
+ # caseL.properties[:low2high] = self.hdr_id
2325
+ # self.properties[:high2low] = caseL
2326
2326
  # Add each when case.
2327
2327
  self.each_when do |w|
2328
2328
  caseL.add_when(w.to_low)
@@ -2351,9 +2351,9 @@ module HDLRuby::High
2351
2351
  def to_low
2352
2352
  # return HDLRuby::Low::Delay.new(self.value, self.unit)
2353
2353
  delayL = HDLRuby::Low::Delay.new(self.value, self.unit)
2354
- # For debugging: set the source high object
2355
- delayL.properties[:low2high] = self.hdr_id
2356
- self.properties[:high2low] = delayL
2354
+ # # For debugging: set the source high object
2355
+ # delayL.properties[:low2high] = self.hdr_id
2356
+ # self.properties[:high2low] = delayL
2357
2357
  return delayL
2358
2358
  end
2359
2359
  end
@@ -2367,9 +2367,9 @@ module HDLRuby::High
2367
2367
  def to_low
2368
2368
  # return HDLRuby::Low::TimeWait.new(self.delay.to_low)
2369
2369
  timeWaitL = HDLRuby::Low::TimeWait.new(self.delay.to_low)
2370
- # For debugging: set the source high object
2371
- timeWaitL.properties[:low2high] = self.hdr_id
2372
- self.properties[:high2low] = timeWaitL
2370
+ # # For debugging: set the source high object
2371
+ # timeWaitL.properties[:low2high] = self.hdr_id
2372
+ # self.properties[:high2low] = timeWaitL
2373
2373
  return timeWaitL
2374
2374
  end
2375
2375
  end
@@ -2386,9 +2386,9 @@ module HDLRuby::High
2386
2386
  # self.delay.to_low)
2387
2387
  timeRepeatL = HDLRuby::Low::TimeRepeat.new(self.statement.to_low,
2388
2388
  self.delay.to_low)
2389
- # For debugging: set the source high object
2390
- timeRepeatL.properties[:low2high] = self.hdr_id
2391
- self.properties[:high2low] = timeRepeatL
2389
+ # # For debugging: set the source high object
2390
+ # timeRepeatL.properties[:low2high] = self.hdr_id
2391
+ # self.properties[:high2low] = timeRepeatL
2392
2392
  return timeRepeatL
2393
2393
  end
2394
2394
  end
@@ -2746,9 +2746,9 @@ module HDLRuby::High
2746
2746
  def to_low
2747
2747
  # return HDLRuby::Low::Cast.new(self.type.to_low,self.child.to_low)
2748
2748
  castL =HDLRuby::Low::Cast.new(self.type.to_low,self.child.to_low)
2749
- # For debugging: set the source high object
2750
- castL.properties[:low2high] = self.hdr_id
2751
- self.properties[:high2low] = castL
2749
+ # # For debugging: set the source high object
2750
+ # castL.properties[:low2high] = self.hdr_id
2751
+ # self.properties[:high2low] = castL
2752
2752
  return castL
2753
2753
  end
2754
2754
  end
@@ -2770,9 +2770,9 @@ module HDLRuby::High
2770
2770
  # self.child.to_low)
2771
2771
  unaryL = HDLRuby::Low::Unary.new(self.type.to_low, self.operator,
2772
2772
  self.child.to_low)
2773
- # For debugging: set the source high object
2774
- unaryL.properties[:low2high] = self.hdr_id
2775
- self.properties[:high2low] = unaryL
2773
+ # # For debugging: set the source high object
2774
+ # unaryL.properties[:low2high] = self.hdr_id
2775
+ # self.properties[:high2low] = unaryL
2776
2776
  return unaryL
2777
2777
  end
2778
2778
  end
@@ -2795,9 +2795,9 @@ module HDLRuby::High
2795
2795
  # self.left.to_low, self.right.to_low)
2796
2796
  binaryL = HDLRuby::Low::Binary.new(self.type.to_low, self.operator,
2797
2797
  self.left.to_low, self.right.to_low)
2798
- # For debugging: set the source high object
2799
- binaryL.properties[:low2high] = self.hdr_id
2800
- self.properties[:high2low] = binaryL
2798
+ # # For debugging: set the source high object
2799
+ # binaryL.properties[:low2high] = self.hdr_id
2800
+ # self.properties[:high2low] = binaryL
2801
2801
  return binaryL
2802
2802
  end
2803
2803
  end
@@ -2830,9 +2830,9 @@ module HDLRuby::High
2830
2830
  *self.each_choice.map do |choice|
2831
2831
  choice.to_low
2832
2832
  end)
2833
- # For debugging: set the source high object
2834
- selectL.properties[:low2high] = self.hdr_id
2835
- self.properties[:high2low] = selectL
2833
+ # # For debugging: set the source high object
2834
+ # selectL.properties[:low2high] = self.hdr_id
2835
+ # self.properties[:high2low] = selectL
2836
2836
  return selectL
2837
2837
  end
2838
2838
  end
@@ -2864,9 +2864,9 @@ module HDLRuby::High
2864
2864
  expr.to_low
2865
2865
  end
2866
2866
  )
2867
- # For debugging: set the source high object
2868
- concatL.properties[:low2high] = self.hdr_id
2869
- self.properties[:high2low] = concatL
2867
+ # # For debugging: set the source high object
2868
+ # concatL.properties[:low2high] = self.hdr_id
2869
+ # self.properties[:high2low] = concatL
2870
2870
  return concatL
2871
2871
  end
2872
2872
  end
@@ -2908,9 +2908,9 @@ module HDLRuby::High
2908
2908
  # Create and return the resulting low-level value
2909
2909
  # return HDLRuby::Low::Value.new(self.type.to_low,self.content)
2910
2910
  valueL = HDLRuby::Low::Value.new(self.type.to_low,self.content)
2911
- # For debugging: set the source high object
2912
- valueL.properties[:low2high] = self.hdr_id
2913
- self.properties[:high2low] = valueL
2911
+ # # For debugging: set the source high object
2912
+ # valueL.properties[:low2high] = self.hdr_id
2913
+ # self.properties[:high2low] = valueL
2914
2914
  return valueL
2915
2915
  end
2916
2916
 
@@ -3016,9 +3016,9 @@ module HDLRuby::High
3016
3016
  # puts "to_low with base=#{@base} @object=#{@object}"
3017
3017
  refNameL = HDLRuby::Low::RefName.new(self.type.to_low,
3018
3018
  @base.to_ref.to_low,@object.name)
3019
- # For debugging: set the source high object
3020
- refNameL.properties[:low2high] = self.hdr_id
3021
- self.properties[:high2low] = refNameL
3019
+ # # For debugging: set the source high object
3020
+ # refNameL.properties[:low2high] = self.hdr_id
3021
+ # self.properties[:high2low] = refNameL
3022
3022
  return refNameL
3023
3023
  end
3024
3024
 
@@ -3056,9 +3056,9 @@ module HDLRuby::High
3056
3056
  ref.to_low
3057
3057
  end
3058
3058
  )
3059
- # For debugging: set the source high object
3060
- refConcatL.properties[:low2high] = self.hdr_id
3061
- self.properties[:high2low] = refConcatL
3059
+ # # For debugging: set the source high object
3060
+ # refConcatL.properties[:low2high] = self.hdr_id
3061
+ # self.properties[:high2low] = refConcatL
3062
3062
  return refConcatL
3063
3063
  end
3064
3064
  end
@@ -3080,9 +3080,9 @@ module HDLRuby::High
3080
3080
  # self.ref.to_low,self.index.to_low)
3081
3081
  refIndexL = HDLRuby::Low::RefIndex.new(self.type.to_low,
3082
3082
  self.ref.to_low,self.index.to_low)
3083
- # For debugging: set the source high object
3084
- refIndexL.properties[:low2high] = self.hdr_id
3085
- self.properties[:high2low] = refIndexL
3083
+ # # For debugging: set the source high object
3084
+ # refIndexL.properties[:low2high] = self.hdr_id
3085
+ # self.properties[:high2low] = refIndexL
3086
3086
  return refIndexL
3087
3087
  end
3088
3088
  end
@@ -3104,9 +3104,9 @@ module HDLRuby::High
3104
3104
  # self.ref.to_low,self.range.to_low)
3105
3105
  refRangeL = HDLRuby::Low::RefRange.new(self.type.to_low,
3106
3106
  self.ref.to_low,self.range.to_low)
3107
- # For debugging: set the source high object
3108
- refRangeL.properties[:low2high] = self.hdr_id
3109
- self.properties[:high2low] = refRangeL
3107
+ # # For debugging: set the source high object
3108
+ # refRangeL.properties[:low2high] = self.hdr_id
3109
+ # self.properties[:high2low] = refRangeL
3110
3110
  return refRangeL
3111
3111
  end
3112
3112
  end
@@ -3127,9 +3127,9 @@ module HDLRuby::High
3127
3127
  # self.ref.to_low,self.name)
3128
3128
  refNameL = HDLRuby::Low::RefName.new(self.type.to_low,
3129
3129
  self.ref.to_low,self.name)
3130
- # For debugging: set the source high object
3131
- refNameL.properties[:low2high] = self.hdr_id
3132
- self.properties[:high2low] = refNameL
3130
+ # # For debugging: set the source high object
3131
+ # refNameL.properties[:low2high] = self.hdr_id
3132
+ # self.properties[:high2low] = refNameL
3133
3133
  return refNameL
3134
3134
  end
3135
3135
  end
@@ -3164,9 +3164,9 @@ module HDLRuby::High
3164
3164
  def to_low
3165
3165
  # return HDLRuby::Low::RefThis.new
3166
3166
  refThisL = HDLRuby::Low::RefThis.new
3167
- # For debugging: set the source high object
3168
- refThisL.properties[:low2high] = self.hdr_id
3169
- self.properties[:high2low] = refThisL
3167
+ # # For debugging: set the source high object
3168
+ # refThisL.properties[:low2high] = self.hdr_id
3169
+ # self.properties[:high2low] = refThisL
3170
3170
  return refThisL
3171
3171
  end
3172
3172
  end
@@ -3237,9 +3237,9 @@ module HDLRuby::High
3237
3237
  def to_low
3238
3238
  # return HDLRuby::Low::Event.new(self.type,self.ref.to_low)
3239
3239
  eventL = HDLRuby::Low::Event.new(self.type,self.ref.to_low)
3240
- # For debugging: set the source high object
3241
- eventL.properties[:low2high] = self.hdr_id
3242
- self.properties[:high2low] = eventL
3240
+ # # For debugging: set the source high object
3241
+ # eventL.properties[:low2high] = self.hdr_id
3242
+ # self.properties[:high2low] = eventL
3243
3243
  return eventL
3244
3244
  end
3245
3245
  end
@@ -3280,9 +3280,9 @@ module HDLRuby::High
3280
3280
  # self.right.to_low)
3281
3281
  transmitL = HDLRuby::Low::Transmit.new(self.left.to_low,
3282
3282
  self.right.to_low)
3283
- # For debugging: set the source high object
3284
- transmitL.properties[:low2high] = self.hdr_id
3285
- self.properties[:high2low] = transmitL
3283
+ # # For debugging: set the source high object
3284
+ # transmitL.properties[:low2high] = self.hdr_id
3285
+ # self.properties[:high2low] = transmitL
3286
3286
  return transmitL
3287
3287
  end
3288
3288
  end
@@ -3373,9 +3373,9 @@ module HDLRuby::High
3373
3373
  # self.right.to_low)
3374
3374
  connectionL = HDLRuby::Low::Connection.new(self.left.to_low,
3375
3375
  self.right.to_low)
3376
- # For debugging: set the source high object
3377
- connectionL.properties[:low2high] = self.hdr_id
3378
- self.properties[:high2low] = connectionL
3376
+ # # For debugging: set the source high object
3377
+ # connectionL.properties[:low2high] = self.hdr_id
3378
+ # self.properties[:high2low] = connectionL
3379
3379
  return connectionL
3380
3380
  end
3381
3381
  end
@@ -3487,9 +3487,9 @@ module HDLRuby::High
3487
3487
  def to_low(name = self.name)
3488
3488
  # return HDLRuby::Low::SignalI.new(name,self.type.to_low)
3489
3489
  signalIL = HDLRuby::Low::SignalI.new(name,self.type.to_low)
3490
- # For debugging: set the source high object
3491
- signalIL.properties[:low2high] = self.hdr_id
3492
- self.properties[:high2low] = signalIL
3490
+ # # For debugging: set the source high object
3491
+ # signalIL.properties[:low2high] = self.hdr_id
3492
+ # self.properties[:high2low] = signalIL
3493
3493
  return signalIL
3494
3494
  end
3495
3495
  end
@@ -3553,9 +3553,9 @@ module HDLRuby::High
3553
3553
  # self.value.to_low)
3554
3554
  signalCL = HDLRuby::Low::SignalC.new(name,self.type.to_low,
3555
3555
  self.value.to_low)
3556
- # For debugging: set the source high object
3557
- signalCL.properties[:low2high] = self.hdr_id
3558
- self.properties[:high2low] = signalCL
3556
+ # # For debugging: set the source high object
3557
+ # signalCL.properties[:low2high] = self.hdr_id
3558
+ # self.properties[:high2low] = signalCL
3559
3559
  return signalCL
3560
3560
  end
3561
3561
  end
@@ -3766,9 +3766,9 @@ module HDLRuby::High
3766
3766
  def to_low
3767
3767
  # Create the resulting block
3768
3768
  blockL = HDLRuby::Low::Block.new(self.mode)
3769
- # For debugging: set the source high object
3770
- blockL.properties[:low2high] = self.hdr_id
3771
- self.properties[:high2low] = blockL
3769
+ # # For debugging: set the source high object
3770
+ # blockL.properties[:low2high] = self.hdr_id
3771
+ # self.properties[:high2low] = blockL
3772
3772
  # Push the namespace for the low generation.
3773
3773
  High.space_push(@namespace)
3774
3774
  # Pushes on the name stack for converting the internals of
@@ -3836,9 +3836,9 @@ module HDLRuby::High
3836
3836
  def to_low
3837
3837
  # Create the resulting block
3838
3838
  blockL = HDLRuby::Low::TimeBlock.new(self.mode)
3839
- # For debugging: set the source high object
3840
- blockL.properties[:low2high] = self.hdr_id
3841
- self.properties[:high2low] = blockL
3839
+ # # For debugging: set the source high object
3840
+ # blockL.properties[:low2high] = self.hdr_id
3841
+ # self.properties[:high2low] = blockL
3842
3842
  # Add the inner signals
3843
3843
  self.each_inner { |inner| blockL.add_inner(inner.to_low) }
3844
3844
  # Add the statements
@@ -3930,9 +3930,9 @@ module HDLRuby::High
3930
3930
  eventLs = self.each_event.map { |event| event.to_low }
3931
3931
  # Create and return the resulting low level behavior.
3932
3932
  behaviorL = HDLRuby::Low::Behavior.new(blockL)
3933
- # For debugging: set the source high object
3934
- behaviorL.properties[:low2high] = self.hdr_id
3935
- self.properties[:high2low] = behaviorL
3933
+ # # For debugging: set the source high object
3934
+ # behaviorL.properties[:low2high] = self.hdr_id
3935
+ # self.properties[:high2low] = behaviorL
3936
3936
  eventLs.each(&behaviorL.method(:add_event))
3937
3937
  return behaviorL
3938
3938
  end
@@ -3960,9 +3960,9 @@ module HDLRuby::High
3960
3960
  eventLs = self.each_event.map { |event| event.to_low }
3961
3961
  # Create and return the resulting low level behavior.
3962
3962
  timeBehaviorL = HDLRuby::Low::TimeBehavior.new(blockL)
3963
- # For debugging: set the source high object
3964
- timeBehaviorL.properties[:low2high] = self.hdr_id
3965
- self.properties[:high2low] = timeBehaviorL
3963
+ # # For debugging: set the source high object
3964
+ # timeBehaviorL.properties[:low2high] = self.hdr_id
3965
+ # self.properties[:high2low] = timeBehaviorL
3966
3966
  eventLs.each(&timeBehaviorL.method(:add_event))
3967
3967
  return timeBehaviorL
3968
3968
  end
@@ -1,6 +1,6 @@
1
1
  require "HDLRuby/hruby_bstr"
2
2
  require "HDLRuby/hruby_error"
3
- require "HDLRuby/hruby_decorator"
3
+ # require "HDLRuby/hruby_decorator"
4
4
  require 'forwardable'
5
5
 
6
6
 
@@ -36,7 +36,7 @@ module HDLRuby::Low
36
36
  end
37
37
 
38
38
 
39
- Hdecorator = HDLRuby::Hdecorator
39
+ # Hdecorator = HDLRuby::Hdecorator
40
40
 
41
41
  ##
42
42
  # Gives parent definition and access properties to an hardware object.
@@ -118,8 +118,8 @@ module HDLRuby::Low
118
118
  end
119
119
  end
120
120
 
121
- # Add decorator capability (modifies intialize to put after).
122
- include Hdecorator
121
+ # # Add decorator capability (modifies intialize to put after).
122
+ # include Hdecorator
123
123
 
124
124
  # Comparison for hash: structural comparison.
125
125
  def eql?(obj)
@@ -455,8 +455,8 @@ module HDLRuby::Low
455
455
  @behaviors = []
456
456
  end
457
457
 
458
- # Add decorator capability (modifies intialize to put after).
459
- include Hdecorator
458
+ # # Add decorator capability (modifies intialize to put after).
459
+ # include Hdecorator
460
460
 
461
461
  # Comparison for hash: structural comparison.
462
462
  def eql?(obj)
@@ -1221,8 +1221,8 @@ module HDLRuby::Low
1221
1221
  @name = name.to_sym
1222
1222
  end
1223
1223
 
1224
- # Add decorator capability (modifies intialize to put after).
1225
- include Hdecorator
1224
+ # # Add decorator capability (modifies intialize to put after).
1225
+ # include Hdecorator
1226
1226
 
1227
1227
  # Comparison for hash: structural comparison.
1228
1228
  def eql?(obj)
@@ -2124,8 +2124,8 @@ module HDLRuby::Low
2124
2124
  # @block = block
2125
2125
  end
2126
2126
 
2127
- # Add decorator capability (modifies intialize to put after).
2128
- include Hdecorator
2127
+ # # Add decorator capability (modifies intialize to put after).
2128
+ # include Hdecorator
2129
2129
 
2130
2130
  # Sets the block if not already set.
2131
2131
  def block=(block)
@@ -2348,8 +2348,8 @@ module HDLRuby::Low
2348
2348
  ref.parent = self
2349
2349
  end
2350
2350
 
2351
- # Add decorator capability (modifies intialize to put after).
2352
- include Hdecorator
2351
+ # # Add decorator capability (modifies intialize to put after).
2352
+ # include Hdecorator
2353
2353
 
2354
2354
  # Comparison for hash: structural comparison.
2355
2355
  def eql?(obj)
@@ -2432,8 +2432,8 @@ module HDLRuby::Low
2432
2432
  false
2433
2433
  end
2434
2434
 
2435
- # Add decorator capability (modifies intialize to put after).
2436
- include Hdecorator
2435
+ # # Add decorator capability (modifies intialize to put after).
2436
+ # include Hdecorator
2437
2437
 
2438
2438
  # Iterates over each object deeply.
2439
2439
  #
@@ -2517,8 +2517,8 @@ module HDLRuby::Low
2517
2517
  @systemTs = [ @systemT ]
2518
2518
  end
2519
2519
 
2520
- # Add decorator capability (modifies intialize to put after).
2521
- include Hdecorator
2520
+ # # Add decorator capability (modifies intialize to put after).
2521
+ # include Hdecorator
2522
2522
 
2523
2523
  # Iterates over each object deeply.
2524
2524
  #
@@ -2649,8 +2649,8 @@ module HDLRuby::Low
2649
2649
  lumps.each { |lump| self.add_lump(lump) }
2650
2650
  end
2651
2651
 
2652
- # Add decorator capability (modifies intialize to put after).
2653
- include Hdecorator
2652
+ # # Add decorator capability (modifies intialize to put after).
2653
+ # include Hdecorator
2654
2654
 
2655
2655
  # Adds a +lump+ of code, it is ment to become an expression or
2656
2656
  # some text.
@@ -2698,8 +2698,8 @@ module HDLRuby::Low
2698
2698
  @chunks = HashName.new
2699
2699
  end
2700
2700
 
2701
- # Add decorator capability (modifies intialize to put after).
2702
- include Hdecorator
2701
+ # # Add decorator capability (modifies intialize to put after).
2702
+ # include Hdecorator
2703
2703
 
2704
2704
  # Adds a +chunk+ to the sensitivity list.
2705
2705
  def add_chunk(chunk)
@@ -2810,7 +2810,7 @@ module HDLRuby::Low
2810
2810
  # NOTE: this is an abstract class which is not to be used directly.
2811
2811
  class Statement
2812
2812
  include Hparent
2813
- include Hdecorator
2813
+ # include Hdecorator
2814
2814
 
2815
2815
  # Clones (deeply)
2816
2816
  def clone
@@ -3298,8 +3298,8 @@ module HDLRuby::Low
3298
3298
  match.parent = statement.parent = self
3299
3299
  end
3300
3300
 
3301
- # Add decorator capability (modifies intialize to put after).
3302
- include Hdecorator
3301
+ # # Add decorator capability (modifies intialize to put after).
3302
+ # include Hdecorator
3303
3303
 
3304
3304
  # Iterates over each object deeply.
3305
3305
  #
@@ -3623,8 +3623,8 @@ module HDLRuby::Low
3623
3623
  @unit = unit.to_sym
3624
3624
  end
3625
3625
 
3626
- # Add decorator capability (modifies intialize to put after).
3627
- include Hdecorator
3626
+ # # Add decorator capability (modifies intialize to put after).
3627
+ # include Hdecorator
3628
3628
 
3629
3629
  # Iterates over each object deeply.
3630
3630
  #
@@ -4333,8 +4333,8 @@ module HDLRuby::Low
4333
4333
  end
4334
4334
  end
4335
4335
 
4336
- # Add decorator capability (modifies intialize to put after).
4337
- include Hdecorator
4336
+ # # Add decorator capability (modifies intialize to put after).
4337
+ # include Hdecorator
4338
4338
 
4339
4339
  # Comparison for hash: structural comparison.
4340
4340
  def eql?(obj)
@@ -165,6 +165,30 @@ module HDLRuby::Low
165
165
  return false
166
166
  end
167
167
 
168
+ ## Gets the systemI the reference comes from if any.
169
+ def get_systemI
170
+ # Look for the owner from the name hierarchy.
171
+ if self.ref.is_a?(RefName) then
172
+ # Look in the parent hierachy for the sub reference name.
173
+ parent = self.parent
174
+ # puts "self.ref.name=#{self.ref.name}"
175
+ while parent
176
+ # puts "parent=#{parent}"
177
+ if parent.respond_to?(:get_by_name) then
178
+ found = parent.get_by_name(self.ref.name)
179
+ # puts "found is a :#{found.class}"
180
+ return found if found.is_a?(SystemI)
181
+ end
182
+ parent = parent.parent
183
+ end
184
+ # Not found, look further in the reference hierarchy.
185
+ return self.ref.get_systemI
186
+ end
187
+ # Not from a systemI.
188
+ # puts "Not from systemI for #{self.name}"
189
+ return nil
190
+ end
191
+
168
192
 
169
193
  ## Resolves the name of the reference and return the
170
194
  # corresponding object.
@@ -134,7 +134,7 @@ module HDLRuby::Low
134
134
  if self.name && !self.name.empty? then
135
135
  vname = name_to_verilog(self.name)
136
136
  code << " : #{vname}"
137
- self.properties[:verilog_name] = vname
137
+ # self.properties[:verilog_name] = vname
138
138
  end
139
139
  code << "\n" if block.each_inner.any?
140
140
  # Declaration of "inner" part within "always".
@@ -1371,7 +1371,7 @@ module HDLRuby::Low
1371
1371
  # Converts the system to Verilog code using +renamer+ for producing Verilog-compatible names.
1372
1372
  def to_verilog
1373
1373
  vname = name_to_verilog(self.name)
1374
- self.properties[:verilog_name] = vname
1374
+ # self.properties[:verilog_name] = vname
1375
1375
  return "#{vname}"
1376
1376
  end
1377
1377
 
@@ -1677,7 +1677,7 @@ module HDLRuby::Low
1677
1677
  def to_verilog
1678
1678
  # Convert unusable characters and return them.
1679
1679
  vname = name_to_verilog(self.name)
1680
- self.properties[:verilog_name] = vname
1680
+ # self.properties[:verilog_name] = vname
1681
1681
  return "#{vname}"
1682
1682
  end
1683
1683
  end
@@ -1842,7 +1842,7 @@ module HDLRuby::Low
1842
1842
  code = "`timescale 1ps/1ps\n\n"
1843
1843
 
1844
1844
  vname = name_to_verilog(self.name)
1845
- self.properties[:verilog_name] = vname
1845
+ # self.properties[:verilog_name] = vname
1846
1846
  # Output the module name.
1847
1847
  code << "module #{vname}("
1848
1848
 
@@ -2007,7 +2007,7 @@ module HDLRuby::Low
2007
2007
  systemT = systemI.systemT
2008
2008
  code << name_to_verilog(systemT.name) << " "
2009
2009
  vname = name_to_verilog(systemI.name)
2010
- systemI.properties[:verilog_name] = vname
2010
+ # systemI.properties[:verilog_name] = vname
2011
2011
  code << vname << "("
2012
2012
  # Its ports connections
2013
2013
  # Inputs
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "2.6.10"
2
+ VERSION = "2.6.15"
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.6.10
4
+ version: 2.6.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lovic Gauthier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-16 00:00:00.000000000 Z
11
+ date: 2021-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler