HDLRuby 2.6.18 → 2.6.19
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/hruby_verilog_name.rb +24 -52
- data/lib/HDLRuby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 752424361455f2bd949a8f90c9802337f3ce1d853ebff6bfa44bbe25ebeda369
|
|
4
|
+
data.tar.gz: f9c2dd84c0c875c423a94211948beaea44b54bfe234c01d6f35716b7df26053c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cc71caee7a2435e579b533b4cbba22c6bc9ca9e8e75be4e57d4a629b7a467ac28a2a302f6d53cf7552a1c1f115e17f5ec7b7648eadc482ab62bc2fdff1319cc6
|
|
7
|
+
data.tar.gz: 4053a2050e82212db5901c7cb4756b21bca3465ec9ee4d08cd2875d8b57e5c53cd05df0405e2f5b249ec96b28271f514c8707fbb43b8e69db901ff9713a9b1f4
|
|
@@ -6,63 +6,35 @@ module HDLRuby::Verilog
|
|
|
6
6
|
# This is sample.
|
|
7
7
|
# n = "abc_ABC_いろは"
|
|
8
8
|
# puts n
|
|
9
|
-
# name = n.split("")
|
|
9
|
+
# name = n.split("")
|
|
10
|
+
|
|
11
|
+
@@hdr2verilog = {}
|
|
10
12
|
|
|
11
13
|
# Since it is possible to use $ and numbers other than the beginning of the character string, it is divided.
|
|
12
14
|
def name_to_verilog(name)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#
|
|
30
|
-
# name[1..-1].each_char do |c|
|
|
31
|
-
# # Confirmation of characters in array.
|
|
32
|
-
# # If it is a-zA-Z 0 - 9, it is added to ref as it is.
|
|
33
|
-
# if (c =~ /[a-zA-Z0-9]|\$/) then
|
|
34
|
-
# ref << c
|
|
35
|
-
# # _ To convert it to __.
|
|
36
|
-
# elsif (c == "_") then
|
|
37
|
-
# ref << "__"
|
|
38
|
-
# # If it does not satisfy the above, it is another character.
|
|
39
|
-
# # In that case, convert it to UTF-8 and convert it to a usable character string.
|
|
40
|
-
# else
|
|
41
|
-
# l = c.bytes.map{|v| v.to_s(16)}.join # Conversion to UTF-8 hexadecimal number.
|
|
42
|
-
#
|
|
43
|
-
# ref << "_" + l.rjust(6,"0") # Add an underscore indicating conversion.
|
|
44
|
-
# # The remainder of 6 digits is filled with 0.
|
|
45
|
-
# end
|
|
46
|
-
# end
|
|
47
|
-
# return ref
|
|
48
|
-
|
|
49
|
-
|
|
15
|
+
# name = name.to_s
|
|
16
|
+
# # Convert special characters.
|
|
17
|
+
# name = name.each_char.map do |c|
|
|
18
|
+
# if c=~ /[a-z0-9]/ then
|
|
19
|
+
# c
|
|
20
|
+
# elsif c == "_" then
|
|
21
|
+
# "__"
|
|
22
|
+
# else
|
|
23
|
+
# "_" + c.ord.to_s
|
|
24
|
+
# end
|
|
25
|
+
# end.join
|
|
26
|
+
# # First character: only letter is possible.
|
|
27
|
+
# unless name[0] =~ /[a-z_]/ then
|
|
28
|
+
# name = "_" + name
|
|
29
|
+
# end
|
|
30
|
+
# return name
|
|
50
31
|
name = name.to_s
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
elsif c == "_" then
|
|
56
|
-
"__"
|
|
57
|
-
else
|
|
58
|
-
"_" + c.ord.to_s
|
|
59
|
-
end
|
|
60
|
-
end.join
|
|
61
|
-
# First character: only letter is possible.
|
|
62
|
-
unless name[0] =~ /[a-z_]/ then
|
|
63
|
-
name = "_" + name
|
|
32
|
+
vname = @@hdr2verilog[name]
|
|
33
|
+
unless vname then
|
|
34
|
+
vname = "_v#{@@hdr2verilog.size}_#{name.split(/[^a-zA-Z_0-9]/)[-1]}"
|
|
35
|
+
@@hdr2verilog[name] = vname
|
|
64
36
|
end
|
|
65
|
-
return
|
|
37
|
+
return vname
|
|
66
38
|
end
|
|
67
39
|
|
|
68
40
|
#puts ref
|
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.6.
|
|
4
|
+
version: 2.6.19
|
|
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-
|
|
11
|
+
date: 2021-10-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|