HDLRuby 2.2.6 → 2.2.7
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.rb +8 -2
- data/lib/HDLRuby/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46d2fd2ab67a16431eab02c54ded6bf89d25fec14b1eb8c3d1764dee744c495f
|
4
|
+
data.tar.gz: b8985b4ae22fbf04e7205c0d47ad81bd6951af4f00f8a1f7ccbe1e13db79caf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa1927cc48bfa6c749b1be4aae7097c9c6192bcd384211376b2fbce01c0e0bd50e2120d0034959c87ac6e1d1adb579b2ece6740bd40fa0883a71192952bfbca7
|
7
|
+
data.tar.gz: ee78731680d837f0890adff846da3d4416d04b061b04ca28e170beaaccc9a5082bdb2896104835d8f503f30b666d9012925a3c38add4029ce2087fbaf5bbb385
|
@@ -1407,9 +1407,15 @@ class Value
|
|
1407
1407
|
if self.type.base.name.to_s == "bit"
|
1408
1408
|
return "#{self.type.range.first + 1}'b#{self.content.to_verilog}"
|
1409
1409
|
elsif self.type.name.to_s == "integer"
|
1410
|
-
|
1410
|
+
str = self.content.to_verilog
|
1411
|
+
if str[0] == "-" then
|
1412
|
+
# Negative value.
|
1413
|
+
return "-#{self.type.range.first + 1}'d#{str[1..-1]}"
|
1414
|
+
else
|
1415
|
+
return "#{self.type.range.first + 1}'d#{str}"
|
1416
|
+
end
|
1411
1417
|
end
|
1412
|
-
return "#{self.content.to_verilog}"
|
1418
|
+
return "#{self.type.range.first + 1}'b#{self.content.to_verilog}"
|
1413
1419
|
end
|
1414
1420
|
# How to use when simply obtaining the width
|
1415
1421
|
def to_getrange
|
data/lib/HDLRuby/version.rb
CHANGED