Method: Tdl.inst_axis_width_combin

Defined in:
lib/tdl/axi_stream/bak/axis_width_combin_auto.rb

.inst_axis_width_combin(slim_axis: "slim_axis", wide_axis: "wide_axis") ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/tdl/axi_stream/bak/axis_width_combin_auto.rb', line 97

def Tdl.inst_axis_width_combin(
    slim_axis:"slim_axis",
    wide_axis:"wide_axis")
    hash = TdlHash.new
    
    unless slim_axis.is_a? Hash
        hash.case_record(:slim_axis,slim_axis)
    else
        # hash.new_index(:slim_axis)= lambda { a = AxiStream.new(slim_axis);a.name = "slim_axis";return a }
        # hash[:slim_axis] = lambda { a = AxiStream.new(slim_axis);a.name = "slim_axis";return a }
        raise TdlError.new('axis_width_combin AxiStream slim_axis TdlHash cant include Proc') if slim_axis.select{ |k,v| v.is_a? Proc }.any?
        lam = lambda {
            a = AxiStream.new(slim_axis)
            unless slim_axis[:name]
                a.name = "slim_axis"
            end
            return a }
        hash.[]=(:slim_axis,lam,false)
    end
            

    unless wide_axis.is_a? Hash
        hash.case_record(:wide_axis,wide_axis)
    else
        # hash.new_index(:wide_axis)= lambda { a = AxiStream.new(wide_axis);a.name = "wide_axis";return a }
        # hash[:wide_axis] = lambda { a = AxiStream.new(wide_axis);a.name = "wide_axis";return a }
        raise TdlError.new('axis_width_combin AxiStream wide_axis TdlHash cant include Proc') if wide_axis.select{ |k,v| v.is_a? Proc }.any?
        lam = lambda {
            a = AxiStream.new(wide_axis)
            unless wide_axis[:name]
                a.name = "wide_axis"
            end
            return a }
        hash.[]=(:wide_axis,lam,false)
    end
            

    hash.push_to_module_stack(AxiStream,:axis_width_combin)
    hash.open_error = true
    return hash
end