Class: ClassHDL::HDLAlwaysFFBlock

Inherits:
HDLAlwaysBlock show all
Defined in:
lib/tdl/class_hdl/hdl_always_ff.rb

Direct Known Subclasses

HDLAlwaysSIMBlock

Instance Attribute Summary

Attributes inherited from HDLAlwaysBlock

#belong_to_module, #negedges, #opertor_chains, #posedges

Instance Method Summary collapse

Methods inherited from HDLAlwaysBlock

#edge_instance, #initialize

Constructor Details

This class inherits a constructor from ClassHDL::HDLAlwaysBlock

Instance Method Details

#instanceObject



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/tdl/class_hdl/hdl_always_ff.rb', line 79

def instance
    str = []

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

    str.push "always_ff@(#{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