OpenCores
URL https://opencores.org/ocsvn/soc_maker/soc_maker/trunk

Subversion Repositories soc_maker

[/] [soc_maker/] [trunk/] [lib/] [soc_maker/] [soc_def.rb] - Diff between revs 8 and 9

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 8 Rev 9
Line 49... Line 49...
  include YAML_EXT
  include YAML_EXT
 
 
  attr_accessor :cores
  attr_accessor :cores
  attr_accessor :cons
  attr_accessor :cons
  attr_accessor :static
  attr_accessor :static
  def initialize( name, version, toplevel, options = {} )
  def initialize( name, version, toplevel, optional = {} )
 
 
    init_with( { 'name'     => name,
    init_with( { 'name'     => name,
                 'version'  => version,
                 'version'  => version,
                 'toplevel' => toplevel }.merge( options ) )
                 'toplevel' => toplevel }.merge( optional ) )
 
 
  end
  end
 
 
  def encode_with( coder )
  def encode_with( coder )
    super coder
    super coder
Line 126... Line 126...
    return false
    return false
 
 
  end
  end
 
 
 
 
  def get_port_len( ifc_name, port_name, inst )
  def port_length( ifc_name, port_name, inst )
    if @cores[ inst.to_sym ] != nil
    if @cores[ inst.to_sym ] != nil
      return @cores[ inst ].get_port_len( ifc_name, port_name )
      return @cores[ inst ].port_length( ifc_name, port_name )
    else
    else
      return nil
      return nil
    end
    end
  end
  end
 
 
  def get_core_def( inst )
  def core_definition( inst )
      if @cores[ inst.to_sym ] != nil
      if @cores[ inst.to_sym ] != nil
        return @cores[ inst.to_sym ].defn
        return @cores[ inst.to_sym ].defn
      elsif inst == @name
      elsif inst == @name
        return self
        return self
      else
      else
Line 171... Line 171...
       perr_if( ifc_in_use?( sub_arr[ 0 ], sub_arr[ 1 ] ),
       perr_if( ifc_in_use?( sub_arr[ 0 ], sub_arr[ 1 ] ),
           "Interface #{sub_arr[ 1 ]} of instance '#{sub_arr[ 0 ]}' is already in use " )
           "Interface #{sub_arr[ 1 ]} of instance '#{sub_arr[ 0 ]}' is already in use " )
    end
    end
 
 
 
 
    core_def_1 = get_core_def( inst1 )
    core_def_1 = core_definition( inst1 )
    core_def_2 = get_core_def( inst2 )
    core_def_2 = core_definition( inst2 )
 
 
    perr_if( !core_def_1, "Can't find core #{inst1}" )
    perr_if( !core_def_1, "Can't find core #{inst1}" )
    perr_if( !core_def_2, "Can't find core #{inst2}" )
    perr_if( !core_def_2, "Can't find core #{inst2}" )
 
 
 
 
Line 281... Line 281...
    @cores.values.uniq{|x| x.type }.each do |core_inst; core_def, dst_dir|
    @cores.values.uniq{|x| x.type }.each do |core_inst; core_def, dst_dir|
 
 
      core_def = SOCMaker::lib.get_core( core_inst.type )
      core_def = SOCMaker::lib.get_core( core_inst.type )
 
 
      # create destination directory name and ensure, that it is exist
      # create destination directory name and ensure, that it is exist
      dst_dir  = get_and_ensure_dst_dir!( core_def.name )
      dst_dir  = Component.get_and_ensure_dst_dir!( core_def.name )
 
 
      # copy each file into destination dir
      # copy each file into destination dir
      core_def.hdlfiles.each do |file, val|
      core_def.hdlfiles.each do |file, val|
        file_path = File.join( core_def.dir, val.path )
        file_path = File.join( core_def.dir, val.path )
        dst_path = File.join( dst_dir, val.path )
        dst_path = File.join( dst_dir, val.path )
Line 327... Line 327...
 
 
        end
        end
 
 
        # create file paths
        # create file paths
        src_path = File.join( core_def.dir, sparam.path )
        src_path = File.join( core_def.dir, sparam.path )
        dst_dir  = get_and_ensure_dst_dir!( core_def.name )
        dst_dir  = Component::get_and_ensure_dst_dir!( core_def.name )
        dst_path = File.join( dst_dir, sparam.file_dst )
        dst_path = File.join( dst_dir, sparam.file_dst )
 
 
 
 
        # process each line of input file
        # process each line of input file
        # and replace tokens by value via
        # and replace tokens by value via

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.