Class: NqString

Inherits:
String show all
Includes:
ClassHDL::AssignDefOpertor
Defined in:
lib/tdl/basefunc.rb,
lib/tdl/class_hdl/hdl_redefine_opertor.rb

Constant Summary

Constants included from ClassHDL::AssignDefOpertor

ClassHDL::AssignDefOpertor::OP_SYMBOLS

Instance Method Summary collapse

Methods included from ClassHDL::AssignDefOpertor

curr_assign_block, curr_assign_block=, curr_assign_block_stack, curr_opertor_stack, included, init_op_methods, use_new_yield_opertors, use_old_cond_opertors, with_new_assign_block, with_new_opertor, with_normal_opertor, with_rollback_opertors

Methods inherited from String

#high_signal, #low_signal, #snoop, #to_inp, #to_nq

Methods included from CtrlLogic

#broaden_and_cross_clk, #cross_clock, #latency

Instance Method Details

#[](a, b = nil) ⇒ Object



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/tdl/class_hdl/hdl_redefine_opertor.rb', line 413

def [](a,b=nil)
    if a.is_a? ClassHDL::OpertorChain
        a.slaver = true
        arel = a.instance(:slaver)
    else 
        arel = a 
    end

    if b.is_a? ClassHDL::OpertorChain
        b.slaver = true
        brel = b.instance(:slaver)
    else 
        brel = b
    end

    unless b 
        if a.is_a? Range
            af = a.first
            al = a.last
            return "#{self}[#{af}:#{al}]".to_nq
        end 

        
        return "#{self}[#{arel}]".to_nq
    else 
        return "#{self}[#{arel}:#{brel}]".to_nq
    end
end

#clog2Object



89
90
91
# File 'lib/tdl/basefunc.rb', line 89

def clog2
    return "$clog2(#{self})"
end