Class: TdlSpace::DefAxiLite_ArrayChain

Inherits:
DefArrayChain show all
Defined in:
lib/tdl/sdlmodule/sdlmodule_arraychain.rb

Instance Attribute Summary collapse

Attributes inherited from DefArrayChain

#belong_to_module, #chain

Instance Method Summary collapse

Methods inherited from DefArrayChain

#check_name, #check_topmodule_method, #method_missing, #to_inp

Constructor Details

#initialize(belong_to_module: nil, clock: nil, reset: nil, dsize: 8, asize: 8, mode: AxiLite::BOTH, freqM: nil) ⇒ DefAxiLite_ArrayChain

Returns a new instance of DefAxiLite_ArrayChain.



209
210
211
212
213
214
215
216
217
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 209

def initialize(belong_to_module: nil,clock: nil,reset: nil,dsize: 8,asize: 8,mode: AxiLite::BOTH,freqM: nil)
    super(belong_to_module)
    @dsize = dsize 
    @freqM = freqM
    @clock = clock 
    @reset = reset
    @asize = asize
    @mode = mode
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TdlSpace::DefArrayChain

Instance Attribute Details

#asizeObject

Returns the value of attribute asize.



208
209
210
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 208

def asize
  @asize
end

#clockObject

Returns the value of attribute clock.



208
209
210
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 208

def clock
  @clock
end

#dsizeObject

Returns the value of attribute dsize.



208
209
210
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 208

def dsize
  @dsize
end

#freqMObject

Returns the value of attribute freqM.



208
209
210
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 208

def freqM
  @freqM
end

#modeObject

Returns the value of attribute mode.



208
209
210
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 208

def mode
  @mode
end

#resetObject

Returns the value of attribute reset.



208
209
210
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 208

def reset
  @reset
end

Instance Method Details

#-(name, clock: nil, reset: nil, freqM: nil, dsize: nil, asize: nil, mode: nil) ⇒ Object



228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 228

def -(name,clock: nil,reset: nil,freqM: nil,dsize: nil,asize: nil,mode: nil)
    name = to_inp(name)

    belong_to_module.Def.axilite(
        name: name ,
        clock: clock||@clock,
        reset: reset||@reset ,
        dsize: dsize||@dsize ,
        # dimension: @chain,
        asize: asize || @asize,
        mode: mode || @mode,
        freqM:freqM||@freqM)
end

#[](*a) ⇒ Object



219
220
221
222
223
224
225
226
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 219

def [](*a)
    if a.empty?
        raise TdlError.new("参数不能为空")
    end
    new_dla = self.class.new(belong_to_module: @belong_to_module,clock: @clock,reset:@reset,freqM: @freqM,dsize: @dsize,asize: @asize,mode: @mode)
    new_dla.chain = @chain + a
    new_dla
end