Method: ClassHDL::HDLAlwaysBlock#instance

Defined in:
lib/tdl/class_hdl/hdl_always_ff.rb

#instanceObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/tdl/class_hdl/hdl_always_ff.rb', line 53

def instance
    str = []

    pose_str = edge_instance('posedge',@posedges)
    nege_str = edge_instance('negedge',@negedges)
    pose_str.concat nege_str

    str.push "always@(#{pose_str.join(",")}) begin "
    opertor_chains.each do |op|
        unless op.is_a? OpertorChain
            str.push op.instance(:always_ff).gsub(/^./){ |m| "    #{m}"}
        else 
            unless op.slaver
                rel_str = ClassHDL.compact_op_ch(op.instance(:always_ff, belong_to_module))
                str.push "    #{rel_str};"
            end
        end
        
    end
    str.push "end\n"
    str.join("\n")
end