HDLRuby 2.6.19 → 2.6.22

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: 752424361455f2bd949a8f90c9802337f3ce1d853ebff6bfa44bbe25ebeda369
4
- data.tar.gz: f9c2dd84c0c875c423a94211948beaea44b54bfe234c01d6f35716b7df26053c
3
+ metadata.gz: 1568bd314caee471d78b83b882b7c89ad778642a4a026de691209318bf3f5a00
4
+ data.tar.gz: 6d1829e1f8d04fb8592d68faf1b12affccf487a94a86275f932bef8676c542a6
5
5
  SHA512:
6
- metadata.gz: cc71caee7a2435e579b533b4cbba22c6bc9ca9e8e75be4e57d4a629b7a467ac28a2a302f6d53cf7552a1c1f115e17f5ec7b7648eadc482ab62bc2fdff1319cc6
7
- data.tar.gz: 4053a2050e82212db5901c7cb4756b21bca3465ec9ee4d08cd2875d8b57e5c53cd05df0405e2f5b249ec96b28271f514c8707fbb43b8e69db901ff9713a9b1f4
6
+ metadata.gz: ded7ab60f18f80344d244274c354e85eda76150804bdb31598d801d803c33e0d63cc4786becdff7a3bff63a93b98d3837256638fe76ed993384998f56484846c
7
+ data.tar.gz: 52c1fabe48cacabad8692f7eacd00c3ced295e2963ec29c3f5235cf27ff99a8826b12e2d525bc2d4b86703967dcbe2fe10bdb47c20127f84c04ea8875ae39277
@@ -0,0 +1,38 @@
1
+
2
+
3
+ # A benchmark for testing the enumarable properties of expression (reduce).
4
+ system :with_reduce_bench do
5
+ [8].inner :val,:res
6
+ [64].inner :val64
7
+
8
+ timed do
9
+ val <= _01101010
10
+ res <= val.reduce(_00000000,:+)
11
+ !10.ns
12
+ val <= _01010010
13
+ res <= val.reduce(_00000000,:+)
14
+ !10.ns
15
+ val <= _01101111
16
+ res <= val.reduce(_00000000,:+)
17
+ !10.ns
18
+ val64 <= _0110101001101010011010100110101001101010011010100110101001101010
19
+ res <= val64.reduce(_00000000,:+)
20
+ !10.ns
21
+ res <= val64[7..0]
22
+ !10.ns
23
+ res <= res.reduce(_00000000,:+)
24
+ !10.ns
25
+ res <= val64[63..60]
26
+ !10.ns
27
+ res <= res.reduce(_00000000,:+)
28
+ !10.ns
29
+ val64 <= ~(val64 ^ val64)
30
+ res <= val64.reduce(_00000000,:+)
31
+ !10.ns
32
+ val64[0] <= _0
33
+ val64[3] <= _0
34
+ val64[63] <= _0
35
+ res <= val64.reduce(_00000000,:+)
36
+ !10.ns
37
+ end
38
+ end
@@ -1575,9 +1575,10 @@ module HDLRuby::Low
1575
1575
  if str =~ /^[01]+$/ && str.length <= 64 then
1576
1576
  # Yes, generate a numeral value.
1577
1577
  res << " " * (level+1)*3
1578
- res << "static unsigned long long data[] = { "
1578
+ # res << "static unsigned long long data[] = { "
1579
+ res << "static unsigned int data[] = { "
1579
1580
  res << str.scan(/.{1,#{Low2C.int_width}}/m).map do |sub|
1580
- sub.to_i(2).to_s + "ULL"
1581
+ sub.to_i(2).to_s # + "ULL"
1581
1582
  end.join(",")
1582
1583
  res << " };\n"
1583
1584
  # Create the value.
@@ -1930,11 +1931,10 @@ module HDLRuby::Low
1930
1931
  res << "ref = #{self.ref.to_c(level+2)};\n"
1931
1932
  # Compute the index.
1932
1933
  res << (" " * ((level+1)*3))
1933
- # res << "idx = read64(#{self.index.to_c(level+2)});\n"
1934
1934
  res << "idx = value2integer(#{self.index.to_c(level+2)});\n"
1935
1935
  # Make the access.
1936
1936
  res << (" " * ((level+1)*3))
1937
- # res << "dst = read_range(ref,idx,idx,#{self.ref.type.base.to_c(level)},dst);\n"
1937
+ # puts "self.type.width=#{self.type.width}"
1938
1938
  res << "dst = read_range(ref,idx,idx,#{self.type.to_c(level)},dst);\n"
1939
1939
  # Restore the state of the value pool.
1940
1940
  res << (" " * ((level+1)*3))
@@ -1947,7 +1947,9 @@ module HDLRuby::Low
1947
1947
  # Generates the C text for reference as left value to a signal.
1948
1948
  # +level+ is the hierarchical level of the object.
1949
1949
  def to_c_signal(level = 0)
1950
+ # puts "to_c_signal for RefIndex"
1950
1951
  return "make_ref_rangeS(#{self.ref.to_c_signal(level)}," +
1952
+ "#{self.type.to_c(level)}," +
1951
1953
  "value2integer(#{self.index.to_c(level)}),value2integer(#{self.index.to_c(level)}))"
1952
1954
  end
1953
1955
  end
@@ -1985,7 +1987,7 @@ module HDLRuby::Low
1985
1987
  # Make the access.
1986
1988
  res << (" " * ((level+1)*3))
1987
1989
  # res << "dst = #{command}_range(ref,first,last,#{self.ref.type.base.to_c(level)},dst);\n"
1988
- # puts "will read_range for #{self.ref.name} with width=#{self.ref.type.width} with base width=#{self.ref.type.base.width} with range=#{self.ref.type.range} with range=#{self.range.first.content}..#{self.range.last.content}"
1990
+ # puts "#{command}_range with first=#{self.range.first} and last=#{self.range.last}"
1989
1991
  res << "dst = #{command}_range(ref,first,last,#{self.type.base.to_c(level)},dst);\n"
1990
1992
  # Restore the state of the value pool.
1991
1993
  res << (" " * ((level+1)*3))
@@ -101,6 +101,7 @@ typedef struct ValueS_ {
101
101
  /* The tructure of a reference to a range in a value. */
102
102
  typedef struct RefRangeS_ {
103
103
  SignalI signal; /* The refered signal. */
104
+ Type type; /* The tyep of the elements. */
104
105
  unsigned long long first; /* The first index in the range. */
105
106
  unsigned long long last; /* The last index in the range. */
106
107
  } RefRangeS;
@@ -308,11 +309,12 @@ extern int same_content_value_range(Value value0, unsigned long long first,
308
309
 
309
310
  /** Creates a reference to a range inside a signal.
310
311
  * @param signal the signal to refer
312
+ * @param typ the type of the elements.
311
313
  * @param first the start index of the range
312
314
  * @param last the end index of the range
313
315
  * @return the resulting reference */
314
- extern RefRangeS make_ref_rangeS(SignalI signal, unsigned long long first,
315
- unsigned long long last);
316
+ extern RefRangeS make_ref_rangeS(SignalI signal, Type typ,
317
+ unsigned long long first, unsigned long long last);
316
318
 
317
319
 
318
320
  /* The interface for the lists. */
@@ -2171,7 +2171,8 @@ Value read_range_numeric(Value value, long long first, long long last,
2171
2171
  /* Compute the read mask. */
2172
2172
  // unsigned long long mask = ((-1LL) << first) & (~((-1LL) << (last+1)));
2173
2173
  /* NOTE: once again, << 64 does not work like expected. */
2174
- unsigned long long mask = mask+bw < 64 ? (~((-1LL) << (last+bw))) : -1LL;
2174
+ unsigned long long mask = last+bw < 64 ? (~((-1LL) << (last+bw))) : -1LL;
2175
+ // printf("mask=%llx\n",mask);
2175
2176
  /* Performs the read. */
2176
2177
  unsigned long long data = (value->data_int & mask) >> first;
2177
2178
  /* Write it to the destination. */
@@ -2216,7 +2217,9 @@ Value write_range_numeric(Value src, long long first, long long last,
2216
2217
  /* Copy from the source. */
2217
2218
  unsigned long long src_data = src->data_int & ~((-1LL) << (last-first+1));
2218
2219
  /* Cleans the destination where to place the data. */
2219
- unsigned long long mask = ~(((-1LL) << first) & ~((-1LL) << (last+1)));
2220
+ unsigned long long mask;
2221
+ if (last<63) mask = ~(((-1LL) << first) & ~((-1LL) << (last+1)));
2222
+ else mask = ~((-1LL)<<first);
2220
2223
  unsigned long long dst_data = dst->data_int & mask;
2221
2224
  // printf("src_data=%llx mask=%llx dst_data=%llx\n",src_data,mask,dst_data);
2222
2225
  /* Write the data. */
@@ -2947,12 +2950,13 @@ int same_content_value_range(Value value0,
2947
2950
 
2948
2951
  /** Creates a reference to a range inside a signal.
2949
2952
  * @param signal the signal to refer
2953
+ * @param typ the type of the elements
2950
2954
  * @param first the start index of the range
2951
2955
  * @param last the end index of the range
2952
2956
  * @return the resulting reference */
2953
- RefRangeS make_ref_rangeS(SignalI signal, unsigned long long first,
2957
+ RefRangeS make_ref_rangeS(SignalI signal, Type typ, unsigned long long first,
2954
2958
  unsigned long long last) {
2955
- RefRangeS result = { signal, first, last };
2959
+ RefRangeS result = { signal, typ, first, last };
2956
2960
  return result;
2957
2961
  }
2958
2962
 
@@ -586,12 +586,14 @@ void transmit_to_signal_range_seq(Value value, RefRangeS ref) {
586
586
  SignalI signal = ref.signal;
587
587
  unsigned long long first = ref.first;
588
588
  unsigned long long last = ref.last;
589
- // printf("Tansmit to signal range: %s(%p)\n",signal->name,signal);
589
+ // printf("Tansmit to signal range: %s(%p) [%llu,%llu]\n",signal->name,signal,first,last);
590
590
  /* Can transmit, copy the content. */
591
591
  if (signal->fading)
592
- write_range(value,first,last,signal->f_value->type,signal->f_value);
592
+ // write_range(value,first,last,signal->f_value->type,signal->f_value);
593
+ write_range(value,first,last,ref.type,signal->f_value);
593
594
  else
594
- write_range_no_z(value,first,last,signal->f_value->type,signal->f_value);
595
+ // write_range_no_z(value,first,last,signal->f_value->type,signal->f_value);
596
+ write_range_no_z(value,first,last,ref.type,signal->f_value);
595
597
  /* And touch the signal. */
596
598
  touch_signal_seq(signal);
597
599
  }
@@ -1,3 +1,3 @@
1
1
  module HDLRuby
2
- VERSION = "2.6.19"
2
+ VERSION = "2.6.22"
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.19
4
+ version: 2.6.22
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-10-06 00:00:00.000000000 Z
11
+ date: 2021-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -150,6 +150,7 @@ files:
150
150
  - lib/HDLRuby/hdr_samples/with_memory_rom.rb
151
151
  - lib/HDLRuby/hdr_samples/with_multi_channels.rb
152
152
  - lib/HDLRuby/hdr_samples/with_reconf.rb
153
+ - lib/HDLRuby/hdr_samples/with_reduce.rb
153
154
  - lib/HDLRuby/hdr_samples/with_to_array.rb
154
155
  - lib/HDLRuby/hdrcc.rb
155
156
  - lib/HDLRuby/high_samples/_adder_fault.rb