Class: TdlSpace::DefAxi4_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, lsize: 8, idsize: 1, addr_step: 1.0, mode: Axi4::BOTH, freqM: nil) ⇒ DefAxi4_ArrayChain

Returns a new instance of DefAxi4_ArrayChain.



246
247
248
249
250
251
252
253
254
255
256
257
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 246

def initialize(belong_to_module: nil,clock: nil,reset: nil,dsize: 8,asize: 8,lsize:8,idsize:1,addr_step: 1.0,mode: Axi4::BOTH,freqM: nil)
    super(belong_to_module)
    @dsize = dsize 
    @freqM = freqM
    @clock = clock 
    @reset = reset
    @asize = asize
    @mode = mode
    @lsize = lsize 
    @idsize = idsize 
    @addr_step = addr_step
end

Dynamic Method Handling

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

Instance Attribute Details

#addr_stepObject

Returns the value of attribute addr_step.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def addr_step
  @addr_step
end

#asizeObject

Returns the value of attribute asize.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def asize
  @asize
end

#clockObject

Returns the value of attribute clock.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def clock
  @clock
end

#dsizeObject

Returns the value of attribute dsize.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def dsize
  @dsize
end

#freqMObject

Returns the value of attribute freqM.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def freqM
  @freqM
end

#idsizeObject

Returns the value of attribute idsize.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def idsize
  @idsize
end

#lsizeObject

Returns the value of attribute lsize.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def lsize
  @lsize
end

#modeObject

Returns the value of attribute mode.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def mode
  @mode
end

#resetObject

Returns the value of attribute reset.



245
246
247
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 245

def reset
  @reset
end

Instance Method Details

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



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 278

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

    belong_to_module.Def.axi4(
        name: name ,
        clock: clock||@clock,
        reset: reset||@reset ,
        dsize: dsize||@dsize ,
        dimension: @chain,
        asize: asize || @asize,
        mode: mode || @mode,
        lsize: lsize || @lsize,
        idsize: idsize || @idsize,
        addr_step: addr_step || @addr_step,
        freqM:freqM||@freqM)
end

#[](*a) ⇒ Object



259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/tdl/sdlmodule/sdlmodule_arraychain.rb', line 259

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,
        idsize: @idsize,
        lsize: @lsize,
        addr_step: @addr_step,
        asize: @asize,
        mode: @mode)
    new_dla.chain = @chain + a
    new_dla
end