Class: TdlBuild

Inherits:
Object
  • Object
show all
Defined in:
lib/tdl/class_hdl/hdl_module_def.rb

Direct Known Subclasses

TdlTestUnit

Class Method Summary collapse

Class Method Details

.method_missing(method, *args, &block) ⇒ Object

return ClassHDL::AnonyModule.new



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 5

def self.method_missing(method,*args,&block)
    
    sdlm = SdlModule.new(name: method,out_sv_path: args[0])
    @@package_names ||= []
    sdlm.head_import_packages = []
    sdlm.head_import_packages += @@package_names

    @@package_names.each do |e|
        sdlm.require_package(e,false) if e
    end
    @@package_names = []
    sdlm.instance_exec(&block)

    if args[0] && File.exist?(args[0])
        sdlm.gen_sv_module
    else 
        sdlm.origin_sv = true 
    end
    sdlm
end

.with_package(*args) ⇒ Object

定义模块时添加 package



27
28
29
30
# File 'lib/tdl/class_hdl/hdl_module_def.rb', line 27

def self.with_package(*args)
    @@package_names += args
    return self 
end