vertigo_vhdl 0.8.10 → 0.8.11
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/vertigo/tb_generator.rb +31 -14
 - data/lib/vertigo/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: 5f66142ff1aa2f02093dbc99c8cd22a78a44ae177d0ecaf41e1cc3289b505e80
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 406108f6e1fc88d54cd96b38708772e7051788b8c9ab9417a15bef96326004e1
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 9c3f59eea1d1a2ca3ec6c22361bcd5eb54512b95a9b76e60465d6aa2749072d730fc0d79d28cfe0b2d11048f49a29f655d55aabc34cf6f0c8fcbd0c82b3f440c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a12214d7979e71a31172ce35fa67ac7ca3bbf69c4a3e8730acdeae20c451cb9344b3a2c1d567389db41ffa699a896db6244f8ec3fdd4f9d15600d9caf7ef857e
         
     | 
    
        data/lib/vertigo/tb_generator.rb
    CHANGED
    
    | 
         @@ -13,15 +13,19 @@ module Vertigo 
     | 
|
| 
       13 
13 
     | 
    
         
             
                end
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
                def generate_from ast
         
     | 
| 
       16 
     | 
    
         
            -
                   
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
       18 
     | 
    
         
            -
             
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
     | 
    
         
            -
             
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
      
 16 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 17 
     | 
    
         
            +
                    @ast=ast
         
     | 
| 
      
 18 
     | 
    
         
            +
                    entity_arch=find_entity_arch()
         
     | 
| 
      
 19 
     | 
    
         
            +
                    detecting_clk_and_reset(entity_arch)
         
     | 
| 
      
 20 
     | 
    
         
            +
                    vhdl_tb=gen_code()
         
     | 
| 
      
 21 
     | 
    
         
            +
                    @tb_name=@entity_name+"_tb"
         
     | 
| 
      
 22 
     | 
    
         
            +
                    tb_filename=@tb_name+".vhd"
         
     | 
| 
      
 23 
     | 
    
         
            +
                    File.open(tb_filename,'w'){|f| f.puts vhdl_tb}
         
     | 
| 
      
 24 
     | 
    
         
            +
                    puts "=> generated testbench : #{tb_filename}" unless options[:mute]
         
     | 
| 
      
 25 
     | 
    
         
            +
                    return tb_filename
         
     | 
| 
      
 26 
     | 
    
         
            +
                  rescue Exception => e
         
     | 
| 
      
 27 
     | 
    
         
            +
                    puts e.backtrace
         
     | 
| 
      
 28 
     | 
    
         
            +
                  end
         
     | 
| 
       25 
29 
     | 
    
         
             
                end
         
     | 
| 
       26 
30 
     | 
    
         | 
| 
       27 
31 
     | 
    
         
             
                def line n=80
         
     | 
| 
         @@ -113,7 +117,9 @@ module Vertigo 
     | 
|
| 
       113 
117 
     | 
    
         
             
                  code << line
         
     | 
| 
       114 
118 
     | 
    
         
             
                  code << comment("Design Under Test")
         
     | 
| 
       115 
119 
     | 
    
         
             
                  code << line
         
     | 
| 
       116 
     | 
    
         
            -
                   
     | 
| 
      
 120 
     | 
    
         
            +
                  str="dut : entity work.#{@entity_name}"
         
     | 
| 
      
 121 
     | 
    
         
            +
                  str+="(#{@arch_name})" if @arch_name
         
     | 
| 
      
 122 
     | 
    
         
            +
                  code << str
         
     | 
| 
       117 
123 
     | 
    
         
             
                  code.indent=2
         
     | 
| 
       118 
124 
     | 
    
         
             
                  code << "port map ("
         
     | 
| 
       119 
125 
     | 
    
         
             
                  code.indent=4
         
     | 
| 
         @@ -164,13 +170,13 @@ module Vertigo 
     | 
|
| 
       164 
170 
     | 
    
         
             
                  puts "=> found entity '#{entity.name.str}'" unless options[:mute]
         
     | 
| 
       165 
171 
     | 
    
         
             
                  @arch=ast.design_units.find{|du| du.is_a? Architecture}
         
     | 
| 
       166 
172 
     | 
    
         
             
                  if @arch.nil?
         
     | 
| 
       167 
     | 
    
         
            -
                    puts msg=" 
     | 
| 
       168 
     | 
    
         
            -
             
     | 
| 
      
 173 
     | 
    
         
            +
                    puts msg="WARNING : no architecture found"
         
     | 
| 
      
 174 
     | 
    
         
            +
                  else
         
     | 
| 
      
 175 
     | 
    
         
            +
                    puts "=> found architecture '#{arch.name.str}'" unless options[:mute]
         
     | 
| 
       169 
176 
     | 
    
         
             
                  end
         
     | 
| 
       170 
177 
     | 
    
         | 
| 
       171 
     | 
    
         
            -
                  puts "=> found architecture '#{arch.name.str}'" unless options[:mute]
         
     | 
| 
       172 
178 
     | 
    
         
             
                  @entity_name=@entity.name.str
         
     | 
| 
       173 
     | 
    
         
            -
                  @arch_name=@arch.name.str
         
     | 
| 
      
 179 
     | 
    
         
            +
                  @arch_name=@arch.name.str if @arch
         
     | 
| 
       174 
180 
     | 
    
         
             
                  [@entity,@arch]
         
     | 
| 
       175 
181 
     | 
    
         
             
                end
         
     | 
| 
       176 
182 
     | 
    
         | 
| 
         @@ -182,7 +188,18 @@ module Vertigo 
     | 
|
| 
       182 
188 
     | 
    
         
             
                  @rst = inputs.sort_by{|input| levenshtein_distance(input.name.str,"reset_n")}.first
         
     | 
| 
       183 
189 
     | 
    
         
             
                  puts "\t-most probable clk   : #{@clk.name.str}" unless options[:mute]
         
     | 
| 
       184 
190 
     | 
    
         
             
                  puts "\t-most probable reset : #{@rst.name.str}" unless options[:mute]
         
     | 
| 
      
 191 
     | 
    
         
            +
             
     | 
| 
       185 
192 
     | 
    
         
             
                  @max_length_str=entity.ports.map{|port| port.name.str.size}.max
         
     | 
| 
      
 193 
     | 
    
         
            +
             
     | 
| 
      
 194 
     | 
    
         
            +
                  print "\t-validate [Y/n] ? "
         
     | 
| 
      
 195 
     | 
    
         
            +
                  answer=$stdin.gets.chomp
         
     | 
| 
      
 196 
     | 
    
         
            +
                  if answer=="n"
         
     | 
| 
      
 197 
     | 
    
         
            +
                    puts "ok, switching to 'clk' and 'reset_n'"
         
     | 
| 
      
 198 
     | 
    
         
            +
                    @reset_name="reset_n"
         
     | 
| 
      
 199 
     | 
    
         
            +
                    @clk_name="clk"
         
     | 
| 
      
 200 
     | 
    
         
            +
                    @excluded=[]
         
     | 
| 
      
 201 
     | 
    
         
            +
                    return
         
     | 
| 
      
 202 
     | 
    
         
            +
                  end
         
     | 
| 
       186 
203 
     | 
    
         
             
                  @excluded=[@clk,@rst]
         
     | 
| 
       187 
204 
     | 
    
         
             
                  @reset_name=@rst.name.str
         
     | 
| 
       188 
205 
     | 
    
         
             
                  @clk_name=@clk.name.str
         
     | 
    
        data/lib/vertigo/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: vertigo_vhdl
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.8. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.8.11
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jean-Christophe Le Lann
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2021- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-11-02 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies: []
         
     | 
| 
       13 
13 
     | 
    
         
             
            description: A Ruby handwritten VHDL parser and utilities
         
     | 
| 
       14 
14 
     | 
    
         
             
            email: jean-christophe.le_lann@ensta-bretagne.fr
         
     |