HDLRuby 2.4.21 → 2.4.22
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/rom.rb +4 -2
- data/lib/HDLRuby/hruby_low.rb +11 -1
- data/lib/HDLRuby/hruby_verilog.rb +10 -3
- 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: bd32be1a749a209488dea4e2d6d05c8c90a2a181ce48575288e33dc65c25ff02
         | 
| 4 | 
            +
              data.tar.gz: fc615ba447dc1fe712b2620f39d4f6fbbc1a5a698efa2c38b0ca4f075dc5a53f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 6b81a944107060ac2844260d83d90cac747decf72b3facf9fa06bb4453267679de12dbbc72c08a3016701a304ef1c1941b7689358e125cd00d1112f028e302cb
         | 
| 7 | 
            +
              data.tar.gz: 369b9864dc3504ab0536c6e3a1df19b70cda921f46c1680bfdf7b78087348f93864285dada62e52db9ab105b15510cb98c1054bfd870d01ee13913e3d5216d4e
         | 
| @@ -1,12 +1,14 @@ | |
| 1 1 |  | 
| 2 | 
            +
            signed[7..0].typedef(:typ)
         | 
| 3 | 
            +
             | 
| 2 4 | 
             
            # Describes an 8-bit data 4-bit address ROM.
         | 
| 3 5 | 
             
            system :rom4_8 do
         | 
| 4 6 | 
             
                [2..0].input :addr
         | 
| 5 7 | 
             
                [7..0].output :data0,:data1,:data2
         | 
| 6 8 |  | 
| 7 9 | 
             
                bit[7..0][0..7].constant content0: [0,1,2,3,4,5,6,7]
         | 
| 8 | 
            -
                 | 
| 9 | 
            -
                 | 
| 10 | 
            +
                signed[7..0][-8].constant content1: [0,1,2,3,4,5,6,7]
         | 
| 11 | 
            +
                typ[-8].constant content2: (8).times.to_a
         | 
| 10 12 |  | 
| 11 13 | 
             
                data0 <= content0[addr]
         | 
| 12 14 | 
             
                data1 <= content1[addr]
         | 
    
        data/lib/HDLRuby/hruby_low.rb
    CHANGED
    
    | @@ -1183,6 +1183,11 @@ module HDLRuby::Low | |
| 1183 1183 | 
             
                        return false
         | 
| 1184 1184 | 
             
                    end
         | 
| 1185 1185 |  | 
| 1186 | 
            +
                    # Tells if the type of of vector kind.
         | 
| 1187 | 
            +
                    def vector?
         | 
| 1188 | 
            +
                        return false
         | 
| 1189 | 
            +
                    end
         | 
| 1190 | 
            +
             | 
| 1186 1191 | 
             
                    # Gets the bitwidth of the type, by default 0.
         | 
| 1187 1192 | 
             
                    # Bit, signed, unsigned and Float base have a width of 1.
         | 
| 1188 1193 | 
             
                    def width
         | 
| @@ -1410,7 +1415,7 @@ module HDLRuby::Low | |
| 1410 1415 |  | 
| 1411 1416 | 
             
                        # Sets the delegations
         | 
| 1412 1417 | 
             
                        self.extend Forwardable
         | 
| 1413 | 
            -
                        [ :signed?, :unsigned?, :fixed?, :float?, :leaf?,
         | 
| 1418 | 
            +
                        [ :signed?, :unsigned?, :fixed?, :float?, :leaf?, :vector?,
         | 
| 1414 1419 | 
             
                          :width, :range?, :range, :base?, :base, :types?,
         | 
| 1415 1420 | 
             
                          :get_all_types, :get_type, :each, :each_type, 
         | 
| 1416 1421 | 
             
                          :regular?,
         | 
| @@ -1466,6 +1471,11 @@ module HDLRuby::Low | |
| 1466 1471 | 
             
                    # The base type of the vector
         | 
| 1467 1472 | 
             
                    attr_reader :base
         | 
| 1468 1473 |  | 
| 1474 | 
            +
                    # Tells if the type of of vector kind.
         | 
| 1475 | 
            +
                    def vector?
         | 
| 1476 | 
            +
                        return true
         | 
| 1477 | 
            +
                    end
         | 
| 1478 | 
            +
             | 
| 1469 1479 | 
             
                    # Tells if the type has a base.
         | 
| 1470 1480 | 
             
                    def base?
         | 
| 1471 1481 | 
             
                        return true
         | 
| @@ -11,6 +11,10 @@ include HDLRuby::Verilog | |
| 11 11 | 
             
            module HDLRuby::Low
         | 
| 12 12 |  | 
| 13 13 |  | 
| 14 | 
            +
                # The list of base types used both in verilog and HDLRuby
         | 
| 15 | 
            +
                VERILOG_BASE_TYPES = ["signed"]
         | 
| 16 | 
            +
             | 
| 17 | 
            +
             | 
| 14 18 | 
             
            # Sample of very handy for programming.
         | 
| 15 19 | 
             
            # puts "class=#{self.yes.class}"       # Confirm class of self.yes.
         | 
| 16 20 | 
             
            # puts "methods=#{self.right.methods}" # Confirm method of self.right.
         | 
| @@ -1349,7 +1353,8 @@ end | |
| 1349 1353 | 
             
            class TypeVector
         | 
| 1350 1354 | 
             
                # Converts the system to Verilog code.
         | 
| 1351 1355 | 
             
                def to_verilog
         | 
| 1352 | 
            -
                    if self.base.name.to_s != "bit"
         | 
| 1356 | 
            +
                    # if self.base.name.to_s != "bit"
         | 
| 1357 | 
            +
                    if VERILOG_BASE_TYPES.include?(self.base.name.to_s)
         | 
| 1353 1358 | 
             
                        return " #{self.base.name.to_s}[#{self.range.first}:#{self.range.last}]"
         | 
| 1354 1359 | 
             
                    end
         | 
| 1355 1360 | 
             
                    return " [#{self.range.first}:#{self.range.last}]"
         | 
| @@ -1750,10 +1755,12 @@ class SystemT | |
| 1750 1755 | 
             
                    end
         | 
| 1751 1756 | 
             
                    # And the array types signals.
         | 
| 1752 1757 | 
             
                    self.each_signal do |sig|
         | 
| 1753 | 
            -
                        regs << sig.to_verilog if sig.type.is_a?(TypeVector) && sig.type.base.is_a?(TypeVector)
         | 
| 1758 | 
            +
                        # regs << sig.to_verilog if sig.type.is_a?(TypeVector) && sig.type.base.is_a?(TypeVector)
         | 
| 1759 | 
            +
                        regs << sig.to_verilog if sig.type.vector? && sig.type.base.vector?
         | 
| 1754 1760 | 
             
                    end
         | 
| 1755 1761 | 
             
                    self.each_inner do |sig|
         | 
| 1756 | 
            -
                        regs << sig.to_verilog if sig.type.is_a?(TypeVector) && sig.type.base.is_a?(TypeVector)
         | 
| 1762 | 
            +
                        # regs << sig.to_verilog if sig.type.is_a?(TypeVector) && sig.type.base.is_a?(TypeVector)
         | 
| 1763 | 
            +
                        regs << sig.to_verilog if sig.type.vector? && sig.type.base.vector?
         | 
| 1757 1764 | 
             
                    end
         | 
| 1758 1765 |  | 
| 1759 1766 | 
             
                    # Code generation
         | 
    
        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.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:  | 
| 11 | 
            +
            date: 2021-01-01 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         |