def get_procedure(self):

        isEmpty = self.get_isempty_From_non_vector_method()

        argumentList = self.get_argumentList()

        content = self.get_self_args()

        content += self.get_internal_connections()

        members = self.obj.getMember(self.InOut_Filter)
        args = "clk => clk, "
        args += join_str(content + [
            str(x["name"]) + " => " + str(x["name"] + "(i)") for x in members
        ],
                         Delimeter=", ",
                         IgnoreIfEmpty=True)

        ret = ah_func.v_procedure(name=self.procedureName,
                                  argumentList=argumentList,
                                  body='''
        for i in 0 to self'length - 1 loop
        {PushPull}( {args});
        end loop;
            '''.format(PushPull=self.PushPull, args=args),
                                  isFreeFunction=True,
                                  IsEmpty=isEmpty)

        return ret
Example #2
0
    def make_function_or_procedure(self, functionName, returnType, bodystr,
                                   FuncArgsLocal, ArglistProcedure,
                                   varSigSuffix):

        actual_function_name = self.ClassInstance.__hdl_converter__.function_name_modifier(
            self.ClassInstance, functionName, varSigSuffix)

        if returnType is not None:
            ArglistProcedure = ArglistProcedure.replace(" in ", " ").replace(
                " out ", " ").replace(" inout ", " ")
            ret = v_function(name=actual_function_name,
                             body=bodystr,
                             VariableList=self.astParser.get_local_var_def(),
                             returnType=returnType,
                             argumentList=ArglistProcedure,
                             isFreeFunction=True)
            return ret

        ret = v_procedure(name=actual_function_name,
                          body=bodystr,
                          VariableList=self.astParser.get_local_var_def(),
                          argumentList=ArglistProcedure,
                          isFreeFunction=True)
        return ret
    def make_function_or_procedure(self, returnType , bodystr, FuncArgsLocal):
        argList = [
            hdl.to_arglist(
                x["symbol"], 
                x['name'],
                type(self.freeFunction).__name__, 
                withDefault = True,
                astParser=self.astParser
            ) 
            for x in FuncArgsLocal
        ]
        ArglistProcedure = join_str(argList,Delimeter="; ")
        actual_function_name = hdl.function_name_modifier(self.freeFunction, self.freeFunction.FuncName, get_function_varSig_suffix(FuncArgsLocal))

        
        if returnType is not None:
            ArglistProcedure = ArglistProcedure.replace(" in "," ").replace(" out "," ").replace(" inout "," ")
            ret = v_function(
                name=actual_function_name, 
                body=bodystr,
                VariableList=self.astParser.get_local_var_def(), 
                returnType=returnType, #body.get_type(),
                argumentList=ArglistProcedure,
                isFreeFunction=True
            )
            return ret 
            
        ret = v_procedure(
            name=actual_function_name,
            body=bodystr,
            VariableList=self.astParser.get_local_var_def(), 
            argumentList=ArglistProcedure,
            isFreeFunction=True
        )
        
        return ret