HDLRuby 2.6.16 → 2.6.18

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: 0defaa4d148c2fbdc008f29c75a6ab8a4b48726a932f3222e2dc19c7b229492c
4
- data.tar.gz: 9e2d4268200af09e0c078306b5c8a81494b589468b5b8b0084d300d14f922387
3
+ metadata.gz: 2d49fb40d2d1233c59c0ae1f6d7afea51ab17e70aaac5f605295f4c44e478fa4
4
+ data.tar.gz: 0b14393197c0af246dae6c221d2beb94580fa9b4c30b234e82efdae4eebf5bca
5
5
  SHA512:
6
- metadata.gz: ae9f4d696caa0c8f76caa7f0fd05bf1f6554da50c40871c86ad3b44f4c41f3dc184fe58141afd796d3c9448fcdfd04d6869fafc0246fe39236e5f3f48d6bd6a2
7
- data.tar.gz: 9cc5165ad15458f4c2f514107f7e15118534c079d061dc2f97aecb0982097fe534b0e26683834b901de34ced55132fc0f3608c19087b87ee5a9137174f49a4d1
6
+ metadata.gz: e2c55c6966faa1274aee2ae712b376aec22670e9a574b4d5312e73a8a8a1f85713b8312d6b923e4daef030398667c327245ee8aeb813c3d379d137dd63ec9af8
7
+ data.tar.gz: a28d25d1a5ff5893e64ede5229a4b53c7ad0c4ff6479807e3f76764c9f464fc5d0b6a41f8cce3ea8b49338895a3d95e8582760c64a0d8df21a5683fd0acba4d3
data/lib/HDLRuby/hdrcc.rb CHANGED
@@ -110,7 +110,7 @@ module HDLRuby
110
110
  else
111
111
  # A standard file is found, skip it since it does not
112
112
  # need to be read.
113
- # puts "Standard files: #{founds}"
113
+ # show? "Standard files: #{founds}"
114
114
  return false
115
115
  end
116
116
  end
@@ -134,7 +134,7 @@ module HDLRuby
134
134
  file = @top_file_name
135
135
  end
136
136
  end
137
- # puts "read_all with file=#{file}"
137
+ # show? "read_all with file=#{file}"
138
138
  # Read the file
139
139
  # read(file)
140
140
  unless read(file) then
@@ -158,7 +158,7 @@ module HDLRuby
158
158
 
159
159
  # Displays the syntax tree of all the files.
160
160
  def show_all(outfile = $stdout)
161
- # puts "@checks.size=#{@checks.size}"
161
+ # show? "@checks.size=#{@checks.size}"
162
162
  @checks.each { |check| check.show(outfile) }
163
163
  end
164
164
 
@@ -166,7 +166,7 @@ module HDLRuby
166
166
  def get_top
167
167
  # Get all the systems.
168
168
  systems = @checks.reduce([]) {|ar,check| ar + check.get_all_systems}
169
- # puts "First systems=#{systems}"
169
+ # show? "First systems=#{systems}"
170
170
  # Remove the systems that are instantiated or included
171
171
  # (they cannot be tops)
172
172
  @checks.each do |check|
@@ -183,7 +183,7 @@ module HDLRuby
183
183
  systems -= check.get_inherit_systems(inherit)
184
184
  end
185
185
  end
186
- # puts "Now systems=#{systems}"
186
+ # show? "Now systems=#{systems}"
187
187
  # Return the first top of the list.
188
188
  return systems[-1]
189
189
  end
@@ -195,7 +195,7 @@ module HDLRuby
195
195
  if @top_system == "" then
196
196
  # No, look for it.
197
197
  @top_system = get_top
198
- # puts "@top_system=#{@top_system}"
198
+ # show? "@top_system=#{@top_system}"
199
199
  unless @top_system then
200
200
  # Not found? Error.
201
201
  # Maybe it is a parse error, look for it.
@@ -238,7 +238,7 @@ module HDLRuby
238
238
  # Dump to a file.
239
239
  if chunk.name != :sim then
240
240
  # The chunk is to be dumbed to a file.
241
- # puts "Outputing chunk:#{HDLRuby::Low::Low2C.obj_name(chunk)}"
241
+ # show? "Outputing chunk:#{HDLRuby::Low::Low2C.obj_name(chunk)}"
242
242
  outfile = File.open(path + "/" +
243
243
  HDLRuby::Low::Low2C.obj_name(chunk) + "." +
244
244
  chunk.name.to_s,"w")
@@ -351,6 +351,12 @@ $optparse = OptionParser.new do |opts|
351
351
  opts.on("-D", "--debug","Set the HDLRuby debug mode") do |d|
352
352
  $options[:debug] = d
353
353
  end
354
+ opts.on("--verbose","Set verbose mode.") do |d|
355
+ HDLRuby.verbosity = 2
356
+ end
357
+ opts.on("--volubile","Set extreme verbose mode.") do |d|
358
+ HDLRuby.verbosity = 3
359
+ end
354
360
  opts.on("-T","--test t0,t1,t2","Compile the unit tests named t0,t1,...") do |t|
355
361
  $options[:test] = t
356
362
  end
@@ -396,7 +402,7 @@ $optparse = OptionParser.new do |opts|
396
402
  end
397
403
  $optparse.parse!
398
404
 
399
- # puts "options=#{$options}"
405
+ # show? "options=#{$options}"
400
406
 
401
407
  # Check the compatibility of the options
402
408
  if $options.count {|op| [:yaml,:hdr,:verilog,:vhdl].include?(op) } > 1 then
@@ -436,7 +442,7 @@ if ($options[:test] || $options[:testall]) then
436
442
  $test_file.write("require 'std/hruby_unit.rb'\nrequire_relative '#{$input}'\n\n" +
437
443
  "HDLRuby::Unit.test(:\"#{$top}\"#{tests})\n")
438
444
  # $test_file.rewind
439
- # puts $test_file.read
445
+ # show? $test_file.read
440
446
  # exit
441
447
  $test_file.rewind
442
448
  # It is the new input file.
@@ -491,11 +497,11 @@ end
491
497
 
492
498
  # Generate the result.
493
499
  # Get the top systemT.
494
- puts Time.now
500
+ HDLRuby.show Time.now
495
501
  $top_system = $top_instance.to_low.systemT
496
502
  $top_intance = nil # Free as much memory as possible.
497
- puts "##### Top system built #####"
498
- puts Time.now
503
+ HDLRuby.show "##### Top system built #####"
504
+ HDLRuby.show Time.now
499
505
 
500
506
 
501
507
  # # Apply the pre drivers if any.
@@ -562,23 +568,23 @@ elsif $options[:clang] then
562
568
  # top_system = $top_system
563
569
  # Preprocess the HW description for valid C generation.
564
570
  $top_system.each_systemT_deep do |systemT|
565
- puts "seq2seq step..."
571
+ HDLRuby.show "seq2seq step..."
566
572
  # Coverts the par blocks in seq blocks to seq blocks to match
567
573
  # the simulation engine.
568
574
  systemT.par_in_seq2seq!
569
- puts Time.now
570
- puts "connections_to_behaviors step..."
575
+ HDLRuby.show Time.now
576
+ HDLRuby.show "connections_to_behaviors step..."
571
577
  # Converts the connections to behaviors.
572
578
  systemT.connections_to_behaviors!
573
- puts Time.now
579
+ HDLRuby.show Time.now
574
580
  # Break the RefConcat.
575
- puts "concat_assigns step..."
581
+ HDLRuby.show "concat_assigns step..."
576
582
  systemT.break_concat_assigns!
577
- puts Time.now
583
+ HDLRuby.show Time.now
578
584
  # Explicits the types.
579
- puts "explicit_types step..."
585
+ HDLRuby.show "explicit_types step..."
580
586
  systemT.explicit_types!
581
- puts Time.now
587
+ HDLRuby.show Time.now
582
588
  end
583
589
  # Generate the C.
584
590
  if $options[:multiple] then
@@ -649,7 +655,7 @@ elsif $options[:clang] then
649
655
  name = $output + "/" +
650
656
  HDLRuby::Low::Low2C.c_name(systemT.name) +
651
657
  ".c"
652
- # puts "for systemT=#{systemT.name} generating: #{name}"
658
+ # show? "for systemT=#{systemT.name} generating: #{name}"
653
659
  # Open the file for current systemT
654
660
  outfile = File.open(name,"w")
655
661
  # Generate the C code in to.
@@ -703,26 +709,26 @@ elsif $options[:verilog] then
703
709
  # top_system = $top_system
704
710
  # Make description compatible with verilog generation.
705
711
  $top_system.each_systemT_deep do |systemT|
706
- puts "casts_without_expression! step..."
712
+ HDLRuby.show "casts_without_expression! step..."
707
713
  systemT.casts_without_expression!
708
- puts Time.now
709
- puts "to_upper_space! step..."
714
+ HDLRuby.show Time.now
715
+ HDLRuby.show "to_upper_space! step..."
710
716
  systemT.to_upper_space!
711
- puts Time.now
712
- puts "to_global_space! step..."
717
+ HDLRuby.show Time.now
718
+ HDLRuby.show "to_global_space! step..."
713
719
  systemT.to_global_systemTs!
714
- puts Time.now
720
+ HDLRuby.show Time.now
715
721
  # systemT.break_types!
716
722
  # systemT.expand_types!
717
- puts "par_in_seq2seq! step..."
723
+ HDLRuby.show "par_in_seq2seq! step..."
718
724
  systemT.par_in_seq2seq!
719
- puts Time.now
720
- puts "initial_concat_to_timed! step..."
725
+ HDLRuby.show Time.now
726
+ HDLRuby.show "initial_concat_to_timed! step..."
721
727
  systemT.initial_concat_to_timed!
722
- puts Time.now
723
- puts "with_port! step..."
728
+ HDLRuby.show Time.now
729
+ HDLRuby.show "with_port! step..."
724
730
  systemT.with_port!
725
- puts Time.now
731
+ HDLRuby.show Time.now
726
732
  end
727
733
  # # Verilog generation
728
734
  # $output << top_system.to_verilog
@@ -44,8 +44,10 @@ module HDLRuby::Low
44
44
  def to_global_systemTs!
45
45
  # Force a name if not.
46
46
  self.force_name!
47
+ # puts "to_global_systemTs! for #{self.name}"
47
48
  # For each local systemT
48
49
  self.scope.each_systemT.to_a.each do |systemT|
50
+ # puts "Processing system: #{systemT}"
49
51
  # Rename it for globalization.
50
52
  former = systemT.name
51
53
  self.extend_name!(systemT)
@@ -211,6 +213,7 @@ module HDLRuby::Low
211
213
  # Replaces recursively +former+ name by +nname+ until it is redeclared
212
214
  # in the internals.
213
215
  def replace_names_subs!(former,nname)
216
+ # puts "replace_names_subs! for #{self} with former=#{former} and nname=#{nname}"
214
217
  self.each_type do |type|
215
218
  type.replace_names!(former,nname)
216
219
  end
@@ -416,8 +419,9 @@ module HDLRuby::Low
416
419
  if self.name == former then
417
420
  self.set_name!(nname)
418
421
  end
419
- # Recurse on the system type.
420
- self.systemT.replace_names!(former,nname)
422
+ # Not needed since treated through scope and systemT.
423
+ # # Recurse on the system type.
424
+ # self.systemT.replace_names!(former,nname)
421
425
  end
422
426
  end
423
427
 
@@ -50,4 +50,28 @@ module HDLRuby
50
50
 
51
51
  end
52
52
 
53
+
54
+ # Display some messages depending on the verbosity mode.
55
+ @@verbosity = 1 # The verbosity level: default 1, only critical messages.
56
+
57
+ # Sets the verbosity.
58
+ def self.verbosity=(val)
59
+ @@verbosity = val.to_i
60
+ end
61
+
62
+ # Display a critical message.
63
+ def self.show!(*args)
64
+ puts(*args) if @@verbosity > 0
65
+ end
66
+
67
+ # Display a common message.
68
+ def self.show(*args)
69
+ puts(*args) if @@verbosity > 1
70
+ end
71
+
72
+ # Display a minor message.
73
+ def self.show?(*args)
74
+ puts(*args) if @@verbosity > 2
75
+ end
76
+
53
77
  end
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "2.6.16"
2
+ VERSION = "2.6.18"
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.16
4
+ version: 2.6.18
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-09-20 00:00:00.000000000 Z
11
+ date: 2021-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler