HDLRuby 2.4.28 → 2.4.29

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: ad6c03f726ed838a4d5456f41c4b0f295e4ca7d10ca8585ee8f8c011f7f2fd23
4
- data.tar.gz: a59727e177be4d5ff3eb740d210fad37bd4ba9ea6296a8cfed84495a7122411d
3
+ metadata.gz: a583dff628b7090369ac26e9136e3c911204ea3078135fecfd249e1cd4521d2b
4
+ data.tar.gz: 1ac0f7881ab17a0ac1bf69cccc2028ae129eb5ac99640440ddb05fdb18605fe1
5
5
  SHA512:
6
- metadata.gz: dc19bcb5b44267c6506a9a1b3547d516b565a2a3ea997bf2ab5cada119caafb0fee09220c7da2e92321562ed2588dc5b6c58c6c697d3230daa8942c00fb731f6
7
- data.tar.gz: c6849492302732600fe232d73f6984c4fe1a94e4d818349d5400fb15979eecc6b2b32d71a81b50f09713c5143236e13f330f763ea98beeda4a939d77b8d2fba9
6
+ metadata.gz: c6883993bfcd2f3956710c1a88550faa6bc892b579a1741c85f43c19a44baafa3429d0735cbbdc7cacba7f51cbf40d92bfa3b0b74ba5c6fe014779935b82f6b5
7
+ data.tar.gz: e94a1ea16d576f5b1424ac2a3274ff43d5ed8a95471ad6ee4c86d45ec7d956c375f64c8011f8bdf7c7c85d2f02c882f869ca3d4e81f986831263a633f60e14e8
data/lib/HDLRuby/hdrcc.rb CHANGED
@@ -461,6 +461,9 @@ elsif $options[:clang] then
461
461
  # top_system = $top_system
462
462
  # Preprocess the HW description for valid C generation.
463
463
  $top_system.each_systemT_deep do |systemT|
464
+ # Coverts the par blocks in seq blocks to seq blocks to match
465
+ # the simulation engine.
466
+ systemT.par_in_seq2seq!
464
467
  # Converts the connections to behaviors.
465
468
  systemT.connections_to_behaviors!
466
469
  # Break the RefConcat.
@@ -178,6 +178,7 @@ module HDLRuby::Low
178
178
  end
179
179
  end
180
180
  self.scope.each_block_deep do |block|
181
+ # puts "treating for block=#{Low2C.obj_name(block)} with=#{block.each_inner.count} inners"
181
182
  block.each_inner do |signal|
182
183
  # res << signal.value.to_c_make(level) if signal.value
183
184
  signal.value.each_node_deep do |node|
@@ -837,6 +838,7 @@ module HDLRuby::Low
837
838
  ## Generates the content of the h file.
838
839
  def to_ch
839
840
  res = ""
841
+ # puts "to_ch for SignalI: #{self.to_c_signal()}"
840
842
  # Declare the global variable holding the signal.
841
843
  res << "extern SignalI #{self.to_c_signal()};\n\n"
842
844
 
@@ -1050,6 +1052,12 @@ module HDLRuby::Low
1050
1052
  raise AnyError, "Internal error: to_c should be implemented in class :#{self.class}"
1051
1053
  end
1052
1054
 
1055
+ ## Generates the content of the h file.
1056
+ def to_ch
1057
+ # By default nothing to generate.
1058
+ return ""
1059
+ end
1060
+
1053
1061
  # Adds the c code of the blocks to +res+ at +level+
1054
1062
  def add_blocks_code(res,level)
1055
1063
  if self.respond_to?(:each_node) then
@@ -1060,6 +1068,17 @@ module HDLRuby::Low
1060
1068
  end
1061
1069
  end
1062
1070
  end
1071
+
1072
+ # Adds the creation of the blocks to +res+ at +level+.
1073
+ def add_make_block(res,level)
1074
+ if self.respond_to?(:each_node) then
1075
+ self.each_node do |node|
1076
+ if node.respond_to?(:add_blocks_code) then
1077
+ node.add_make_block(res,level)
1078
+ end
1079
+ end
1080
+ end
1081
+ end
1063
1082
  end
1064
1083
 
1065
1084
  ## Extends the Transmit class with generation of HDLRuby::High text.
@@ -1143,6 +1162,18 @@ module HDLRuby::Low
1143
1162
  # Return the result.
1144
1163
  return res
1145
1164
  end
1165
+
1166
+ ## Generates the content of the h file.
1167
+ def to_ch
1168
+ res = ""
1169
+ # Recurse on the sub statements.
1170
+ res << self.yes.to_ch
1171
+ self.each_noif do |cond,stmnt|
1172
+ res << stmnt.to_ch
1173
+ end
1174
+ res << self.no.to_ch if self.no
1175
+ return res
1176
+ end
1146
1177
  end
1147
1178
 
1148
1179
  ## Extends the When class with generation of HDLRuby::High text.
@@ -1164,10 +1195,20 @@ module HDLRuby::Low
1164
1195
  return res
1165
1196
  end
1166
1197
 
1198
+ ## Generates the content of the h file.
1199
+ def to_ch
1200
+ return self.statement.to_ch
1201
+ end
1202
+
1167
1203
  # Adds the c code of the blocks to +res+ at +level+
1168
1204
  def add_blocks_code(res,level)
1169
1205
  self.statement.add_blocks_code(res,level)
1170
1206
  end
1207
+
1208
+ # Adds the creation of the blocks to +res+ at +level+.
1209
+ def add_make_block(res,level)
1210
+ self.statement.add_make_block(res,level)
1211
+ end
1171
1212
  end
1172
1213
 
1173
1214
  ## Extends the Case class with generation of HDLRuby::High text.
@@ -1215,6 +1256,16 @@ module HDLRuby::Low
1215
1256
  # Return the resulting string.
1216
1257
  return res
1217
1258
  end
1259
+
1260
+ ## Generates the content of the h file.
1261
+ def to_ch
1262
+ res = ""
1263
+ # Recurse on the whens.
1264
+ self.each_when {|w| res << w.to_ch }
1265
+ # Recurse on the default statement.
1266
+ res << self.default.to_ch if self.default
1267
+ return res
1268
+ end
1218
1269
  end
1219
1270
 
1220
1271
 
@@ -1272,6 +1323,12 @@ module HDLRuby::Low
1272
1323
  res << self.to_c_code(level)
1273
1324
  end
1274
1325
 
1326
+ # Adds the creation of the blocks to +res+ at +level+.
1327
+ def add_make_block(res,level)
1328
+ res << " " * level*3
1329
+ res << "#{Low2C.make_name(self)}();\n"
1330
+ end
1331
+
1275
1332
  # Generates the C text of the equivalent HDLRuby::High code.
1276
1333
  # +level+ is the hierachical level of the object.
1277
1334
  def to_c_code(level = 0)
@@ -1351,6 +1408,11 @@ module HDLRuby::Low
1351
1408
  res << " " * (level+1)*3
1352
1409
  res << "block->function = &#{Low2C.code_name(self)};\n"
1353
1410
 
1411
+ # Generate creation of the sub blocks.
1412
+ self.each_statement do |stmnt|
1413
+ stmnt.add_make_block(res,level+1)
1414
+ end
1415
+
1354
1416
  # Generate the Returns of the result.
1355
1417
  res << "\n"
1356
1418
  res << " " * (level+1)*3
@@ -1373,6 +1435,7 @@ module HDLRuby::Low
1373
1435
 
1374
1436
  ## Generates the content of the h file.
1375
1437
  def to_ch
1438
+ # puts "to_ch for block=#{Low2C.obj_name(self)} with=#{self.each_inner.count} inners"
1376
1439
  res = ""
1377
1440
  # Declare the global variable holding the block.
1378
1441
  res << "extern Block #{Low2C.obj_name(self)};\n\n"
@@ -1383,6 +1446,10 @@ module HDLRuby::Low
1383
1446
  # Generate the accesses to the ports.
1384
1447
  self.each_inner { |inner| res << inner.to_ch }
1385
1448
 
1449
+ # Recurse on the statements.
1450
+ self.each_statement { |stmnt| res << stmnt.to_ch }
1451
+
1452
+
1386
1453
  return res
1387
1454
  end
1388
1455
  end
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "2.4.28"
2
+ VERSION = "2.4.29"
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.4.28
4
+ version: 2.4.29
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-01-10 00:00:00.000000000 Z
11
+ date: 2021-02-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler