HDLRuby 2.11.3 → 2.11.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -2
- data/ext/hruby_sim/hruby_rcsim_build.c +36 -11
- data/ext/hruby_sim/hruby_sim.h +13 -1
- data/ext/hruby_sim/hruby_sim_core.c +84 -50
- data/ext/hruby_sim/hruby_sim_tree_calc.c +14 -0
- data/ext/hruby_sim/hruby_sim_vcd.c +23 -9
- data/lib/HDLRuby/hdr_samples/repeat_bench.rb +48 -0
- data/lib/HDLRuby/hruby_high.rb +11 -6
- data/lib/HDLRuby/hruby_low.rb +27 -17
- data/lib/HDLRuby/hruby_low2c.rb +31 -7
- data/lib/HDLRuby/hruby_rcsim.rb +16 -2
- data/lib/HDLRuby/hruby_rsim.rb +154 -79
- data/lib/HDLRuby/hruby_rsim_vcd.rb +181 -10
- data/lib/HDLRuby/hruby_verilog.rb +71 -58
- data/lib/HDLRuby/version.rb +1 -1
- metadata +3 -2
@@ -254,60 +254,62 @@ module HDLRuby::Low
|
|
254
254
|
|
255
255
|
|
256
256
|
|
257
|
-
#
|
258
|
-
#
|
259
|
-
#
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
end
|
257
|
+
# Deprecated with new TimeRepeat!
|
258
|
+
#
|
259
|
+
# # Extract and convert to verilog the TimeRepeat statements.
|
260
|
+
# # NOTE: work only on the current level of the block (should be called
|
261
|
+
# # through each_block_deep).
|
262
|
+
# def repeat_to_verilog!
|
263
|
+
# code = ""
|
264
|
+
# # Gather the TimeRepeat statements.
|
265
|
+
# repeats = self.each_statement.find_all { |st| st.is_a?(TimeRepeat) }
|
266
|
+
# # Remove them from the block.
|
267
|
+
# repeats.each { |st| self.delete_statement!(st) }
|
268
|
+
# # Generate them separately in timed always processes.
|
269
|
+
# repeats.each do |st|
|
270
|
+
# code << " always #{st.delay.to_verilog} begin\n"
|
271
|
+
|
272
|
+
# # Perform "scheduling" using the method "flatten".
|
273
|
+
# block = st.statement.flatten(st.statement.mode.to_s)
|
274
|
+
|
275
|
+
# # Declaration of "inner" part within "always".
|
276
|
+
# block.each_inner do |inner|
|
277
|
+
# # if regs.include?(inner.name) then
|
278
|
+
# if HDLRuby::Low::VERILOG_REGS.include?(inner.to_verilog) then
|
279
|
+
# code << " reg"
|
280
|
+
# else
|
281
|
+
# code << " wire"
|
282
|
+
# end
|
283
|
+
|
284
|
+
# # Variable has "base", but if there is width etc, it is not in "base".
|
285
|
+
# # It is determined by an if.
|
286
|
+
# if inner.type.base?
|
287
|
+
# if inner.type.base.base?
|
288
|
+
# code << "#{inner.type.base.to_verilog} #{inner.to_verilog} #{inner.type.to_verilog}"
|
289
|
+
# else
|
290
|
+
# code << "#{inner.type.to_verilog} #{inner.to_verilog}"
|
291
|
+
# end
|
292
|
+
# else
|
293
|
+
# code << " #{inner.type.to_verilog}#{inner.to_verilog}"
|
294
|
+
# end
|
295
|
+
# if inner.value then
|
296
|
+
# # There is an initial value.
|
297
|
+
# code << " = #{inner.value.to_verilog}"
|
298
|
+
# end
|
299
|
+
# code << ";\n"
|
300
|
+
# end
|
301
|
+
|
302
|
+
# # Translate the block that finished scheduling.
|
303
|
+
# block.each_statement do |statement|
|
304
|
+
# code << "\n #{statement.to_verilog(block.mode.to_s)}"
|
305
|
+
# end
|
306
|
+
|
307
|
+
# FmI.fm_par.clear()
|
308
|
+
|
309
|
+
# code << "\n end\n\n"
|
310
|
+
# end
|
311
|
+
# return code
|
312
|
+
# end
|
311
313
|
|
312
314
|
|
313
315
|
# Process top layer of Block.
|
@@ -1814,6 +1816,15 @@ module HDLRuby::Low
|
|
1814
1816
|
end
|
1815
1817
|
end
|
1816
1818
|
|
1819
|
+
|
1820
|
+
# Generate verilog code for the TimeRepeat.
|
1821
|
+
class TimeRepeat
|
1822
|
+
def to_verilog(spc = 3)
|
1823
|
+
result = (" " * spc) + "repeat(#{self.number})" + "\n"
|
1824
|
+
result << self.statement.to_verilog(spc+3)
|
1825
|
+
end
|
1826
|
+
end
|
1827
|
+
|
1817
1828
|
# Those who disappeared.
|
1818
1829
|
#class SystemI
|
1819
1830
|
#class TypeTuple
|
@@ -2137,10 +2148,12 @@ module HDLRuby::Low
|
|
2137
2148
|
if behavior.block.is_a?(TimeBlock) then
|
2138
2149
|
# Tell it is a time behavior for further processing.
|
2139
2150
|
timebeh = true
|
2140
|
-
#
|
2141
|
-
|
2142
|
-
|
2143
|
-
|
2151
|
+
# Deprecated with new TimeRepeat.
|
2152
|
+
#
|
2153
|
+
# # Extract and translate the TimeRepeat separately.
|
2154
|
+
# behavior.each_block_deep do |blk|
|
2155
|
+
# codeC << blk.repeat_to_verilog!
|
2156
|
+
# end
|
2144
2157
|
# And generate an initial block.
|
2145
2158
|
codeC << " initial "
|
2146
2159
|
else
|
data/lib/HDLRuby/version.rb
CHANGED
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.11.
|
4
|
+
version: 2.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lovic Gauthier
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -148,6 +148,7 @@ files:
|
|
148
148
|
- lib/HDLRuby/hdr_samples/ram.rb
|
149
149
|
- lib/HDLRuby/hdr_samples/range_bench.rb
|
150
150
|
- lib/HDLRuby/hdr_samples/register_with_code_bench.rb
|
151
|
+
- lib/HDLRuby/hdr_samples/repeat_bench.rb
|
151
152
|
- lib/HDLRuby/hdr_samples/rom.rb
|
152
153
|
- lib/HDLRuby/hdr_samples/rom_nest.rb
|
153
154
|
- lib/HDLRuby/hdr_samples/ruby_fir_hw.rb
|