HDLRuby 2.4.15 → 2.4.17
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 +4 -4
- data/lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_hs_32.v +1277 -0
- data/lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_qu_213.v +1345 -0
- data/lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_qu_222.v +1339 -0
- data/lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_rg_23.v +1248 -0
- data/lib/HDLRuby/hdr_samples/make_multi_channels_v.rb +24 -0
- data/lib/HDLRuby/hdr_samples/with_multi_channels.rb +0 -12
- data/lib/HDLRuby/hruby_tools.rb +7 -1
- data/lib/HDLRuby/version.rb +1 -1
- metadata +7 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/ruby
|
|
2
|
+
# Script for generating the vcd files.
|
|
3
|
+
|
|
4
|
+
# The configuration scenarii
|
|
5
|
+
$scenarii = [
|
|
6
|
+
[:_clk2_clk2, :register], # 0
|
|
7
|
+
[:_clk2_nclk2, :register], # 1
|
|
8
|
+
[:_clk2_clk3, :register], # 2
|
|
9
|
+
[:_clk3_clk2, :register], # 3
|
|
10
|
+
[:_clk2_clk2, :handshake], # 4
|
|
11
|
+
[:_clk2_nclk2, :handshake], # 5
|
|
12
|
+
[:_clk2_clk3, :handshake], # 6
|
|
13
|
+
[:_clk3_clk2, :handshake], # 7
|
|
14
|
+
[:clk2_clk2_clk2, :queue], # 8
|
|
15
|
+
[:clk2_clk2_nclk2, :queue], # 9
|
|
16
|
+
[:clk1_clk2_clk3, :queue], # 10
|
|
17
|
+
[:clk3_clk2_clk1, :queue], # 11
|
|
18
|
+
[:clk2_clk3_clk1, :queue], # 12
|
|
19
|
+
[:clk2_clk1_clk3, :queue], # 13
|
|
20
|
+
]
|
|
21
|
+
$scenarii.each_with_index do |scenarii,i|
|
|
22
|
+
puts "scenario: [#{i}] #{scenarii}"
|
|
23
|
+
`bundle exec ../hdrcc.rb --verilog with_multi_channels.rb WithMultiChannelPaper.V#{i} #{i}`
|
|
24
|
+
end
|
|
@@ -23,12 +23,6 @@ channel(:queue) do |typ,depth,clk,rst|
|
|
|
23
23
|
par(clk.posedge) do
|
|
24
24
|
hif(rst) { rptr <= 0; wptr <= 0 }
|
|
25
25
|
helse do
|
|
26
|
-
# hif(rsync) do
|
|
27
|
-
# hif(rptr != wptr) do
|
|
28
|
-
# rdata <= buffer[rptr]
|
|
29
|
-
# end
|
|
30
|
-
# end
|
|
31
|
-
# helse do
|
|
32
26
|
hif(~rsync) do
|
|
33
27
|
hif (~rreq) { rack <= 0 }
|
|
34
28
|
hif(rreq & (~rack) & (rptr != wptr)) do
|
|
@@ -38,10 +32,6 @@ channel(:queue) do |typ,depth,clk,rst|
|
|
|
38
32
|
end
|
|
39
33
|
end
|
|
40
34
|
|
|
41
|
-
# hif(wsync) do
|
|
42
|
-
# buffer[wptr] <= wdata
|
|
43
|
-
# end
|
|
44
|
-
# helse do
|
|
45
35
|
hif(~wsync) do
|
|
46
36
|
hif (~wreq) { wack <= 0 }
|
|
47
37
|
hif(wreq & (~wack) & (((wptr+1) % depth) != rptr)) do
|
|
@@ -67,7 +57,6 @@ channel(:queue) do |typ,depth,clk,rst|
|
|
|
67
57
|
end
|
|
68
58
|
seq do
|
|
69
59
|
hif(rptr != wptr) do
|
|
70
|
-
# target <= rdata
|
|
71
60
|
target <= buffer[rptr]
|
|
72
61
|
rptr <= (rptr + 1) % depth
|
|
73
62
|
blk.call if blk
|
|
@@ -102,7 +91,6 @@ channel(:queue) do |typ,depth,clk,rst|
|
|
|
102
91
|
wreq <= 0
|
|
103
92
|
end
|
|
104
93
|
hif(((wptr+1) % depth) != rptr) do
|
|
105
|
-
# wdata <= target
|
|
106
94
|
buffer[wptr] <= target
|
|
107
95
|
wptr <= (wptr + 1) % depth
|
|
108
96
|
blk.call if blk
|
data/lib/HDLRuby/hruby_tools.rb
CHANGED
|
@@ -29,8 +29,14 @@ module HDLRuby
|
|
|
29
29
|
class ::Integer
|
|
30
30
|
|
|
31
31
|
# Gets the bit width
|
|
32
|
+
# NOTE: returns infinity if the number is negative.
|
|
32
33
|
def width
|
|
33
|
-
return Math.log2(self+1).ceil
|
|
34
|
+
return self >= 0 ? Math.log2(self+1).ceil : 1.0/0.0
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Tells if the value is a power of 2.
|
|
38
|
+
def pow2?
|
|
39
|
+
return self > 0 && (self & (self - 1) == 0)
|
|
34
40
|
end
|
|
35
41
|
end
|
|
36
42
|
|
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.4.
|
|
4
|
+
version: 2.4.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Lovic Gauthier
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-11-
|
|
11
|
+
date: 2020-11-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -66,6 +66,10 @@ files:
|
|
|
66
66
|
- lib/HDLRuby/alcc.rb
|
|
67
67
|
- lib/HDLRuby/backend/hruby_allocator.rb
|
|
68
68
|
- lib/HDLRuby/backend/hruby_c_allocator.rb
|
|
69
|
+
- lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_hs_32.v
|
|
70
|
+
- lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_qu_213.v
|
|
71
|
+
- lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_qu_222.v
|
|
72
|
+
- lib/HDLRuby/hdr_samples/WithMultiChannelExpVerilog/with_multi_channels_rg_23.v
|
|
69
73
|
- lib/HDLRuby/hdr_samples/adder.rb
|
|
70
74
|
- lib/HDLRuby/hdr_samples/adder_assign_error.rb
|
|
71
75
|
- lib/HDLRuby/hdr_samples/adder_bench.rb
|
|
@@ -84,6 +88,7 @@ files:
|
|
|
84
88
|
- lib/HDLRuby/hdr_samples/include.rb
|
|
85
89
|
- lib/HDLRuby/hdr_samples/instance_open.rb
|
|
86
90
|
- lib/HDLRuby/hdr_samples/linear_test.rb
|
|
91
|
+
- lib/HDLRuby/hdr_samples/make_multi_channels_v.rb
|
|
87
92
|
- lib/HDLRuby/hdr_samples/make_multi_channels_vcd.rb
|
|
88
93
|
- lib/HDLRuby/hdr_samples/mei8.rb
|
|
89
94
|
- lib/HDLRuby/hdr_samples/mei8_bench.rb
|